0% found this document useful (0 votes)
133 views

Computer Architecture and Organization (CAO) : Visvesvaraya National Institute of Technology

This document provides a syllabus for a Computer Architecture and Organization course. It includes chapters covered, course plan with topics and number of classes, evaluation plan, and book reference. The course covers basic computer structures like functional units, number representation, instruction set architecture, and basic input/output. It is divided into 14 classes over 3 units. Evaluation includes assignments, attendance, two sessional exams, and an end semester exam worth a total of 100 marks.

Uploaded by

Tamboli Masud
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views

Computer Architecture and Organization (CAO) : Visvesvaraya National Institute of Technology

This document provides a syllabus for a Computer Architecture and Organization course. It includes chapters covered, course plan with topics and number of classes, evaluation plan, and book reference. The course covers basic computer structures like functional units, number representation, instruction set architecture, and basic input/output. It is divided into 14 classes over 3 units. Evaluation includes assignments, attendance, two sessional exams, and an end semester exam worth a total of 100 marks.

Uploaded by

Tamboli Masud
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 50

Visvesvaraya National Institute of Technology

Department of Computer Science and Engineering

Computer Architecture and


Organization (CAO)
Course code: CSP311

Credits: 3
SYLLABUS

 Chapter 1
 Chapter 2

 Chapter 3

 Chapter 5

 Chapter 6

 Chapter 7

 Chapter 8

 Chapter 9

 Chapter 12
COURSE PLAN
Topics No. of classes

Unit 1: Basic Structure of Computers

Computer Types, Functional Units, Basic Operational Units 1

Number Representation and Arithmetic Operations & Examples,


1
Character Representation

Performance, Historical Perspective 1

Unit 2: Instruction Set Architecture

Memory Location & Addresses, Memory Operations 1

Instructions & Instruction Sequencing & Examples 1

Addressing Modes, Assembly Language 1

Stacks, Subroutines, Additional Instructions 1

CISC Instruction Sets, RISC & CISC Styles 1


Encoding of Machine Instructions 1

Examples 1

Unit 3: Basic Input/Output

Accessing I/O Devices 2

Interrupts 2

Sessional - I Exam 28th to 31st August 2019

Total classes: 14
Evaluation Plan (of 100 Marks):

Faculty Assessment - 20 Marks Faculty Name -


 Assignments - 16 Marks Ms. Pooja Manisha Rahate
 Attendance - 4 Marks
Sessional 1 - 15 Marks Sessional 2 - 15 Marks
Course Coordinator –
End Semester - 50 Marks

Book for reference:


Carl Hamacher, ‘ Computer Organization’, 6th edition
CHAPTER 1
BASIC STRUCTURES OF COMPUTERS
1.1 Computer Types:

1. Embedded computers

1. Industrial

2. Home automation

3. Appliances

4. Telecommunication products

5. Vehicles

2. Personal Computers

1. Home

2. Educational institutions

3. Business

4. Individual use
3. Servers and Enterprise systems
1. Large databases
2. Shared by large number of users
3. Institutional servers
4. Organizational Servers and so on.
4. Supercomputers & Grid computers
1. Weather forecasting
2. Engineering design
3. Simulation
4. Scientific work
5. Information searching
6. Numerical computation and so on.
1.2 Functional Units:
Computer consists of five functionally independent main parts:
1. Input
2. Memory
3. Arithmetic and logic
4. Output
5. Control Units

Arithmetic
Input and logic unit

Memory

Output Control Unit


 Input unit accepts coded information from human
operators using devices such as keyboards or from
other computers over digital communication lines.
 Information received is stores in computers memory
for latter use or processed immediately by arithmetic
and logic unit.
 Processing steps specified by the program stored in
the computer’s memory.
 Finally the results are send back to the outside
world through the output unit.
 All these actions coordinated by the control unit.

 Interconnection network provides the means for


communication between these functional units.
 Arithmetic and logic unit in combination with the
control circuits are called as processors.
 Input and output equipments are commonly referred
as the input/output (I/O) unit.
 How information is handled by the computer?
 Can divide the information in two categories either as
instructions or data.
 Instructions or machine instructions are explicit
commands that;
 Govern the transfer of information within a computer as well as
