COMPUTER ORGANIZATION
AND ARCHITECTURE
Unit 1: Basic Structure of Computers & Register Transfer Language
Introduction
Need of studying COA
• Gives insight to programmers how a computer executes programs internally so
that they can write effective programs
• Provides good knowledge of hardware
09/08/2024 2
09/08/2024 3
Computer Types
• Computer is a fast electronic calculating machine which accepts digital input,
processes it according to the internally stored instructions (Programs) and
produces the result on the output device.
09/08/2024 4
Architecture and Organization
• Architecture refers to those attributes of a system that are visible to a
programmer or those attributes that have a direct impact on the logical execution
of a program
— instruction set, instruction format, no. of bits used for data representation, I/O
mechanism, addressing modes, specific registers and their roles
• Organization refers to how the hardware components operate and their
interconnections that realize the architectural specifications. This gives insight as
to how internal operations are being carried out while a program gets executed
— control signal, interfaces to peripherals, memory technology
09/08/2024 5
• The computers can be classified into various categories as given below:
Micro Computer: A personal computer; designed to meet the computer needs of
an individual. Provides access to a wide variety of computing applications, such as
word processing, photo editing, e-mail, and internet.
Laptop Computer: A portable, compact computer that can run on power supply
or a battery unit. All components are integrated as one compact unit.
Work Station: Powerful desktop computer designed for specialized tasks.
Generally used for tasks that requires a lot of processing speed
Super Computer: A computer that is considered to be fastest in the world. Used
to execute tasks that would take lot of time for other computers. e.g. Modeling
weather systems, genome sequence
09/08/2024 6
Main Frame: Large expensive computer capable of simultaneously processing
data for hundreds or thousands of users. Used to store, manage, and process
large amounts of data that need to be reliable, secure, and centralized
Hand Held: It is also called a PDA (Personal Digital Assistant). A computer that
fits into a pocket, runs on batteries, and is used while holding the unit in your
hand. Typically used as an appointment book, address book, calculator and
notepad.
Multi core: Have multiple cores – parallel computing platforms. Many cores or
computing elements in a single chip. Typical examples: Sony Play station, Core 2
Duo, i3, i7 etc.
09/08/2024 7
Functional units
• A computer in its simplest form
comprises five functional units
namely input unit, output unit
memory unit, arithmetic & logic
unit and control unit.
09/08/2024 8
• Input unit: Computer accepts encoded information through input unit. The standard
input device is a keyboard. Whenever a key is pressed, keyboard controller sends the
code to CPU/Memory.
• Memory unit: Memory unit stores the program instructions (Code), data and results of
computations etc. Memory unit is classified as: Primary memory and secondary memory
Primary memory is a semiconductor memory that provides access at high speed. Run
time program instructions and operands are stored in the main memory. Main memory is
classified again as ROM and RAM. ROM holds system programs and firmware routines
such as BIOS, POST, I/O Drivers that are essential to manage the hardware of a computer.
RAM is termed as Read/Write memory or user memory that holds run time program
instruction and data. While primary storage is essential, it is volatile in nature and
expensive
09/08/2024 9
• Arithmetic and logic unit: ALU consist of necessary logic circuits like adder,
comparator etc., to perform operations of addition, multiplication, comparison of
two numbers etc.
• Output unit: Computer after computation returns the computed results, error
messages, etc. via output unit. The standard output device is a video monitor,
LCD/TFT monitor. Other output devices are printers, plotters etc.
• Control unit: Control unit co-ordinates activities of all units by issuing control
signals. Control signals issued by control unit govern the data transfers and then
appropriate operations take place. Control unit interprets or decides the
operation/action to be performed.
09/08/2024 10
09/08/2024 11
• The CPU exchanges data with memory. For this purpose, it typically makes use of
two internal (to the CPU) registers: a memory address register (MAR), which
specifies the address in memory for the next read or write, and a memory buffer
register (MBR), which contains the data to be written into memory or receives
the data read from memory. Similarly, an I/O address register (I/OAR) specifies a
particular I/O device. An I/O buffer (I/OBR) register is used for the exchange of
data between an I/O module and the CPU.
• A memory module consists of a set of locations, defined by sequentially
numbered addresses. Each location contains a binary number that can be
interpreted as either an instruction or data. An I/O module transfers data from
external devices to CPU and memory, and vice versa. It contains internal buffers
for temporarily holding these data until they can be sent on.
09/08/2024 12
• Operations
1. A set of instructions called a program reside in the main memory of computer.
2. The CPU fetches those instructions sequentially one-by-one from the main
memory, decodes them and performs the specified operation on associated
data operands in ALU.
3. Processed data and results will be displayed on an output unit.
4. All activities pertaining to processing and data movement inside the computer
machine are governed by control unit.
09/08/2024 13
• The basic function performed by a computer is execution of a program, which
consists of a set of instructions stored in memory. Instruction processing consists
of two steps: The processor reads (fetches) instructions from memory one at a
time and executes each instruction. Program execution consists of repeating the
process of instruction fetch and instruction execution.
09/08/2024 14
• At the beginning of each instruction cycle, the processor fetches an instruction
from memory. The program counter (PC) holds the address of the instruction to
be fetched next, the processor always increments the PC after each instruction
fetch so that it will fetch the next instruction in sequence.
• The fetched instruction is loaded into a register in the processor known as the
instruction register (IR). The processor interprets the instruction and performs
the required action
Data may be transferred from processor to memory or from memory to
processor
The processor may perform some arithmetic or logic operation on data
An instruction may specify that the sequence of execution be altered
09/08/2024 15
Register Transfer Language
• Micro-operations: The operations executed on data stored in registers. The
result of the operation may replace the previous binary information of a register
or may be transferred to another register.
• Register transfer: The availability of hardware logic circuits that can perform a
stated micro-operation and transfer the result of the operation to the same or
another register.
• Register transfer language: A system for expressing in symbolic form the micro-
operation sequences among the registers of a digital module.
09/08/2024 16
• The internal hardware organization of a digital computer is best defined by
specifying
The set of registers it contains and their functions
The sequence of micro-operations performed on the binary information stored
The control that initiates the sequence of micro-operations
09/08/2024 17
Representation of registers
• Memory address register (MAR) Holds the address for memory unit
• Program counter (PC)
• Instruction register (IR)
• Processor register (R1)
09/08/2024 18
• Some examples
: Transfer the contents of register R1 to register R2. However, the contents of
source register remain unchanged
: under a pre-determined control condition, transfer the contents of register R1 to
register R2. P is a control signal
09/08/2024 19
Basic symbols for register transfers
09/08/2024 20
• Multiplexers
A Multiplexer (MUX) can be described as a combinational circuit that receives
binary information from one of the 2^n input data lines and directs it to a single
output line. The selection of a particular input data line for the output is decided
on the basis of selection lines.
09/08/2024 21
• Higher order multiplexers can be implemented using lower order multiplexers
• For instance, let us implement an 8:1 multiplexer using two 4:1 multiplexers and
a 2:1 multiplexer.
09/08/2024 22
09/08/2024 23
Bus Interconnection and Structure
• A bus is a communication pathway connecting two or more devices. A key
characteristic of a bus is that it is a shared transmission medium. Multiple devices
connect to the bus, and a signal transmitted by any one device is available for
reception by all other devices attached to the bus. If two devices transmit during
the same time period, their signals will overlap and become garbled. Thus, only
one device at a time can successfully transmit.
• A bus consists of multiple communication pathways, or lines. Each line is capable
of transmitting signals representing binary 1 and binary 0. An 8-bit unit of data
can be transmitted over eight bus lines. A bus that connects major computer
components (processor, memory, I/O) is called a system bus.
09/08/2024 24
• The data lines provide a path for moving data among system modules. These
lines, collectively, are called the data bus
• The address lines are used to designate the source or destination of the data on
the data bus.
• The control lines are used to control the access to and the use of the data and
address lines. Control signals transmit both command and timing information
among system modules. Timing signals indicate the validity of data and address
information. Command signals specify operations to be performed.
09/08/2024 25
Bus and memory transfers
• A typical digital computer has many registers and paths must be provided from
one register to another for transferring information
• Rather than connecting wires between all registers, an efficient way for
transferring information between registers is the use of a common bus system
• A bus structure consists of a set of common lines through which binary
information is transferred one bit at a time.
• Control signals determine which register is selected by bus during each register
transfer
09/08/2024 26
• Multiplexers can be used to construct a common bus. The select lines are used
to choose the source register whose binary information is placed on the bus.
09/08/2024 27
• In general, a bus system will multiplex n-bit data stored in k-registers, producing
an n-line bus.
• The number of multiplexers needed to construct the bus = n: no. of bits of data
• Size of each multiplexer = k:1, k: no. of registers
09/08/2024 28
Decoders
• A Decoder can be described as a combinational circuit that converts binary
information from the 'n' coded inputs to a maximum of 2^n different outputs.
• The most preferred or commonly used decoders are n-to-m decoders, where
m<= 2^n.
• a 3-to-8 line decoder with three input variables are decoded into eight output,
each output representing one of the combinations of the three binary input
variables.
09/08/2024 29
09/08/2024 30
• Instead of multiplexers, three-state gates can be used for constructing a bus
system
• A three-state gate exhibits three states
Two of the states are signals equivalent to logic 1 and 0
The third state is a high-impedance state – this behaves like an open circuit,
which means the output is disconnected and does not have a logic significance
09/08/2024 31
• To construct a common bus for four registers of n bits each using three-state
buffers, we need n circuits with four buffers in each
• Decoders are used to ensure that no more than one control input is active at
any given time
09/08/2024 32
09/08/2024 33
• Bus Transfer
• The transfer of data between bus and register is symbolized as:
The content of register C is placed on the bus and the content of the bus is
loaded into register R1
09/08/2024 34
• Memory Transfer
• The transfer of information from a memory word to the outside environment is
called a read operation. The transfer of new information to be stored into the
memory is called a write operation
a memory unit that receives the address from a register, called the address
register, symbolized by AR. The data are transferred to another register, called
the data register, symbolized by DR
The write operation transfers the content of a data register to a memory word M
selected by the address
09/08/2024 35
Arithmetic micro-operations
• The basic arithmetic micro-operations are addition, subtraction, increment,
decrement, and shift
• The multiplication operation is implemented with a sequence of add and shift
micro-operations. Division is implemented with a sequence of subtract and shift
micro-operations
09/08/2024 36
• To implement the add micro-operation with hardware, we need the registers
that hold the data and the digital component that performs the addition
• The digital circuit that generates the arithmetic sum of two binary numbers of
any length is called a binary adder
09/08/2024 37
• To implement the subtract micro-operation 2’s complement method can be used
• For A-B, take 2’s complement of B and add to A
• 2’s complement = 1’s complement + 1 to LSB
• 1’s complement in hardware can be implemented by using inverters and 1 can
be added using input carry
• A binary adder-subtractor circuit can be implemented by using full adders with
ex-or gates
09/08/2024 38
• M is a control input. When M = 0, circuit behaves as adder while M = 1, circuit
behaves as subtractor
09/08/2024 39
• Full adders are used to perform the
arithmetic operations while the multiplexers
are used to select the operation to be
performed
09/08/2024 40
Logic micro-operations
• Logic micro-operations specify binary operations for strings of bits stored in
registers. These operations consider each bit of the register separately and treat
them as binary variables
-- It specifies a logic micro-operation to be executed on the individual bits of the
registers provided that the control variable P = 1
09/08/2024 41
09/08/2024 42
09/08/2024 43
Shift micro-operations
• Shift micro-operations are used for serial transfer of data. The contents of a
register can be shifted to the left or the right.
09/08/2024 44
Logical Shift
• A logical shift is one that transfers 0 through the serial input. We will
adopt the symbols shl and shr for logical shift-left and shift-right
micro-operations. For example:
R1<-shlR1
R2<-shrR2
are two micro-operations that specify a 1-bit shift to the left of the
content of register R1 and a 1-bit shift to the right of the content of
register R2. The register symbol must be the same on both sides of the
arrow. The bit transferred to the end position through the serial input is
assumed to be 0 during a logical shift.
09/08/2024 45
Circular Shift
• The circular shift (also known as a rotate operation) circulates the bits
of the register around the two ends without loss of information. This
is accomplished by connecting the serial output of the shift register to
its serial input.
• We will use the symbols cil and cir for the circular shift left and right,
respectively.
09/08/2024 46
Arithmetic Shift
• An arithmetic shift is a micro-operation that shifts a signed binary
number to the left or right. An arithmetic shift-left multiplies a signed
binary number by 2.
• An arithmetic shift-right divides the number by 2. Arithmetic shifts
must leave the sign bit unchanged because the sign of the number
remains the same when it is multiplied or divided by 2. The leftmost
bit in a register holds the sign bit, and the remaining bits hold the
number. The sign bit is 0 for positive and 1 for negative. Negative
numbers are in 2's complement form.
09/08/2024 47
Arithmetic Shift-Left
• The arithmetic shift-left inserts a 0 into R0, and shifts all other bits to
the left. The initial bit of Rn-1 is lost and replaced by the bit from Rn-
2. A sign
• reversal occurs if the bit in Rn-1 changes in value after the shift. This
happens if the multiplication by 2 causes an overflow. An overflow
occurs after an arithmetic shift left if initially, before the shift, Rn-1 is
not equal to R-2. An overflow flip-flop Vs can be used to detect an
arithmetic shift-left overflow.
09/08/2024 48
• Shift micro-operations are used for serial transfer of data. The contents of a
register can be shifted to the left or the right
• An arithmetic shift is a micro-operation that shifts a signed binary number to the
left or right. The arithmetic shift-left inserts a 0 into R0, and shifts all other bits to
the left. The initial bit of Rn-1 is lost and replaced by the bit from Rn-2 . A sign
reversal occurs if the bit in Rn-1 changes in value after the shift and caused an
overflow.
• The arithmetic shift-right leaves the sign bit unchanged and shifts the number
(including the sign bit) to the right.
09/08/2024 49
09/08/2024 50
Arithmetic logic shift unit
• The arithmetic logic unit (ALU) is a common operational unit connected to a
number of storage registers
• To perform a micro-operation, the contents of specified registers are placed in
the inputs of the ALU
• The ALU performs an operation and the result is then transferred to a
destination register
• The ALU is a combinational circuit so that the entire register transfer operation
from the source registers through the ALU and into the destination register can
be performed during one clock pulse period
09/08/2024 51
09/08/2024 52