Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

SYLLABUS

Computer Organization
(Autonomous) Introduction: Types of Computers, Functional units of Basic
Computer (Block diagram of Micro Computer).
UNIT I
Register Transfer and Micro-operations: Register Transfer
Sections - A & D language, Register Transfer, Bus and memory transfers - Three-
State Bus Buffers, Memory Transfer; Arithmetic micro
operations- Binary Adder, Binary Adder-Subtractor, Binary
Incrementer, Arithmetic Circuit; Logical micro operations- List
Prepared by of Logic Microoperations, Hardware Implementation, Some
Anil Kumar Prathipati, Asst. Prof., Dept. of CSE. Applications; Shift micro operations-Hardware Implementation,
Arithmetic logic shift unit.

INDEX
COMPUTER TYPES
• Digital Computer is a fast electronic calculating machine that
 Computer Types • accepts digitized input information,
• processes it according to a list of internally stored instructions,
 Functional Unit
• and produces the resulting output information.
 Register Transfer Language
• Many types of computers exist that differ widely in Size, Cost,
 Register Transfer Computational Power and intended Use
 Arithmetic Microoperations 1. Personal Computer/ Desktop computers
2. Portable Notebook Computers
 Logic Microoperations 3. Work Stations
 Shift Microoperations 4. Enterprise System Servers
5. Super Computers
BLOCK DIAGRAM OF COMPUTER FUNCTIONAL UNITS
• A digital computer consists of five functionally
independent parts.
– Input
– Output
– Memory Unit
– Arithmetic and Logic Unit
– Control Unit

Fig: Block diagram of a digital computer.

REGISTER TRANSFER LANGUAGE REGISTER TRANSFER


• Registers are designated by capital letters, sometimes
• The symbolic notation used to describe the microoperation followed by numbers (e.g., A, R13, IR).
transfers among registers is called a Register transfer
language. • Often the names indicate function:
MAR - memory address register
PC - program counter
• Register transfer language IR - instruction register
– A symbolic language
• Information transfer from one register to another is
– A convenient tool for describing the internal organization designated in symbolic form by means of a replacement
of digital computers operator.
– Can also be used to facilitate the design process of digital
R2  R1
systems.
– In this case the contents of register R1 are copied (loaded) into
register R2 and contents of R1 remains same.
BLOCK DIAGRAM OF A REGISTER
• Often we want the transfer to occur only under a
predetermined control condition.
R1 7 6 5 4 3 2 1 0
if (p=1) then (R2  R1)
Register R
Showing individual bits
where ‘p’ is a control signal generated in the control
section.

• In digital systems, this is often done via a control signal,


15 0 15 8 7 0
R2 PC(H) PC(L) called a control function
Numbering of bits Subfields (Divided into two parts)
– If the signal is 1, the action takes place

• This is represented as:


P: R2  R1

HARDWARE IMPLEMENTATION OF SIMULTANEOUS OPERATIONS


CONTROLLED TRANSFERS
• If two or more operations are to occur
Implementation of controlled transfer simultaneously, they are separated with
P: R2 R1
commas
Control P Load
Block diagram Circuit
R2 Clock

R1
n
P: R3  R5, MAR  IR
t t+1
Timing diagram Clock • Here, if the control function P = 1, load the
Load contents of R5 into R3, and at the same
Transfer occurs here time (clock), load the contents of register
IR into register MAR
• The same clock controls the circuits that generate the control function
and the destination register
• Registers are assumed to use positive-edge-triggered flip-flops
BASIC SYMBOLS FOR REGISTER BUS AND MEMORY TRANSFERS
TRANSFERS Bus is a path(of a group of wires) over which information is transferred,
from any of several sources to any of several destinations.
From a register to bus: BUS  R

Register A Register B Register C Register D


Symbols Description Examples
Capital letters Denotes a register MAR, R2
& numerals Bus lines

Parentheses () Denotes a part of a register R2(0-7), R2(L)


Register A Register B Register C Register D
1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
Arrow  Denotes transfer of information R2  R1
B1 C1 D 1 B2 C2 D 2 B3 C3 D 3 B4 C 4 D 4
Colon : Denotes termination of control function P:
0 0 0 0
4 x1 4 x1 4 x1 4 x1
Comma , Separates two micro-operations A  B, B  A MUX MUX MUX MUX

x
select
y

4-line bus