between the computer and its I/O devices.
 Specify the arithmetic and logic operations to be performed.

 A program is a list of instructions which performs


a task.
 Programs – stored in the memory.
 Processor fetches the program instructions one after the
another and perform desired operations.
 Computer is controlled by the stored program except the
possible external interruption by an operator or any I/O
device.
 Data are numbers or characters used as the operands. And
is also stored in the memory.
 Instructions and data handled by the computer must
be encoded in a suitable format.
 New hardware employs digital circuits that have two
stable states (0 or 1).
 Each instruction, number or character is encoded as a
string of binary digits called bits.
 Numbers – represented in positional binary notation
 Alphanumeric characters – expressed in terms of binary
codes.
(will discuss these in detail in later part of this chapter)
1.2.1 Input Units
 Computers accept coded information through the input
units.
 Common input device is keyboard.
 When a key is pressed, corresponding letter or digit is
automatically translated into its corresponding binary code
and transmitted to the processor.
 Many other kinds of input devices;
 Touchpad
 Mouse
 Joystick
 Trackball
 These devices used as a graphic input devices conjunction
with displays
 Microphones - used to capture audio input, which is
converted into digital codes for storage and processing.
 Similarly cameras can be used to capture video input.
 Digital communication facilities, such as Internet – provide
input to a computer from other computers and database
servers.
1.2.2 Memory Unit
 Memory unit – store programs and data.

 Two classes of storage – primary and secondary.

 Primary Memory
 Primary memory aka main memory.
 Fast memory operates at electronic speeds
 Programs must be stored in this memory while they are
being executed.
 Memory consists of large number of semiconductors storage
cells, capable of storing one bit of information.
 These cells are rarely read or written individually.
 Instead, handled in groups of fixed size called words.
 Number of bits in each word – known as word length of the
computer; 16, 32 or 64 bits.
 To provide easy access to any word in the memory, a distinct
address is associated with each word location.
 Addresses are consecutive numbers – starting from 0,
identify successive location.
 A particular address is accessed by specifying its address
and issuing a control command to the memory that starts
the storage or retrieval process.
 A memory in which any location can be accessed in a short
and fixed amount of time after specifying its address is
called random – access memory (RAM).
 Time required to access one word – memory access time.
 Time is independent of the location of the word being
accessed.
 Ranges – few nanoseconds (ns) to about 100 ns for current
RAM units.
 Cache Memory
 Adjunct to the main memory - smaller and faster RAM
unit called – a cache.
 Used – hold sections of a program currently being
executed, along with any associated data.
 Cache – tightly coupled with the processor, contained on
the same integrated chip.
 Purpose – facilitate high instruction execution rates.
 Start of the program – cache is empty
 Program instructions and associated data stored - main
memory.
 Execution proceed – instructions are fetched into the
processor chip.
 Copy of each – placed in the cache.
 Whenever data required for execution - data are fetched -
copy of the data placed in the cache.
 Repeated instructions– such as loop instructions fetched
quickly as copy of them already exists in the cache.
 Same goes for the data.
 Secondary Storage
 Primary Memory tends to be expensive & does not retain
information when power is turned off.
 Secondary storage
 Less expensive
 Used – large amount of data and many programs, particularly
information that is accessed infrequently.
 Access time longer than primary storage.
 Examples – magnetic disks, optical disks (DVD and CD),
flash memory devices.

1.2.3 Arithmetic and Logic Unit(ALU)


 Most computer operations – executed in the ALU of
the processor.
 AL operations – addition, subtraction, multiplication,
division or comparison of numbers, initiated by
brining the operands into the processor where
operations are performed by the ALU.
 Example: two numbers located in the memory – for
addition. They are brought into the memory,
addition performed by the ALU, output stored in the
memory or retained back to the processor for
immediate use.
 The operands that are brought into the processor –
stored in the high speed storage elements called
registers.
 Access time to registers is shorter than the cache
unit access time.

1.2.4 Output Unit


 Counterpart of the input unit.

 Send processed results to the outside world.

 Example: Printer
 Most printers employ – either photocopying
techniques (laser printers) or ink jet streams.
 Such printers may generate output at speeds of 20 or
more pager per minute.
 Printers are mechanical devices – quite slow
