R22 COA Unit 1
R22 COA Unit 1
UNIT I
DIGITAL COMPUTERS: Introduction – Block diagram of digital computer – Definition of
computer organization – computer design and computer arithmetic.
REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer
Language – Register transfer, Bus and memory transfer – Arithmetic micro operations, Logic
micro operations, Shift micro operations, and Arithmetic logic shift unit.
BASIC COMPUTER ORGANIZATION AND DESIGN: Instruction codes – computer
registers – computer instructions – Timing and control – Instruction cycle – memory reference
instructions – Input-Output and Interrupt.
The term Architecture deals with the hardware design of the computer system. It deals
with structure and behavior of the various functional modulus of the computer and how they
interact to provide the processing needs of the user. It includes instruction format, instruction
set, and techniques for addressing the memory.
The term Organization deals with the way the hardware components are connected
together to form a computer system.
The term Design involves in the development of the hardware for the computer.
1.2 Block diagram of a Digital Computer
Figure 1.1 shows the block diagram of modern computer system (also called Von
Neumann Computer). Von Neumann architecture is based on the following key components.
a. Data and instructions are stored in a single read-write memory.
b. The contents of this memory are addressable by location.
c. All instructions are executed in a sequential manner.
Von Neumann architecture consists of five basic elements: input, memory, control unit,
Arithmetic Logic Unit (ALU) and output.
Input Unit: It is used to feed data into the computer. The common input devices are keyboard,
mouse, joystick, trackball, lightpen, scanner etc.
Output Unit: It is to transfer result to the user. The common output devices are monitor, printer,
plotter etc.
Memory unit: It is used to store programs and data. There are two types of memory used in
computer system namely RAM and ROM.
ALU: It is used to perform computation such as add, subtraction, multiplication and division,
logical operations such as AND, OR, NOT and Shift etc.
Control Unit: It is responsible for generating control signals. It also coordinates among various
function units in the computer system.
Register Unit: It is used to store data temporarily during program execution.
There are different types of devices are connected to the computer systems. Some
devices may be directly connected to the system and some may not be connected to the system
|(kept idle). Those devices which are directly connected to the system are called online devices
and those which are not directly connected to the system are called offline devices. The
combination of online and offline devices are called Peripheral devices or Input-Output (I/O)
devices.
To execute instructions the computer performs the following steps:
a. The control unit reads or fetches an instruction from memory and decodes or translates it.
b. For arithmetic or logic type instructions, the control unit generates enable signals for the
ALU to perform the required operations.
c. For Input/Output(I/O) instructions, the control unit generates enable signals for the I/O
either to input data from or output data to external devices.
PROCESSOR or CPU
The CPU consists of three components namely ALU, Control Unit and Register unit. The
registers are used for temporary storage of data and some special function registers, which
include
a. Memory Address Register (MAR) or Address Register (AR)
b. Memory Buffer Register (MBR) or Memory Data Register (MDR) or Data Register
(DR)
c. Program Counter (PC)
d. Instruction Register (IC)
e. Stack Pointer (SP)
f. Increment Register (INCR)
g. Decrement Register (DECR).
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 2
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
The two registers MAR/AR and MBR/MDR/DR are used to handle data transfer
between the main memory and the processor. The MAR/AR holds the address of the main
memory to or from which data is to be transferred. The MBR/MDR/DR contains the data to be
written into or read from the addressed word of the main memory.
Program Counter (PC) points to the next instruction to be executed. Instruction Register
(IR) is used to hold the instruction that is currently being executed. Stack Pointer (SP) points to
the memory location in stack. Increment Register (INCR) and Decrement Register (DECR)
which is used to increment / decrement the register value by 1.
The symbolic notation used to describe the micro operation transfers among register is
called register transfer language. The term “register transfer” means transfer the result of the
operation to the same or another register. Computer registers are usually represented by
uppercase letters (sometimes followed by numerals). The following notations are usually
denoted by various registers:
MAR Memory Address Register (It holds address of the memory unit)
MBR Memory Buffer Register (It holds data)
PC Program Counter (It points to the next instruction to be executed)
SP Stack Pointer (It points to the memory location in stack)
IR Instruction Register (It is used to hold the instruction that is currently being
executed).
RI Processor Register (i varies from 1 to n depends upon the types of processor)
The two registers MAR and MBR are used to handle data transfer between the main
memory and the processor. The MAR holds the address of the main memory to or from which
data is to be transferred. The MBR contains the data to be written into or read from the
addressed word of the main memory.
Figure 1.2 shows the various representations of registers in block diagram form.
The register is represented by a rectangular box with the name of the register inside (Fig.
1.2 a). Individual bits are represented in Fig. 1.2 b. The numbering of bits in 16-bit register is
shown in fig. 1.2 c and is marked on the top of the box. In fig.1.2 d, the 16 bit register is divided
into two parts, namely bits (0 – 7) assigned as low order byte L (PC(L) or PC(0–7)) and bits 8 –
15 assigned as high order byte H (PC
(H) or PC(8-15)).
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 3
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Normally, the transfer can occur only under a predetermined control condition. This can
also be represented by means of an if…then statement.
If (P = 1) then (R2 R1)
Where P is a control signal generated in the control function. The control function is a
Boolean variable that is 1 or 0. The control condition is terminated by a colon symbol (:).
Therefore, the above statement can be rewritten as:
P: R2 R1.
This statement indicates content of R1 is transferred to R2 only if P=1. Figure 1.3 shows
the block diagram for P: R2 R1.
The basic symbols used in register transfer language are shown in the following table 1.1.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 4
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Data Bus:
It is used to send and receive data to and from several devices (between processor and
memory, between processor and devices or between two I/O devices). It is bidirectional (the data
can flow in either direction). Here, the contents of the addressed memory location are transferred
to the processor over the data bus.
Control Bus:
It is used for transmitting and receiving control signals between the processor and
various devices. It is bidirectional.
The combination of address bus, data bus and control bus is called system bus.
The CPU sends signals on the control bus to enable the outputs of addressed memory
devices or port devices.
I/O Read ( I / OR ) : It causes data from the addressed I/O port to be placed on the bus.
I/O Write ( I / OW ): It causes data on the bus to be output to the addressed I/O port.
Bus Request (BR): It indicates that a module needs to gain control of the bus.
Bus Grant (BG): It indicates that a requesting module has been granted control of the
bus.
Interrupt Request (INTR): It indicates that an interrupt is pending.
Interrupt Acknowledge (INTA): It acknowledges that the pending interrupt has been
recognized.
Clock (CLK): It is used to synchronize the operation.
Reset: It initializes all modules.
Ready
Hold Acknowledge (HLDA)
The operation of the bus is as follows:
If one module wishes to send data to another, then
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 6
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Figure 1.5: Basic Connection between microprocessor and its memory devices
Figure 1.6 shows one way of constructing a common bus system for four registers. The
multiplexers select the source register whose binary information is then placed on the bus. Each
register has 4 bits (0 to 3). The bus consists of four 4 x 1 multiplexers and each having four data
inputs (0 to 3), and two selection inputs S1 and S0.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 7
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
The output 1 of register A is connected to input 0 of MUX1 (A1). Two selection lines S1
and S0 are connected to the selection inputs of all four multiplexers. When S 1S0 = 00, the 0 data
inputs of all four multiplexers are selected and applied to the outputs that form the bus. The
following table 1.2 shows the register that is selected by the bus for each of the four possible
binary values of the selection lines.
S1 S0 Register Selection
0 0 A
0 1 B
1 0 C
1 1 D
The construction for the bus system for the four register is shown below:
In general, a bus system will multiplex k registers of n bits each to produce an n-line
common bus. The number of multiplexers needed to construct the bus is equal to n, the number
of bits in each register. The size of each multiplexer is k x 1, since it multiplexes k data lines.
The transfer of information from a bus into one of many destination registers can be
accomplished by connecting the bus lines to the inputs of all destination registers and activating
the load control of the particular register selected. The symbolic statement for a bus transfer is
denoted by,
BUS C, R1 BUS
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 8
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
It means that, the content of register is placed on the bus, and the content of the bus is
loaded into register R1 by activating its load control input. If the bus is known to exist in the
system, it may be shown to direct transfer
R1 C
It has three states namely input, control input and output. When the control input is high, the
input is transferred to output. When control input is low, it goes to high impedance state. The
schematic diagram for three state buffers is shown below.
To construct a common bus for 4 registers of n-bits each using three state buffers, we need n
circuits with 4 buffers. This is shown in figure 1.8.
Here, each group of 4 buffers receives one bit from the 4 registers. Each common output
produces one of the lines for the common bus for a total of n lines. Only one decoder is
necessary to select between the four registers.
A memory unit is a collection of storage cells together with associated circuits needed to
transfer information in and out of storage. The memory stores binary information in groups of
bits called words. A memory word is a group of 1’s and 0’s and may represent a number, an
instruction code, one or more alphanumeric characters or any other binary coded information.
There are two operation are performed in memory unit namely read and write operation.
The transfer of information from a memory to outside environment is called read operation. The
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 9
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
transfer of new information to be stored into the memory is called write operation. The
following notations are used.
Memory word M
Address of memory [M]
Address Register AR
Data Register DR
1. Register Transfer micro operation – It transfers binary information from one register
to another.
2. Arithmetic micro operation – It performs arithmetic operations on numeric data stored
in registers
3. Logic micro operation – It performs bit manipulation operation on non-numeric data
stored in registers.
4. Shift micro operation – It performs shift operations on data stored in registers.
Note that, the multiplication and division operations are not listed in the table and
multiplication operations are implemented with a sequence of add and shift micro operations and
division operation is implemented with a sequence of subtraction and shift micro operations.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 10
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Binary Adder
The binary adder s constructed with full adder circuits connected in cascade, with the
output carry from one full adder connected to the input carry of the next full adder.
An n-bit adder required n- full adders. The output carry from each full adder is connected
to the input carry of the next-high-order full adder.
The basic component of a ALU design is the parallel adder. It is constructed with a
number of full adder circuits connected in cascade. By controlling the data inputs of the parallel
adder, it is possible to obtain different arithmetic operations. The figure 1.5 shows the arithmetic
operations obtained when one set of inputs to a parallel adder is controlled externally. The
number of bits in the parallel adder may be of any value. The input carry C in goes to the full
adder circuit in the least significant bit position. The output carry C out comes from the full adder
circuit in the most significant bit position.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 11
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Figure 1.5: Arithmetic micro operation obtained by controlling one set of inputs to a
parallel adder
The arithmetic addition is achieved when one set of inputs receives a binary number A,
the other set of inputs receives a binary number B, and the input carry is maintained at 0. This is
shown in figure (a). By making Cin = 1 as in figure (b), it is possible to add 1 to the sum in F.
Similarly, we can obtain other arithmetic operations. The various arithmetic micro-operations
are given in table 1.4.
In figure (g), we insert all 1’s to the B terminals. A binary number with all 1’s represents
the 2’s complement of unity. For example, the 2’s complement of the binary number 0001 is
1111. adding a number A to the 2’s complement of unity produces an output F = A+2’s
complement of 1 = A – 1, which is the decrement micro-operation.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 12
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
One stage of arithmetic circuit provides the micro-operation listed in table is shown in
figure 1.6. The full-adder circuit represents one stage of the parallel adder. The two selection
lines S1 and S0 control the data path between the B terminal and one input of the full-adder
circuit.
When S1S0 = 00, the controlled input of the full adder is always 0.
When S1S0 = 01, the input receives the value of Bi.
When S1S0 = 10, the input receives the complement value of Bi.
When S1S0 = 11, the input is always equal to 1.
These conditions can be verified by deriving the truth table of the selection logic. The
two selection variables S1 and S0 control the input path in the B terminal.
A 4-bit arithmetic circuit that performs eight arithmetic operations is shown in figure 1.7.
Table 1.5: Function table for arithmetic circuit for Figure 1.7
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 13
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Function Select
S1 S2 Cin Y Equals Output Equals Function
0 0 0 0 F=A Transfer A
0 0 1 0 F=A+1 Increment A
0 1 0 B F=A +B Add B to A
0 1 1 B F=A+B+1 Add B to A plus 1
1 0 0 B F=A+ B Add 1’s complement of B to A
1 0 1 B F=A+ B+1 Add 2’s complement of B to A
1 1 0 All 1’s F=A–1 Decrement A
1 1 1 All 1’s F=A Transfer A
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 14
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Table 1.6: Function table for Arithmetic circuit for Figure 1.8
Function Select
S1 S2 Cin Y Equals Output Equals Function
0 0 0 B F=A+B Add
0 0 1 B F=A+B+1 Add with Carry
0 1 0 B F=A+ B Subtract with borrow
0 1 1 B F=A+ B +1 Subtract
1 0 0 0 F=A Transfer A
1 0 1 0 F=A+1 Increment A
1 1 0 All 1’s F=A–1 Decrement A
1 1 1 All 1’s F=A Transfer A
The value of Y inputs to the full-adder circuits are a function of selection variables S 1
and S0. Adding the value of Y + A + Cin gives the arithmetic operation in each entry.
1.8.3 Logic Circuit Design
The logic micro-operations manipulate the bits of the operands separately and treat each
bit as a binary variable. There are 16 logic micro-operation can be performed with two binary
variables is shown in table 1.7 and table 1.8.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 15
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
All these operations can be generated by means of four selection lines. However, there
are only four basic logic operations such as AND, OR, XOR and complement micro-operations.
Figure 1.10 (a) shows one stage of a logic circuit. It consists of four gates and a
multiplexer. Each of the four logic operations AND, OR, XOR, and complement are generated
with a gate that performs the required logic.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 16
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
There are three basic shifts. 1. Logical shift 2. Arithmetic shift and 3. Circular shift
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 17
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
The symbolic notations for various shift operations are shown in table 1.10.
In Logical Shift Left operation, each bit in the register is shifted to the left one by one.
The MSB bit is moved outside the register, and the place of the LSB is filled with zero.
Similarly, in Logical Shift Right operation, each bit in the register is shifted to the right
one by one. The LSB bit is moved outside the register and the place of the MSB is filled with
zero.
Example:
In Arithmetic Shift Left operation is same as Logical shift left operation. Here, each bit
in the register is shifted to the left one by one. The MSB bit is moved outside the register, and
the place of LSB is filled with zero.
Similarly, in Arithmetic Shift Right operation, each bit in the register is shifted to the
right one by one. The place of MSB is filled with the previous value of MSB.
Example:
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 18
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
In Circular Shift Left operation, each bit in the register is shifted to the left one by one.
After shifting, the LSB place becomes empty and filled with MSB value.
Similarly, in Circular Shift Right Operation, each bit in the register is shifted to the
right one by one. After shifting, the MSB becomes empty and filled with LSB values.
Example:
We know that, ALU is a combinational circuit which performs computation and the
register transfer operation performs from the source register through the ALU to the destination
register in clock period. The shift operation is also a part of ALU.
The Arithmetic, Logic and Shift circuits can be combined into one ALU with common
selection variables. Figure 1.14 shows that the one-stage of Arithmetic logic and shift unit.
The input Ai and Bi are applied to both arithmetic and logic circuit. A particular micro
operation is selected with inputs S1 and S0. A 4 x 1 multiplexers at the output chooses between
arithmetic output and a logic output. The data in the multiplexers are selected with inputs S3 and
S2. The other two inputs to the multiplexers receive inputs Ai-1 for the shift right micro operation
and Ai+1 for the shift-left micro operation.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 19
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Figure 1.14 shows the one-stage of eight arithmetic operation, four logic operation and
two shift operations. Each operation is selected with the five variables S 0,S1,S2,S3 and Cin. the
input carry Cin is used for selecting arithmetic operations only.
Table 1.10: Function Table for Arithmetic, Logic and Shift Unit
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 20
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Example:
Design an adder/subtractor circuit with one selection variable s and two inputs A
and B. When s=0 the circuit performs A+B. When s=1, the circuit performs A – B by
taking the 2’s complement of B.
Solution: The derivation of the arithmetic circuit is shown in figure 1.15.
The function diagram is shown in figure 1.15 a. For the addition part, we need Cin = 0.
For the subtraction part, we need the complement of B and Cin = 1
The function table is shown in figure 1.15 b.
When s = 0, Xi and Yi of each full adder must be equal to the external inputs Ai and Bi
respectively.
When s = 1, we must have Xi = Ai and Yi = Bi’
The input carry must be equal to the value of s.
The figure 1.15 b shows the position of the combinational circuit in one typical stage of the
arithmetic circuit.
The truth table in figure 1.15 c is obtained by listing the eight values of the binary input
variables. Output Xi = Ai for all eight entries. Output Yi = Bi for the four entries when s = 0. It is
equal to the complement of Bi for the last entries where s = 1.
The simplified output function for the combinational circuit are:
Xi = Ai
Yi = Bi s
The diagram of the 4-bit adder/subtractor circuit is shown in figure 1.16.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 22
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Each input Bi requires an EX-OR gate. The selection variable s goes to one input of each
gate and also to the input carry of the parallel adder.
Example: Show that the block Diagrams of the hardware that implements the following
register transfer statement yT2: R2 R1, R1 R2.
Solution:
Example: Represent the following conditional control statement by two register transfer
statements with control functions.
If (P=1) then ( R1 R2) else if (Q=1) then (R1 R3).
Solutions:
P: R1 R2
P’Q: R1 R3
Example: A digital computer has a common bus system for 16 registers of 32 bits each.
The bus is constructed with multiplexers.
a. How many selection inputs are there in each multiplexers?
b. What size of multiplexers is needed?
c. How many multiplexers are there in the bus systems?
Solution:
a. Four selection lines to select one of 16 registers
b. 16 x 1 multiplexers
c. 32 multiplexers, one for each bit of the register.
Example: The following transfer statements specify a memory. Explain the memory
operation in each case.
a. R2 M[AR] b. M[AR] R3 c. R5 m[R5]
Solution:
a. R2 M[AR] : Read memory word specified by the address in AR into register R2.
b. M[AR] R3 : Write content of register R3 into the memory word specified by the
address in AR
c. R5 m[R5] : Read memory word specified by the address in R5 and transfer content
to R5 (destroys the previous value)
Example: Draw the block diagram for the hardware that implement the following
statements: x + yz: AR AR + BR.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 23
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Solution:
Example: Design an arithmetic circuit with one selection variable S and two n-bit data
inputs A and B. the circuit generates the following four arithmetic operations in
conjunction with the input carry Cin. Draw the logic diagram for the first two
stages.
S Cin = 0 Cin = 1
0 D = A + B (Add) D = A + 1 (Increment)
1 D = A – 1 (Decrement) D = A + B +1 (Subtraction)
Solution:
Example: Register A holds the 8-bit binary 11011001. Determine the B operand and the
logic micro operations to be performed in order to change the value in A to:
a. 01101101 b. 11111101
Solution:
Example: The 8-bit registers AR,BR,CR and DR initially have the following values:
AR = 1111 0010 BR = 1111 1111 CR = 1011 1001 DR = 1110 1010
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 24
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Determine the 8-bit values in each register after the execution of the following
sequence of microoperations.
AR AR + BR Add BR to AR
CR CR DR, BR BR + 1 AND DR to CR, increment BR
AR AR – CR Subtract CR from AR
Solution:
Example:
An 8-bit register contains the binary value 10011100. What is the register value after
arithmetic shift right? Starting from the initial number 10011100, determine the register
value after an arithmetic shift left, and state whether there is an overflow.
Solution:
R = 10011100
Arithmetic shift right: 11001110
Arithmetic shift left: 00111000
Example:
Starting from an initial value of R=11011101, determine the sequence of binary values in R
after a logical shift left, followed by a circular shift right, followed by a logical shift right
and a circular shift left.
Solution:
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 25
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Example:
What is wrong with the following register transfer statements?
a. xT: AR AR , Ar Ar + 1
b. yT: R1 R2, R1 R3
c. zT: PC AR, PC PC + 1
Solution:
a. Cannot complement and increment the same register at the same time.
b. Cannot transfer two different values (R2 and R3) to the same register (R1) at the same
time
c. Cannot transfer a new value into a register (PC) and increment the original value one by
one at the same time.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 26
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
An Instruction code is a group of bits that instruct the computer to perform a specific
operation. It is usually divided into two parts and most important part is operation part.
The operation code of an instruction is a group of bits that define operation such as add,
subtract, multiply, shift and complement. The number of bits required for the operation code of
an instruction depends on the total number of operations available in the computer. When this
operation code is decoded in the control unit, the computer issues control signals to read an
operand from memory and add the operand to a processor register. The instruction code format
is vary from one processor to another processor. Every computer has its own unique instruction
set.
If we store each instruction code in one 16-bit memory word, we have available 4 bits for
the operation code to specify one out of 16 possible operations, and 12 bits to specify the
address of an operand. The control reads a 16-bit instruction from the program portion of
memory. It uses the 12-bit address part of the instruction to read a 16 bit operand from the data
portion of memory. It then executes the operation specified by the operation code.
Computer have a single processor register is called Accumulator register (AC). The
operation performed with the memory operand and the content of AC. If an operation in an
instruction code does not need an operand from memory and can be used to specify other
operations for the computer. For example, clear AC, complement AC, increment/decrement AC
is operates on data stored in the AC register.
Computer instructions are normally stored in consecutive memory locations and are
executed sequentially one at a time. The control reads an instruction from a specific address in
memory and executes it. It then continues by reading the next instruction in sequence and
executes it, and so on. This type of instruction sequencing needs a counter to calculate the
address of the next instruction after execution of the current instruction is completed. It is also
necessary to provide a register in the control unit for storing the instruction code after it is read
from memory. The computer needs a processor register for manipulating data and a register for
holding a memory address. The various registers used in computer are given in the following
table 1.11.
Table 1.11: List of Registers for the Basic Computer
Register Symbol Number of Bits Register Name Functions
DR 16 Data Register Holds memory operand
AR 12 Address Register Holds address for memory
AC 16 Accumulator Processor Register
IR 16 Instruction Register Holds instruction code
PC 12 Program Counter Holds address of the instruction
TR 16 Temporary Register Holds temporary data
INPR 8 Input Register Holds input character
OUTR 8 Output Register Holds output character
The registers are used for temporary storage of data and some special function registers,
which include Program Counter (PC), Instruction Register (IC), Address Register (AR) and
Data Register (DR).
The Program Counter (PC) points to the next instruction to be executed. The
Instruction Register (IR) is used to hold the instruction that is currently being executed.
The two registers AR and DR are used to handle data transfer between the main memory
and the processor. The AR holds the address of the main memory to or from which data is to be
transferred. The DR contains the data to be written into or read from the addressed word of the
main memory. The Temporary Register (TR) is used for holding temporary data during the
processing.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 28
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
The input register INPR receives an 8-bit character from an input device. The output
register OUTR holds an 8-bit character for an output device.
Contents of a location are denoted by placing square brackets around the name of
the location (R1←[LOC], R3 ←[R1]+[R2])
Note:
1. During data transfer operations, the contents of the source register are not destroyed and
the contents of the destination are changed. It does not affect the flags.
2. All arithmetic and logical operations are performed with the contents of the accumulator
and the results are also stored in the accumulator. Here, the flags are affected depending
upon the ALU results
3. Any register/Memory can be used for increment and decrement.
4. A program sequence is altered either conditionally or unconditionally.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 30
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
A register reference instruction are recognized by the operation code 111 with a 0 in the
left most bit (bit 15) of the instruction. A register reference instruction specifies an operation on
or a test of the AC register. An operand from memory is not needed and other 12 bits are used to
specify the operation or test to be executed.
The type of instruction is recognized by the computer control from the 4 bits in positions
12 to 15 of the instruction.
The following table 1.12 shows the basic instructions used in computer. A 3-letter word
represents an abbreviation for programmer and user. The hexadecimal code is equal to the
hexadecimal number of the binary code used for instruction.
Example 1: A computer uses a memory unit with 256K words of 32 bits each. A binary
instruction code is stored in one word of memory. The instruction has 4
parts: an indirect bit, an operation code, a register code part to specify one of
64 registers and an address part.
a. How many bits are there in the operation code, the register code part and the
address part?
b. Draw the instruction word format and indicate the number of bits in each part?
c. How many bits are there in the data and address inputs of the memory?
Solution:
256K = 28 x 210 = 218 (Since 1K = 1024 = 210)
64 = 26
a) Address : 18 bits
Register Code: 6 bits
Indirect bit: 1 bit
Total : 18 + 6 + 1 = 25 bits
Opcode : 32 bits – 25 bits = 7 bits
b) 1 7 6 18 = 32 bits
I Opcode Register address
a. Read instruction
b. Read effective address
c. Read operand.
1.11 Timing and Control
The timing for all registers in the basic computer is controlled by a master clock
generator. The clock pulses are applied to all flip-flops and registers in the system, including the
flip-flops and registers in the control unit.
It is the most common unit and complex unit in a computer. Its main functions are:
a. Fetching the instruction
b. Analyzing the opcode
c. Generating control signals for performing various micro-operations.
There are two types of control organization: Hardwired Control and Micro programmed
control. In the hardwired control organization, the control logic is implemented with gates, flip-
flops, decoders and other digital circuits. The major advantage is fast mode of operation. In the
micro programmed organization, the control information is stored in a control memory. The
control memory is programmed to initiate the required sequence of operations.
Table 1.13: Difference between hardwired control and micro programmed control
Attribute H/W Control Unit Micro programmed CU
Speed Fast Slow
Control function Implemented in Hardware Implemented in software
Flexibility Not flexible to accommodate More flexible to accommodate
new system specifications or new system specification or new
new instructions instructions.
Ability to handle large/ Difficult Easier
complex instruction sets
Ability to support OS and Very difficult Easy
diagnostic features
Design process Complicated Orderly and systematic
Applications Mostly RISC processors Mainframes and some
microprocessors
Instruction set and size Under 100 instructions Over 100 instructions
ROM size - 2K to 10K by 20 – 400 bit
microinstructions
Chip area efficiency Uses least area Uses more area
Figure 1.20 shows the block diagram of the control unit. It consists of two decoders, a
sequence counter and a number of control logic gates.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 33
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
An instruction reads from memory is placed in the instruction register (IR). This
instruction register is divided into three parts: the I bit, operation code and bits 0 through 11.
The operation code in bits 12 to 14 are decoded with a 3 x 8 decoder. The eight outputs of the
decoder are designated by the symbols D0 through D7. Bit 15 of the instruction is transferred to a
flip-flop designated by the symbol I. bits 0 through 11 are applied to the control logic gates. The
4-bit sequence counter can count in binary from 0 through 15. The outputs of the counter are
decoded into 16 timing signals T0 through T15.
Figure shows the timing diagram for the time relationship of the control signals. The
sequence counter SC responds to the positive transition of the clock. Initially, the CLR input of
SC is active. The 1 st positive transition of the clock clears SC to 0, which in turn activates the
timing signal T0 out of the decoder. T0 is active during one clock cycle.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 34
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
The positive clock transition labeled T 0 in the diagram will trigger only those registers
whose control inputs are connected to timing signals T 0. SC is incremented with every positive
clock transition, unless its CLR input is active. This produces the sequence of timing signals T 0,
T1, T2, T3, T4 and so on. If SC is not cleared, the timing signals will continue with T5, T6 upto
T15 and back to T0.
The last three waveforms in the above figure shows how SC is cleared when D 3T4 = 1.
Output D3 from the operation decoded becomes active at the end of timing signal T 2. When
timing signals T4 becomes active, the output of the AND gate that implements the control
functions D3T4 becomes active. This signal is applied to the CLR input of SC. On the next
positive clock transition the counter is cleared to 0. This causes the timing signal T 0 to become
active instead of T5 that would have been active if SC were incremented instead of cleared.
A memory read or writes cycle will be initiated with the rising edge of a timing signal. It
will be assumed that a memory cycle time is less than the clock cycle time. According to this
assumption, memories read or write cycle initiated by a timing signal will be completed by the
time the next clock goes through its positive transition. The clock transition will then be used to
load the memory word into a register.
fetching and executing of instructions are done repeatedly by the processor until the power
switch is switched off.
The above operations fetch the instruction and execute the instruction are performed in
fixed and variable time slots. The fetch operation requires fixed time slots (4T states) is known
as Fetch Cycle (FC) and execute operation required variable time slots (3T state or high depends
upon the instruction to be executed) is knows as Execute Cycle (EC).
The total time required to complete the execution of an instruction is called Instruction
Cycle (EC) or Instruction cycle time. That is,
IC = FC + EC
It is used to read an instruction from memory. The instruction may be more than one byte
long and the other byte is called operand address or data.
2. After each clock pulse, SC is increment by one, so that the timing signals go through a
sequence T0, T1, T2 and so on. The micro operations for the fetch and decode phases can
be specified by the following register transfer statements.
T1 : IR M[AR], PC PC + 1
T2 : D0….,D7 Decode IR (12-14), AR IR (0-11), I IR (15)
In summary,
T0 : AR PC
T1 : IR M[AR], PC PC + 1
T2 : D0….,D7 Decode IR (12-14), AR IR (0-11), I IR (15)
An execute cycle required variable time slots which depends upon the instruction type.
An algorithm for execute cycle is given below.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 36
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
Note:
a. If an instruction is a 1-byte long and the operands are in general purpose
registers, then they only decoding and executing operations are performed. This
operation is done in one clock cycle.
b. If an instruction is a 2-byte or 3-byte instruction type, then one or two extra
memory fetch cycles are required to fetch the operand and operand address. It is
similar to an instruction fetch cycle except that the quantity fetched is an address
or data. Each operation requires one clock period.
Instruction Execution
Fetch the contents of the memory location pointed to by the PC. The contents of this
location are loaded into the IR (fetch phase).
IR ← [PC]
Assuming that the memory is byte addressable, increment the contents of the PC by 4
(fetch phase).
PC ← [PC] + 4
Carry out the actions specified by the instruction in the IR (execution phase).
Transfer a word of data from one processor register to another or to the ALU.
Perform arithmetic or a logic operation and store the result in a processor register.
Fetch the contents of a given memory location and load them into a processor register.
Store a word of data from a processor register into a given memory location.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 37
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
We know that, an instruction cycle is combination of fetch cycle and execute cycle. The
execute cycle may consists of zero or more fetch cycles which may be required to fetch the
operand. All these operations are performed in different time slots is known as machine cycle.
(OR)
One can also define the machine cycle as the time required to complete one operation of
accessing memory, I/O or acknowledging an external request. It consists of 3 to 6 T states.
T – State:
It is defined as sub-division of one clock pulse pr period. The clock period is
synchronized with the system clock.
Figure shows the flowchart for instruction cycle. It shows how the control determines the
instruction type after the decoding. The decoder output D7 is equal to 1 if the operation code is
equal to binary 111. If D7 = 1, the instruction must be a register reference instructions. If D 7 =0 ,
the operation code must be one of the other seven values 000 through 110 called memory
reference instructions.
Control then inspects the value of the 1st bit of the instruction which is available in flip-
flop I. if D7=0 and I=1, we have memory reference instruction with an indirect address. if D7=1
and I=0, is called register reference instruction. These instructions use bits 0 through 11 of the
instruction code to specify one of 12 instructions. These 12 bits are available in IR(0–11). They
were also transferred to AR during time T 1.
When the computer is running a program and interrupt flag is set, it is automatically
interrupted from the current program. The interrupt enable flip-flop IEN can be set and cleared
with two instructions.
When IEN is cleared to 0 (with the IOF instruction), the computer cannot interrupt.
When IEN is set to 1 (with the ION instruction), the computer can be interrupted. These two
instructions provide the programmer with the capability of making a decision as to whether or
not to use the interrupt facility.
The way that the interrupt is handled by the computer can be shown in figure.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 40
JNTUH R22 - Computer Organization and Architecture – Unit –I Sept.
Lecture Notes - By Prof.Dr.P.Ramasubramanian, P&P/MIETW 2024
If IEN is 1, control checks the flag bits. If both flags are 0, it indicates that neither the
input nor the output registers are ready for transfer of information. In this case, control continues
with the next instruction cycle.
If either flag is set to 1 while IEN = 1, flip-flop R is set to 1. At the end of the execute
phase, control checks the value of R, and if it is equal to 1, it goes to an interrupt cycle instead of
an instruction cycle.
The interrupt cycle is a hardware implementation of a branch and save return address
operation. The return address available in PC is stored in a specific location where it can be
found later when the program returns to the instruction at which it was interrupted. This location
may be a processor register, a memory stack, or a specific memory location.
Here we choose the memory location at address 0 as the place for storing the return
address. Control then inserts address 1 into PC and clears IEN and R so that no more
interruptions can occur until the interrupt request from the flag has been serviced.
UNIT- I: DIGITAL COMPUTERS: Introduction Block diagram of digital computer – Definition of computer organization – computer design and computer
arithmetic. REGISTER TRANSFER LANGUAGE AND MICRO OPERATIONS: Register Transfer Language – Register transfer, Bus and memory transfer –
Arithmetic micro operations, Logic micro operations, Shift micro operations, and Arithmetic logic shift unit. BASIC COMPUTER ORGANIZATION AND
DESIGN: Instruction codes – computer registers – computer instructions – Timing and control – Instruction cycle – memory reference instructions – Input-Output
and Interrupt. Page 41