TRANSFER FROM BUS TO A REGISTER BUS TRANSFER IN RTL


Bus lines

Reg. R0 Reg. R1 Reg. R2 Reg. R3


Load • Depending on whether the bus is to be mentioned
explicitly or not, register transfer can be indicated as
D 0 D1 D2 D 3
either
z E (enable)
Select 2x4
w
Decoder R2 R1
Three-State Bus Buffers
or
Normal input A Output Y=A if C=1 BUS R1, R2  BUS
High-impedence if C=0
Control input C

• In the former case the bus is implicit, but in the latter,


Bus line with three-state buffers
A0
Bus line for bit 0 it is explicitly indicated
B0
C0
D0

S0 0
Select 1
S1 2
Enable 3
MEMORY (RAM) MEMORY TRANSFER
• Memory (RAM) can be thought as a sequential circuits • Collectively, the memory is viewed at the register level
containing some number of registers as a device, M.
• These registers hold the words of memory • Since it contains multiple locations, we must specify
• Each of the r registers is indicated by an address which address in memory we will be using
• These addresses range from 0 to r-1 • This is done by indexing memory references
• Each register (word) can hold n bits of data • Memory is usually accessed in computer systems by
putting the desired address in a special register, the
• Assume the RAM contains r = 2k words. It needs the following Memory Address Register (MAR, or AR)
– n data input lines data input lines • When memory is accessed, the contents of the MAR get
– n data output lines n sent to the memory unit’s address lines
– k address lines address lines
M
– A Read control line k RAM Read
Read Memory
unit
– A Write control line Write
AR
unit Write

n
Data out Data in
data output lines

MEMORY READ MEMORY WRITE


• To read a value from a location in memory and load it • To write a value from a register to a location in
into a register, the register transfer language notation memory looks like this in register transfer language:
looks like this: M[MAR]  R1
R1  M[MAR] • This causes the following to occur
• This causes the following to occur – The contents of the MAR get sent to the memory
– The contents of the MAR get sent to the memory address lines
address lines – A Write (= 1) gets sent to the memory unit
– A Read (= 1) gets sent to the memory unit – The values in register R1 get sent over the bus to the
– The contents of the specified address are put on the data input lines of the memory
memory’s output data lines – The values get loaded into the specified address in
– These get sent over the bus to be loaded into register the memory
R1
SUMMARY OF R. TRANSFER MICROOPERATIONS ARITHMETIC MICROOPERATIONS

Computer system microoperations are of four types:


A B Transfer content of reg. B into reg. A
1. Register transfer microoperations transfer binary information
AR  DR(AD) Transfer content of AD portion of reg. DR into reg. AR from one register to another
A  constant Transfer a binary constant into reg. A 2. Arithmetic microoperations perform arithmetic operations on
ABUS  R1, Transfer content of R1 into bus A and, at the same time, numeric data stored in registers.
R2  ABUS Transfer content of bus A into R2 3. Logic microoperations perform bit manipulation operations on
AR Address register non numeric data stored in registers.
DR Data register 4. Shift microoperations perform shift operations on data stored in
M[R] Memory word specified by reg. R registers.
M Equivalent to M[AR]
DR  M Memory read operation: transfers content of
memory word specified by AR into DR
M  DR Memory write operation: transfers content of
DR into memory word specified by AR

ARITHMETIC MICROOPERATIONS BINARY ADDER / SUBTRACTOR / INCREMENTER


• The basic arithmetic microoperations are
– Addition B3 A3 B2 A2 B1 A1 B0 A0

– Subtraction Binary Adder


FA C3 FA C2 FA C1 FA C0
– Increment
– Decrement C4 S3 S2 S1 S0

• The additional arithmetic microoperations are Binary Adder-Subtractor


– Add with carry B3 A3 B2 A2 B1 A1 B0 A0

– Subtract with borrow M

– Transfer/Load
– etc. …
FA C3 FA C2 FA C1 FA C0
Table: Arithmetic Micro-Operations
C4 S3 S2 S1 S0
R3  R1 + R2 Contents of R1 plus R2 transferred to R3
R3  R1 - R2 Contents of R1 minus R2 transferred to R3 Binary Incrementer A3 A2 A1 A0 1
R2  R2’ Complement the contents of R2
R2  R2’+ 1 2's complement the contents of R2 (negate) x y x y x y x y
R3  R1 + R2’+ 1 subtraction HA HA HA HA