compared to the electronic speed of the processor.
 Some units – graphic displays – performs the role of
input as well as output through the touch screen
capability.
 This dual role of such units is the reason for using I/O
units in many cases.

1.2.5 Control Unit


 Memory , ALU and I/O units store and process
information and perform the input and output
operations.
 These units must be coordinated in some ways.
 It is the responsibility of the control unit.

 Control unit – effectively the never center – sends


control signal to the other units and sense their
states.
 I/O transfers – consists of input & output operations
– controlled by the program instructions - identifies
the devices involved – and the information to be
transferred.
 Control circuits responsible – generating timing
signals – governs the transfers and determine when
a given action is to take place.
 Data transfer between processor and the memory –
managed by the control unit through timing signals.
 Control unit – physically separated unit – interacts
with other parts of the computer.
 Much of control circuit physically distributed through
out the computer.
 Large set of control line (wires) carries the signals
used for timing and synchronization of events in all
units.
 Operation of a computer summarized as:
 Computer accepts information in the form of programs
and data through an input unit and stores in the memory.
 Information stored in the memory is fetched under
program control into ALU, where it is processed.
 Processed information leaves the computer through the
output unit.
 All activities in the computer are directed by the control
unit.
1.3 BASIC OPERATIONAL CONECPTS
 Activity in a computer is governed by instructions.

 To perform a task, an appropriate program consisting of


list of instructions is stored in the memory.
 Individual instructions are brought from the memory into
the processor, which executes the specified operations.
 Data to be used as instructions operands are also stored
in the memory.
Contains address of
 E.g. Load R2, LOC the memory location
from where the data
is to be read
 Instruction reads the contents of the memory location
whose address is represented symbolically by the label
LOC and loads them into the processor register R2.
Load R2, LOC
 Original content of location LOC are preserved, where as
those of register R2 are overwritten.
 Execution of above instruction requires several steps;
 Instruction fetched from the memory into the processor
 Operation to be performed, determined by the control unit
 Operand of LOC is fetched from the memory into the
processor
 Operand stored in register R2.
 After the operands has been loaded from the memory
into processor registers, the arithmetic and logic
operations are performed on them.
 E.g. Add R4, R2, R3
 Meaning – add contents of register R2 and R3 and store their
sum into register R4.
 After performing the operations, the result is in the processor
register R4.
 It can be transferred to the memory using the store
instruction such as
Store R4, LOC
 For Load and Store instruction, transfers between the
memory and the processor are initiated by sending the
address of the desired memory location to the memory
unit and asserting the appropriate control signals.
 The data are then transferred to or from the memory
 In addition to ALU and control circuitry, the processor
contains the no. of registers used for several different
purposes.
 Instruction register (IR) holds the instruction that is
currently being executed.
 Its output is available to the control circuits, which
control the timing of the signals that various processing
elements involved executing the instruction.
 Program Counter (PC) is another specialized register.

 It contains memory address of the next instruction to be


fetched and executed.
 During execution of an instruction, contents of PC are
updated correspond to the address of the next instruction
to be executed.
 PC points to the next instruction to be fetched from the
memory.
 In addition with IR and PC, shows general purpose
registers R0 through Rn-1, often called processor register.
 General purpose registers serve variety of functions:
 Holding operands load from memory to processor for processing
 Processor – memory interface is a circuit – manages
transfer of data between the main memory and the
processor.
 If word to be read from the memory, interface sends the
address of that word to the memory along with the Read
control signal.
 The small diagrammatical representation of this is given
below.
1.
5. To read data,
If the word is sends
to be written Location and
Memory Read control
back to the
Signal to
memory, retrieve the
sends the particular
address and data
the word
with Write
control
signal Interface
2.
Waits
to
retrieve
4. 3. the data
Performs some Transfers it
operations that to the
are required appropriate
processor
register
 Some typical operation steps:
 Program
 in MM to get executed
 Often transferred from secondary storage to MM

 Execution begins with the PC set to the 1st instruction of the


program.
 PC contents – transferred to memory along with the Read
control signal
 Addressed word – fetched from the memory & loaded into
register IR
 At this point the instruction is ready to be interpreted and
