RTLlogic and Shift Microoperations
RTLlogic and Shift Microoperations
RTLlogic and Shift Microoperations
Overview
Register Transfer
Arithmetic Micro-operations
Logic Micro-operations
Shift Micro-operations
CSE 211
Register Transfer and Micro-operations 3
Logic Microoperations
CSE 211
Register Transfer and Micro-operations 4
Hardware Implementation
Ai
0
Bi
1
4X1 Fi
MUX
2
3 Select
S1
S0
Function table
S1 S0 Output -operation
0 0 F=AB AND
0 1 F = AB OR
1 0 F=AB XOR
1 1 F = A’ Complement
CSE 211
Register Transfer and Micro-operations 5
Selective-set AA+B
Selective-complement AAB
Selective-clear A A • B’
Mask (Delete) AA•B
Clear AAB
Insert A (A • B) + C
CSE 211
Register Transfer and Micro-operations 6
1 1 0 0 At
1010 B
1 1 1 0 At+1 (A A + B)
0 1 1 0 At+1 (A A B)
If a bit in B is set to 1, that same position in A gets complemented from its
original value, otherwise it is unchanged
CSE 211
Register Transfer and Micro-operations 7
0 1 0 0 At+1 (A A B’)
If a bit in B is set to 1, that same position in A gets set to 0, otherwise it is
unchanged
4. In a mask operation, the bit pattern in B is used to clear certain bits in A
1 1 0 0 At
1010 B
1 0 0 0 At+1 (A A B)
0 1 1 0 At+1 (A A B)
CSE 211
Register Transfer and Micro-operations 9
CSE 211
Register Transfer and Micro-operations 10
Shift Microoperations
• There are three types of shifts
– Logical shift
– Circular shift
– Arithmetic shift
• What differentiates them is the information that goes into the serial input
Serial
input
CSE 211
Register Transfer and Micro-operations 11
Logical Shift
• In a logical shift the serial input to the shift is a 0.
Circular Shift
• In a circular shift the serial input is the bit that is shifted out of the other
end of the register.
Arithmetic Shift
• An arithmetic shift is meant for signed binary numbers (integer)
• An arithmetic left shift multiplies a signed number by two
• An arithmetic right shift divides a signed number by two
• Sign bit : 0 for positive and 1 for negative
• 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
sign
bit
CSE 211
Register Transfer and Micro-operations 14
Arithmetic Shift
• An left arithmetic shift operation must be checked for the overflow
0
sign
bit
CSE 211
Register Transfer and Micro-operations 15
CSE 211
Register Transfer and Micro-operations 16
D
Arithmetic i
Circuit
Select
0 4x1
C i+1 F
1 i
MUX S3 S2 S1 S0 Cin Operation
2 0 0 0 0 0 F=A
3 0 0 0 0 1 F=A+1
0 0 0 1 0 F=A+B
E 0 0 0 1 1 F=A+B+1
Logic i 0 0 1 0 0 F = A + B’
Bi 0 0 1 0 1 F = A + B’+ 1
Circuit 0 0 1 1 0 F=A-1
A 0 0 1 1 1 F=A
i
0 1 0 0 X F=AB
shr
A 0 1 0 1 X F = A B
i-1 0 1 1 0 X F=AB
shl
A 0 1 1 1 X F = A’
i+1
1 0 X X X F = shr A
1 1 X X X F = shl A
CSE 211