R1  R1 + 1 Increment C S C S C S C S

R1  R1 - 1 Decrement
C4 S3 S2 S1 S0
ARITHMETIC CIRCUIT LOGIC MICROOPERATIONS
Cin
S1
S0
• It specifies binary operations on the strings of bits
A0
S1
X0
FA
C0
D0
stored in registers
S0

– Logic microoperations are bit-wise operations, i.e.,


B0 0 4x1 Y0 C1
1 MUX
2
3
A1
S1
X1
FA
C1
D1
they work on the individual bits of data
S0

– useful for bit manipulations on binary data


B1 0 4x1 Y1 C2
1 MUX
2
3

– useful for making logical decisions based on the bit


A2 X2 C2
S1 FA D2
S0
B2 0 4x1 Y2 C3
1 MUX
2
3
value
A3 X3 C3
S1
S0 FA D3 A B F0 F1 F2 … F13 F14 F15
0 0 0 0 0 … 1 1 1
B3 0 4x1 Y3 C4
1 MUX
2
Cout
0 1
3
0 1 0 0 0 … 1 1 1
S1 S0 Cin Y Output Microoperation
1 0 0 0 1 … 0 1 1
0 0 0 B D=A+B Add 1 1 0 1 0 … 1 0 1
0 0 1 B D=A+B+1 Add with carry
0 1 0 B’ D = A + B’ Subtract with borrow
0 1 1 B’ D = A + B’+ 1 Subtract • There are, in principle, 16 different logic functions that
1 0 0 0 D=A Transfer A
1 0 1 0 D=A+1 Increment A can be defined over two binary input variables
1 1 0 1 D=A-1 Decrement A
1 1 1 1 D=A Transfer A

HARDWARE IMPLEMENTATION OF LOGIC


LIST OF LOGIC MICROOPERATIONS
MICROOPERATIONS
• However, most systems only implement four
• List of Logic Microoperations
- 16 different logic operations with 2 binary vars. of these
n
- n binary vars → 2 2 functions – AND (), OR
i A
(), XOR (),
0 Complement/NOT
Bi
• Truth tables for 16 functions of 2 variables and the
corresponding 16 logic micro-operations
• The others can be created
1
4 X 1 from
MUX
Fi combination
x 0011 Boolean Micro-
of these 2

Name
y 0101 Function Operations 3 Select
0000 F0 = 0 F0 Clear S1
0001 F1 = xy FA B AND S0
0010 F2 = xy' F  A  B’
0011 F3 = x FA Transfer A
0100 F4 = x'y F  A’ B
0101 F5 = y FB Transfer B
0110 F6 = x  y FA B Exclusive-OR Function table
0111 F7 = x + y FAB OR S1 S0 Output -operation
F  A  B)’ NOR
1000 F8 = (x + y)'
0 0 F=AB AND
1001 F9 = (x  y)' F  (A  B)’ Exclusive-NOR
1010 F10 = y' F  B’ Complement B 0 1 F = AB OR
FA B
1011
1100
F11 = x + y'
F12 = x' F  A’ Complement A
1 0 F=AB XOR
1101 F13 = x' + y F  A’ B 1 1 F = A’ Complement
1110 F14 = (xy)' F  (A  B)’ NAND
1111 F15 = 1 F  all 1's Set to all 1's
APPLICATIONS OF LOGIC MICROOPERATIONS SELECTIVE SET

• In a selective set operation, the bit pattern in B


• Logic microoperations can be used to manipulate individual is used to set certain bits in A
bits or a portions of a word in a register
• Consider the data in a register A. In another register, B, is
bit data that will be used to modify the contents of A 1100 At
• Selective-set AA+B 1010 B
– Selective-complement A  A  B 1110 At+1 (A  A + B)
– Selective-clear A  A • B’
– Mask (Delete) AA•B
• If a bit in B is set to 1, that same position in A
– Clear AAB
gets set to 1, otherwise that bit in A keeps its
– Insert A  (A • B) + C
– Compare AAB
previous value
– ...

SELECTIVE COMPLEMENT SELECTIVE CLEAR

• In a selective complement operation, the bit • In a selective clear operation, the bit pattern in
pattern in B is used to complement certain bits B is used to clear certain bits in A
in A
1100 At
1100 At 1010 B
1010 B 0100 At+1 (A  A  B’)
0110 At+1 (A  A  B)
• If a bit in B is set to 1, that same position in A
• If a bit in B is set to 1, that same position in A gets set to 0, otherwise it is unchanged
gets complemented from its original value,
otherwise it is unchanged
MASK OPERATION CLEAR OPERATION