executed.
 Instructions Load, Store and Add
 Perform data transfer and arithmetic operations.
 Operands reside in memory –fetched – by sending the
address and Read control signal
 After fetched – ALU performs operations in processor
register.
 To store result, use Store instruction – transfers
processor register to the memory with address of
location with Write control signal.
 PC contents are incremented during these steps, so
that the next instruction must get executed after
completion of the previous instruction execution.
 In addition to all this transfer of data from memory to
processor and vice versa, computer accepts data from
input devices and sends data to output devices.
 For this, machine instructions are provided for
handling I/O transfers.
 Normal execution of program, may be preempted, if
some devices requires urgent services.
 E.g.
 monitoring device in a computer controlled industrial
process- detect dangerous condition.
 To respond immediately, execution of the current program
must be suspended.
 For this, device raises interrupt signal- which request for
service by the processor.
 Processor provides the service by executing the interrupt –
service routine.
 Such diversions alters processor’s internal state. Due to
this, it is necessary to save the processor state in the
memory, before servicing the interrupt request.
 The information that is normally saved is;
 Contents of PC
 Contents of general purpose registers
 & some control information.

 Once the interrupt – service routine is completed –


state of the processor is restored from the memory (for
the continuation of the previous program).
1.4 NUMBER REPRESENTATION & ARITHMETIC
OPERATIONS
 Natural way to represent a number in a computer system
– string of bits called binary number.
 1.4.1 INTERGER
 Consider n-bit vector or string
B = bn-1…...b1b0
bi = 0 or 1 0 ≤ i ≤ n-1
 This vector can represent an unsigned integer value V(B)
in range of 0 to 2n-1, where,
V(B) = bn-1x2n-1+……+b1x21+b0x20
 Need to represent both positive and negative integer.
 Three systems are used for representing such numbers;
 Sign & magnitude
 1’s – complement
 2’s - complement
 Positive values have identical representation in all
systems
 Negative values have different representation

 Sign & Magnitude


 In this system, negative values are represented by
changing the most significant bit.
 1’s – complement
 Here negative values are obtained by complementing each bit
of the corresponding positive number.
 Same is done to convert the negative number to the positive
number.
 Has two representation for zero. One for positive zero and
second for negative zero.
 2’s – complement
 To obtain the 2’s complement of a number, subtract the number
from 2n
 Another way, take the 1’s complement of the number and then
add 1 to it.
 Range of values in 2’s complement is -2n to +2n-1
 Has only one representation for zero.
 Addition of unsigned integer
 Addition of 1-bit number is given below.

 2-bit vector represents the value 2. The sum of 1 and 1 is 10


where sum value is 0 and 1 is carry out.
 The carry – out from a bit pair becomes the carry – in to the
next pair to the left.
 Addition and Subtraction of signed numbers
 2’s complement system is the most efficient method for
performing addition and subtraction operations.
 To understand 2’s complement arithmetic, consider addition
modulo N (i.e. mod N)
 A helpful graphical device for the description of addition of
unsigned integers mod N is circle with values 0 through N-1
marked along its perimeter.
 The decimal values 0 through 15 are represented by their 4-bit
binary values 0000 through 1111.
 (7+5) mode 16 the value is 12.
 To perform this operation graphically, locate 7 (0111) on the
outside of the circle and then move 5 units in the clockwise
direction to arrive at the answer 12 (1010).
 Reinterpret the binary vectors outside the circle to represent
signed integers from -8 to +7 in the 2’s complement
representation.
Fig. 1.5 Modular number system and the 2’s – complement system
 Let us apply the mod 16 addition technique to the example
of adding +7 to -3.
 The 2’s complement representation for these numbers is
0111 and 1101 respectively
 To add these numbers, locate 0111 to the circle. Then move
1101
 (13) steps in the clockwise direction to arrive at 0100,
which yields the correct answer of +4.
 If we perform this addition by adding with pairs from right
to left we obtain.

 If we ignore the carry-out from the fourth bit position in


this addition we obtain the correct answer.
 As we move around the circle in figure 1.5b, the value
next to 1111 would normally be 10000 instead we go back
to the value 0000.
 The rules governing addition and subtraction of n-bit
signed number using the 2’s - complement representation
system may be stated as follows:
 To add two numbers , add their n-bit representations ,
