Module 1 - Register Transfer Language
Module 1 - Register Transfer Language
ORGANIZATION A N D
ARCHITECTURE
MODULE 1: REGISTER TRANSFER A N D MICRO
OPERATIONS
• Typically,
• What operations are performed on the data in the registers
• What information is passed between registers
Register Transfer Language
MICROOPERATIONS (1)
MICROOPERATION (2)
Registers ALU
(R) (f) 1 clock cycle
R f(R, R)
f: shift, load, clear, increment, add, subtract,
complement,
and, or, xor, …
Register Transfer Language
- Microoperations set
REGISTER TRANSFER
LANGUAGE
DESIGNATION OF REGISTERS
DESIGNATION OF REGISTERS
• Designation of a register
- a register
- portion of a register
- a bit of a register
REGISTER TRANSFER
REGISTER TRANSFER
R3 R5
• the data lines from the source register (R5) to the destination
register (R3)
• Parallel load in the destination register (R3)
• Control lines to perform the action
Register Transfer
CONTROL FUNCTIONS
R R
2 1
Load
Transfer occurs here
• 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
Register Transfer
SIMULTANEOUS OPERATIONS
P: R3 R5, MAR IR
,
Register Transfer
CONNECTING REGISTRS
Bus lines
Bus and Memory Transfers
B0
C0
S0 0
Select 1
D0 2
Enable S1 3
2 to 4
decoder
2 TO 4 BINARY
DECO DER
Load
Reg. R0 Reg. R1 Reg. R2 Reg. R3
D0 D1 D2 D3
Select z E (enable)
w 2x4
Decoder
Bus and Memory Transfers
BUS TRANSFER IN
RTL
MEMORY (RAM)
• A Read control n
line data output lines
• A W rite control
Bus and Memory Transfers
MEMORY TRANSFER
MEMORY
READ
MEMORY WRITE
MICROOPERATIONS
ARITHMETIC
MICROOPERATIONS
• The basic arithmetic
microoperations are
• Addition
• Subtraction
•
• Decrement
Increment
BINARY
ADDER / SUBTRAC TO R / INCREMENTER
B3 A3 B2 A2 B1 A1 B0 A0
Binary Adder
FA C3 FA C2 FA C1 FA C0
C4 S3 S2 S1 S0
Binary Adder-Subtractor
B 3 A3 B 2 A2 B 1 A1 B 0 A0
C3 C2 C1 C0
FA FA FA FA
C4 S3 S2 S1 S0
A 2 A 1 A 0 1
Binary Incrementer A 3
x x y x x y
y H A y H A
H A H A
C S C S
C S C S
C 4 S 3 S 2 S 1 S 0
Arithmetic Microoperations
ARITHMETIC
CIRCUIT Cin
S1
S0
X0 C0
A0 S1 D0
S0 FA
B0 0 Y0 C1
1
2
3 4x1
MUX
A1 X1 C1
S1 FA D1
S0
B1 0 Y1 C2
1
2
3 4x1
MUX
A2 X2 C2
S1 FA D2
B2 S0
0 Y2 C3
1
2
3 4x1
A3 MUX X3 C3
S1 D3
S0 FA
B3 0 4x1 Y3 C4
1 MUX
2
3 Cout
0 1
LOGIC MICROOPERATIONS
0 0 0 0 0 … 1 1 1
0 1 0 0 0 … 1 1 1
1 0 0 0 1 … 0 1 1
1 1 0 1 0 … 1 0 1
HARDWARE IMPLEMENTATION OF
LOGIC MICROOPERATIONS
Ai 0
1
4X1
Bi
2
F i MUX
3 Select
S1
S0
Function table
S1 Output -operation
S0
0 F=AB AND
0 F=AB OR
0 F=A XOR
1 B Comple
1 F = A’ ment
0
1
Logic Microoperations
• Selective-set A A + B
• Selective- A A
complement B A A
• Selective-clear • B’ A
• Mask (D elete) A•B A
• Clear A B
• Insert A (A •
• Compare B) + C
• ... A A
Logic Microoperations
SELECTIVE SET
1100 At
1
1011
10 B
(A A +
At+
0 B)
1
• If a bit in B is set to 1, that same position in A gets set to 1, otherwise
that bit in A keeps its previous value
Logic Microoperations
SELECTIVE COMPLEMENT
1100 At
1
0011
10 B
(A A
At+
0 B)
1
• If a bit in B is set to 1, that same position in A gets
complemented from its original value, otherwise it is
unchanged
Logic Microoperations
SELECTIVE CLEAR
1100 At
1 0 1 0B
010 (A A
At+
0 1
B’)
MASK OPERATION
1100 At
1
1001
00 (A A B
At+
0 B)
1
• If a bit in B is set to 0, that same position in A gets set to 0,
otherwise it is unchanged
Logic Microoperations
CLEAR OPERATION
1100 At
11
0 01
10 (A A B
At+
0 1
B)
Logic Microoperations
INSERT OPERATION
• An insert operation is used to introduce a specific bit
pattern into A register, leaving the other bit positions
unchanged
• This is done as
• A mask operation to clear the desired bit positions, followed
by
• An OR operation to introduce the new bits into the desired
positions
• Example
• Suppose you wanted to introduce 1010 into the low order
four bits of A:
• 1101 1000 1011 0001 A (Original)
1101 1000 1011 0001 A (Original)
1111 1111 1111 0000 Mask
1101 1000 1011 1010 A (Desired)
1101 1000 1011 0000 A (Intermediate)
0000 0000 0000 1010 Added bits
1101 1000 1011 1010 A (Desired)
Shift Microoperations
SHIFT MICROOPERATIONS
• There are three types of shifts
• Logical shift
• Circular shift
• Arithmetic shift
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
• 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
• A right arithmetic shift operation:
bit
0
• A left arithmetic
sign
shift
operation: bit
Shift Microoperations
ARITHMETIC SHIFT
• An left arithmetic shift operation must be checked for the
overflow
sign
bit
0
S
MUX H0
0
A0 1
A1 S
MUX H1
A2 0
1
A3
S
MUX H2
0
1
S
MUX H3
0
1
Serial
input (IL)
Shift Microoperations
ARITHMETIC LOGIC
SHIFT UNIT S3
S2
S1 Ci
S0
Arithmetic Di
Circuit
Select
0 4x1
Ci+1 1 Fi
2
3
MUX
Logic Ei
Bi
Ai
Ai-1 Circuit shr
Ai+1 shl