• In a mask operation, the bit pattern in B is • In a clear operation, if the bits in the same
used to clear certain bits in A position in A and B are the same, they are
cleared in A, otherwise they are set in A
1100 At
1010 B 1100 At
1000 At+1 (A  A  B) 1010 B
0110 At+1 (A  A  B)
• If a bit in B is set to 0, that same position in A
gets set to 0, otherwise it is unchanged

INSERT OPERATION
– Example
• Suppose you wanted to introduce 1010 into the low order
four bits of A: 1101 1000 1011 0001 A (Original)
• An insert operation is used to introduce a specific bit
1101 1000 1011 1010 A (Desired)
pattern into A register, leaving the other bit positions
unchanged • 1101 1000 1011 0001 A (Original)
• This is done as 1111 1111 1111 0000 Mask
– A mask operation to clear the desired bit positions, 1101 1000 1011 0000 A (Intermediate)
followed by 0000 0000 0000 1010 Added bits
– An OR operation to introduce the new bits into the
desired positions 1101 1000 1011 1010 A (Desired)
SHIFT MICROOPERATIONS LOGICAL SHIFT
• Shift microoperations are used for serial transfer of data. • In a logical shift the serial input to the shift is a 0.
• The information transferred through the serial input • A right logical shift operation:
determines the type of shift. There are three types of shifts
0
– Logical shift
– Circular shift
– Arithmetic shift • A left logical shift operation:
0
• A right shift operation
Serial • In a Register Transfer Language, the following notation
input
is used
– shl for a logical shift left
– shr for a logical shift right
• A left shift operation Serial – Examples:
input
• R2  shr R2
• R3  shl R3

CIRCULAR SHIFT ARITHMETIC SHIFT


• An arithmetic shift is meant for signed binary numbers (integer)
• In a circular shift the serial input is the bit that is shifted
out of the other end of the register. • An arithmetic left shift multiplies a signed number by two
• A right circular shift operation: • An arithmetic right shift divides a signed number by two
• The main distinction of an arithmetic shift is that it must keep the sign of the
number the same as it performs the multiplication or division

• A left circular shift operation: • A right arithmetic shift operation:


sign
bit

• In a RTL, the following notation is used


– cil for a circular shift left • A left arithmetic shift operation:
– cir for a circular shift right
– Examples: 0
• R2  cir R2
sign
bit

• R3  cil R3
ARITHMETIC SHIFT
HARDWARE IMPLEMENTATION OF
• An left arithmetic shift operation must be checked for SHIFT MICROOPERATIONS
the overflow
0 for shift right (down)
Serial Select
0 input (IR)
1 for shift left (up)
sign
bit

S
MUX H0
Before the shift, if the leftmost two 0
1
V bits differ, the shift will result in an
overflow A0

A1 S
MUX H1
0
1
• In a RTL, the following notation is used A2

– ashl for an arithmetic shift left A3


S
H2
MUX
– ashr for an arithmetic shift right 0
1

– Examples:
• R2  ashr R2
S
MUX H3
0
• R3  ashl R3 1

Serial
input (IL)

ARITHMETIC LOGIC SHIFT UNIT


S3
S2 Ci
S1
S0

Arithmetic Di
Circuit
Select

C i+1
0 4x1 Fi
1 MUX
2
3
Ei
Logic
Bi
Ai
Circuit
shr
A i-1
A i+1 shl

S3 S2 S1 S0 Cin Operation Function


0 0 0 0 0 F=A Transfer A
0 0 0 0 1 F=A+1 Increment A
0 0 0 1 0 F=A+B Addition
0 0 0 1 1 F=A+B+1 Add with carry
0 0 1 0 0 F = A + B’ Subtract with borrow
0 0 1 0 1 F = A + B’+ 1 Subtraction
0 0 1 1 0 F=A-1 Decrement A
0 0 1 1 1 F=A TransferA
0 1 0 0 X F=AB AND
0 1 0 1 X F = A B OR
0 1 1 0 X F=AB XOR
0 1 1 1 X F = A’ Complement A
1 0 X X X F = shr A Shift right A into F
1 1 X X X F = shl A Shift left A into F

You might also like