ignoring the carry-out bit from the most significant bit (MSB)
position. The sum will be the algebraically correct value in 2’s
– complement representation if the actual result is in the
range -2n-1 through +2n-1 - 1.
 To subtract two numbers X and Y ,that is to perform X-Y ,
from the 2’s – complement of Y , then add it to X using the
rule. Again , the result will be the algebraically correct value
in 2’s complement representation if the actual result is in the
range -2n-1 through +2n-1 - 1.
 For examples refer book pg no. 14
 The simplicity of adding and subtracting signed numbers
in 2’s – complement representation is the reason why this
number representation is used in modern systems.
 It might seem that the 1’s – complement representation
would just be as good as the 2’s complement system.
 However, although complementation is easy, the result
obtained after addition operation is not always correct.
 The carry – out, cn, cannot be ignored.

 If cn=0, the result obtained is correct.

 If cn =1, then a 1 must be added to the result to make it


correct.
 The need for this correction operation means that addition
and subtraction cannot be implemented as conveniently in
the 1’s – complement system as in 2’s – complement
system
 Sign Extension
 Represent value of certain no. of bits using the larger no. of
bits.
 E.g. to represent 1 or 2 we use 8 - bits in general.
 For positive number – achieved this by adding 0’s to the left.
 For negative number – by adding leftmost bit as 1.

 In short, to represent a signed number in 2’s complement


form using a larger no. of bits, repeat the sign as many
times as needed to the left.
 This is called sign extension.

 Compare it to larger circles for the mod 32 or mod 64


cases.
 The representations for the values -1, -2, etc., are exactly
the same, with 1s added to the left.
 Overflow in Integer Arithmetic
 Using 2’s complement representation, n bits can represent
values in the range -2n-1 through +2n-1 – 1.
 E.g. in 4-bit representation the values ranges from -8 through
+7.
 When actual result of an arithmetic operation is outside the
representable range, an arithmetic overflow has occurred.
 When adding unsigned numbers, a carry – out of 1 from the
most significant bit position indicates that an overflow has
occurred.
 This is not always true when adding signed numbers.
 E.g. Consider 4-bit system, add +7 and +4, the sum vector is
1011, which is representation of -5, an incorrect result.
 In this case, the carry out bit from the MSB position is 0.
 Similarly if we add -4 and -6, we get 0110 = +6, also an
incorrect result.
 Here the carry – out bit is 1.
 Hence, the value of the carry – out bit from the sign – bit
position is not an indicator of overflow.
 Clearly, overflow may occur only if both summands have
the same sign.
 The observation to detect the overflow is, when adding
two numbers in 2’s – complement, if the sign of the two
summands and the sign of the result does not match.
 1.4.2 FLOATING – POINT NUMBERS
 In 32 – bit word length, 2’s complement representation ranges
from -231 to +231-1.
 In decimal terms, this range is somewhat smaller than -1010 to
+1010.
 The same 32 – bit patterns can also be interpreted as fractions
in the range –1 to +1 – 2-31. if we assume that the binary point
just to the right of the sign bit; that is between bit b31 and bit
b30 at the left end of the 32 – bit representation.
 In this case, the magnitude of the smallest fraction
representable is approximately 10-10.
 Neither of these two fixed – point representation has a
range that is sufficient for many scientific and
engineering calculations.
 For convenience, we would like to have a binary number
representation that can easily accommodate both very
large integers and very small fractions.
 To do this, computer must be able to represent numbers
and operate on them in such a way that the position of the
binary point is variable and is automatically adjusted as
computation proceeds.
 In this case, the binary point is said to float, and the
numbers are called floating – point numbers.
 Since the position of the binary point in a floating point
number varies, it must be indicated explicitly in the
representation.
 For example, in the familiar decimal scientific notation,
numbers may be written as 6.027 x 1023, 3.7291 x 10-27,
-1.0341 x 102, -7.3000 x 10-14 and so on.
 These numbers have been given to 5 significant digits of
precision.
 The scale factors 1023, 10-27, 102, 10-14 indicate actual
position of the decimal point with respect to the
significant bits.
 The same approach can be used to represent binary
