Lecture #4: Lo'ai Tawalbeh
Lecture #4: Lo'ai Tawalbeh
Lecture #4: Lo'ai Tawalbeh
Lo’ai Tawalbeh
Lecture #4
23/2/2006
• Register Transfer
• Arithmetic Microoperations
• Logic Microoperations
• Shift Microoperations
R1 7 6 5 4 3 2 1 0
15 0
PC
Numbering of bits
15 87 0
Upper byte PC(H) PC(L) Lower byte
Partitioned into two parts
R1
t t+1
Timing diagram
Clock
Synchronized
Load
with the clock
Transfer occurs here
Bus lines
D3 D2 D1 D0 C3 C2 C1 C0 B3 B2 B1 B0 A3 A 2 A 1 A 0
D3 C3 B3 A3 D2 C2 B2 A2 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
Three-State Buffer
cpe 252: Computer Organization 17
4-3 Bus and Memory Transfers:
Three-State Bus Buffers cont.
C=1
Buffer
A B A B
C=0
Open Circuit
A B A B
B0
C0
RAM
R1 R1
100 66
R3 ←R1+R2+1
cpe 252: Computer Organization 24
4-4 Arithmetic Microoperations cont.
• One’s Complement Microoperation:
R2 ←R2
• Two’s Complement Microoperation:
R2 ←R2+1
• Increment Microoperation:
R2 ←R2+1
• Decrement Microoperation:
R2 ←R2-1
cpe 252: Computer Organization 25
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 c 1 0 cn-1
n-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 cn = xy + xcn-1+ ycn-1
1 1 1 1 1 = xy + (x y)cn-1
x s = x’y’cn-1+x’yc’n-1+xy’c’n-1+xycn-1
y S = x y cn-1 = (x y) cn-1
cn-1
cn
cpe 252: Computer Organization 26
4-4 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
1000
C3 1, if overflow
=V
C4 0, if no overflow
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
• Gate:
• Gate:
• Gate:
• Gate:
• Gate:
• Gate:
1 0 E=AB AND
1 Ei
1 1 E=A Complem
ent
Shift Left
**Note that the bit ri is the bit at position (i) of the register
? rn-1 r3 r2 r1 r0 0
rn-1 r3 r2 r1 r0
rn-1 r3 r2 r1 r0
?
? rn-1 r3 r2 r1 r0 0
Sign
Arithmetic Shift Left
Bit
Vs = Rn-1 Rn-2
Rn-1 1 overflow
Vs =
Rn-2 0 no overflow
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