Professional Documents
Culture Documents
ARCHITECTURE
R ← f(R,R)
f: shift, count, load, clear, add…..
REGISTER TRANSFER LANGUAGE
Definition of organization of a computer:
1. The set of registers and their functions;
2. The sequence of microoperations;
3. The control that initiates the sequence of
microoperations
For any function of the computer, a sequence of
microoperations is used to describe it
Register transfer language
A symbolic language
A convenient tool for describing the internal organization of
digital computers
Can also be used to facilitate the design process of digital
systems.
REGISTER TRANSFER
Designation of a register
a register
Portion of a register
A bit of a register
Common ways of drawing the diagram of a register
Block diagram
Timing diagram
Bus lines
D3 D2 D1 D0 C3 C2 C1 C0 B3 B2 B1 B0 A3 A2 A1 A0
D3 C3 B3 A3 D 2 C2 B2 A 2 D1 C1 B1 A1 D0 C0 B0 A0
3 2 1 0 3 2 1 0 3 2 1 0
3 2 1 0 S0
S0 S0 S0
MUX3 MUX2 MUX1 MUX0 S1
S1 S1 S1
Control input C
Three-State Buffer
THREE-STATE BUS BUFFERS
C=1
Buffer
A B A B
C=0
Open Circuit
A B A B
THREE-STATE BUS BUFFERS
S1 0
Select
S0 1
Bus line for bit 0
2×4 A0
Decoder 2
Enable E
3
B0
C0
Read: DR ← M[AR]
Write: M[AR] ← DR
MEMORY TRANSFER
AR
x0C 19
x12 x0E 34
R1 x10 45
100 x12 66
x14 0
R1←M[AR] x16 13
x18 22
RAM
R1 R1
100 66
R3 ←R1+R2
Subtraction Microoperation:
R2 ←R2+1
Increment Microoperation:
R2 ←R2+1
Decrement Microoperation:
R2 ←R2-1
Draw the circuit diagram and truth table of half adder
and full adder using basic gates.
HALF ADDER/FULL ADDER
Half Adder x y c s x
0 0 0 0 c = xy s = xy’ + x’y c
=x y y
0 1 0 1
1 0 0 1 s
1 1 1 0
Full Adder
y y
x y cn-1 cn s
0 0 0 0 0 0 0 0 1
0 0 1 0 1 0 1 cn-1 1 0 cn-1
0 1 0 0 1 x 1 1 x 0 1
0 1 1 1 0 0 1 1 0
1 0 0 0 1 cn s
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
x
y cn = xy + xcn-1+ ycn-1
S
= xy + (x y)cn-1
cn-1
cn s = x’y’cn-1+x’yc’n-1+xy’c’n-1+xycn-1
= x y cn-1 = (x y) cn-1
Implement four bit full adder using 1-bit full adder?
ARITHMETIC MICROOPERATIONS
BINARY ADDER
B3 A3 B2 A2 B1 A1 B0 A0
C3 C2 C1
FA FA FA FA C0
C4 S3 S2 S1 S0
C3 C2 C1 C0
FA FA FA FA
C4 S3 S2 S1 S0
4-bit adder-subtractor
M=0 Addition
M=1 Subtraction
Design incrementer circuit for four bit register using half
adder?
ARITHMETIC MICROOPERATIONS
BINARY INCREMENTER
A3 A2 A1 A0 1
x y x y x y x y
HA HA HA HA
C S C S C S C S
C4 S3 S2 S1 S0
3 2 1 0 S 1 S0 3 2 1 0 S 1 S0 3 2 1 0 S 1 S0 3 2 1 0 S 1 S0
Y3 X3 Y2 X2 Y1 X1 Y0 X0
C3 C2 C1
FA FA FA FA Cin
Cout D3 D2 D1 D0
NOT
XOR
Gate:
OR OR
Gate:
Gate:
Gate:
Insert Operation
Step1: mask the desired bits
Step2: OR them with the desired value
NAND Microoperation
Symbols: and
Gate:
Gate:
1 0 E=AB AND
1 Ei
1 1 E=A Complem
ent
56
LOGIC MICROOPERATIONS
SHIFT MICROOPERATIONS
Used for serial transfer of data
Also used in conjunction with arithmetic, logic, and
other data-processing operations
The contents of the register can be shifted to the left
or to the right
As being shifted, the first flip-flop receives its binary
information from the serial input
Three types of shift: Logical, Circular, and Arithmetic
SHIFT MICROOPERATIONS
Shift Left
**Note that the bit ri is the bit at position (i) of the register
SHIFT MICROOPERATIONS:
LOGICAL SHIFTS
Transfers 0 through the serial input
Logical Shift Right: R1←shr R1
The same
Logical Shift Left: R2←shl R2
The same
? rn-1 r3 r2 r1 r0 0
The same
Circular Shift Left: R2←cil R2
The same
rn-1 r3 r2 r1 r0
rn-1 r3 r2 r1 r0
?
? rn-1 r3 r2 r1 r0 0
Sign
Arithmetic Shift Left
Bit
ARITHMETIC SHIFTS
An overflow flip-flop Vs can be used to detect an arithmetic
shift-left overflow
Vs = Rn-1 Rn-2
Rn-1 1 overflow
Vs=
Rn-2 0 no overflow
SHIFT MICROOPERATIONS
Example: Assume R1=11001110, then:
Arithmetic shift right once : R1 = 11100111
Arithmetic shift right twice : R1 = 11110011
Arithmetic shift left once : R1 = 10011100
Arithmetic shift left twice : R1 = 00111000
Logical shift right once : R1 = 01100111
Logical shift left once : R1 = 10011100
Circular shift right once : R1 = 01100111
Circular shift left once : R1 = 10011101
SHIFT MICROOPERATIONS
HARDWARE
IMPLEMENTATION
A possible choice for a shift unit would be a bidirectional shift
register with parallel load Has drawbacks:
Needs two pulses (the clock and the shift signal pulse)
Not efficient in a processor unit where multiple number of registers
share a common bus
It is more efficient to implement the shift operation with a
combinational circuit
SHIFT MICROOPERATIONS
HARDWARE
IMPLEMENTATION
Serial Input IR Serial Input IL
A3 A2 A1 A0
Select
H3 H2 H1 H0
One stage of Di
arithmetic
circuit (Fig.A)
Select
One stage of Fi
ALU Ci+1 0 4×1
1 MUX
One stage of Ei 2
logic circuit
Bi (Fig.B) 3
Ai
shr
Ai+1
shl
Ai-1