floating – point numbers in a computer, except that it is
more appropriate to use 2 as the base of the scale factor.
 The exponent may be positive and negative.

 The binary floating – point number can be represented by;


 A sign of the number
 Some significant bits
 A signed scale factor exponent for an implied base of 2
 Established international IEEE standard for 32 – bit
floating – point number representation uses a sign bit, 23
significant bits, and 8 bits for a signed exponent of the
scale factor, implied by base of 2.
 In decimal terms, the range of numbers represented is
roughly ±10-38 to ±1038, adequate for most scientific and
engineering calculations.
1.5 CHARACTER REPRESENTATION
 Common encoding for characters is ASCII (American Standard
Code for Information Interchange)
 Alphanumeric, operators, punctuation symbols and control
characters – represented by 7 – bit codes.
 Convenient to use an 8-bit byte to represent and store a
character.
 Code occupies – low –order seven bits.
 High – order bit is usually set to 0.
 Low – order four bits of the ASCII codes for the decimal digits 0
to 9 are the first ten values of the binary number system.
 This 4 – bit encoding is referred to as the binary – coded
decimal (BCD) code.
 For ASCII code table – refer page no. 18 of the book.
 1.6 PERFORMANCE
 Most important measure of the performance of a computer –
how quickly it can execute programs.
 Speed with which a computer executes – affected by the design
of the instruction set, its hardware and its software, including
the operating system, and the technology in which the
hardware is implemented.
 Programs written in high –level language – performance is
affected by the compiler that translates programs into machine
language.
 1.6.1 TECHNOLOGY
 Technology of VLSI (Very Large Scale Integration) – used to
fabricate the electronic circuits for a processor on a single chip
is a critical factor in the speed of execution of machine
instructions
 The speed of switching between the 0 and 1 states in logic
circuits is largely determined by the size of the transistors that
implemented the circuits.
 Smaller transistors switch faster.
 Advances in fabrication technology over several decades –
reduced transistor sizes dramatically.
 Two advantages –
 Instructions can be executed faster
 More transistors can be placed on a chip.

 All this leads to more logic functionality and more memory


storage capacity.
 1.6.2 PARALLELISM
 Performance can be increased by performing a number of
operations in parallel
 Parallelism can be implemented on many different levels:
1. Instruction – level Parallelism
2. Multicore Processor
3. Multiprocessors
 Instruction – level parallelism
 Simplest way – execute a sequence of instructions in a
processor is to computer all steps of the current instruction
before starting the steps of the next instruction.
 Overlapping the execution steps of the successive instructions,
total execution time will be reduced.
 E.g. the next instruction could be fetched from memory - at the
same time – arithmetic operation is being performed on the
register operands of the current instruction.
 Multicore processors
 Multiple processing units can be fabricated on a single chip.
 The term core – used for each of these processors.
 The term processor – used for the complete chip.
 Terminologies – dual – core, quad – core and octo – core
processors for chips that have two, four and eight cores,
respectively.
 Multiprocessors
 Computer systems – contain many processors, each possibly
containing multiple cores.
 Such systems are called multiprocessors.
 These systems either execute a number of different application
tasks in parallel or they execute subtasks of single large task in
parallel.
 All processor –access to all the memory - called as shared –
memory multiprocessor
 High performance
 Higher complexity and cost
 Arising from the use of multiple processors and memory units,

 More complex interconnection networks

 Contrast to multiprocessor, possible use of interconnected


group of complete computers to achieve high total
computational power.
 Computers – have access only to their own memory units.
 when the tasks they are executing need to share data, they do
so by exchanging messages over a communication network.
 Property name message passing multicomputers.

 1.7 HISTORICAL PERSPECTIVE


 (Self study topic)
ASSIGNMENT – 1 (2 MARKS)

 Why 1’s – complement is not good and not used in the


system?
 Design mod 32 and mod 64 systems and perform the
following questions using the same.
1. 5 - bit
 -5 and -7 (add & sub)

 +9 and +6 (add & sub)

 -6 and +9 (add & sub)

2. 6 - bit
 12 and 15 (add and sub)

 -16 and +9 (add & sub)

 20 and -21 (add & sub)

LAST DATE OF ASSIGNMNET – 1 SUBMISSION  13 Aug 2019

You might also like