Chapter 2 (1)
Chapter 2 (1)
Chapter 2 (1)
Micro-operations
Register Transfer & -
operations
SIMPLE DIGITAL SYSTEMS
• Typically,
– What operations are performed on the data in the registers
– What information is passed between registers
2
12/15/2024
Register Transfer & - Register Transfer Language
operations
MICROOPERATIONS (1)
3
12/15/2024
Register Transfer & - Register Transfer Language
operations
MICROOPERATION (2)
R f(R, R)
- Microoperations set
5
12/15/2024
Register Transfer & - Register Transfer Language
operations
REGISTER TRANSFER LEVEL
6
12/15/2024
Register Transfer & - Register Transfer Language
operations
REGISTER TRANSFER LANGUAGE
7
12/15/2024
Register Transfer & - Register Transfer Language
operations
DESIGNATION OF REGISTERS
• Registers are designated by capital letters,
sometimes followed by numbers (e.g., A, R13, IR) to
denote the function of the register.
• Often the names indicate function:
– MAR - memory address register
– PC - program counter
– IR - instruction register
– Registers may also be represented showing the bits of data they contain
8
12/15/2024
Register Transfer & - Register Transfer Language
operations
DESIGNATION OF REGISTERS
• Designation of a register
- a register
- portion of a register
- a bit of a register
9
12/15/2024
Register Transfer & - Register Transfer
operations
REGISTER TRANSFER
R2 R1
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
11
12/15/2024
Register Transfer & - Register Transfer
operations
CONTROL FUNCTIONS
• Often actions need to only occur if a certain condition is true
• This is similar to an “if” statement in a programming language
• In digital systems, this is often done via a control signal,
called
a control function.
A control function is a Boolean Variable that is equal to 1 or 0.
– If the signal is 1, the action takes place
• This is represented as:
P: R2 R1
12
12/15/2024
Register Transfer & - Register Transfer
operations
HARDWARE IMPLEMENTATION OF CONTROLLED
TRANSFERS
Implementation of controlled
transfer P: R2 R1
Control
Block diagram Circuit
P Load
R2 Clock
n
R1
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
13
12/15/2024
Register Transfer & - Register Transfer
operations
SIMULTANEOUS OPERATIONS
P: R3 R5, MAR IR
14
12/15/2024
Register Transfer & - Register Transfer
operations
BASIC SYMBOLS FOR REGISTER TRANSFERS
15
12/15/2024
Register Transfer & - Register Transfer
operations
CONNECTING REGISTRS
16
12/15/2024
Register Transfer & - Bus and Memory Transfers
operations
BUS AND BUS TRANSFER
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 Register Register Register
A B C D
Bus
lines
4 2 3 4 2 3 4
B1 C1 D B2 C2 D 2 B3 C3 D B4 C4 D
0 14 x1 0 4 x1 0 34 x1 0 4
4 x1
MUX MUX MUX MUX
x
select
y
4-line bus
17
12/15/2024
Register Transfer & - Bus and Memory Transfers
operations
BUS TRANSFER IN RTL
18
12/15/2024
Register Transfer & - Bus and Memory Transfers
operations
MEMORY (RAM)
• Memory (RAM) can be thought as a sequential
circuits containing some number of registers
• These registers hold the words of memory
• Each of the r registers is indicated by an address
• These addresses range from 0 to r-1
• Each register (word) can hold n bits of data
• Assume the RAM contains r = 2K words. It needs the
Following:
– n data input lines data input lines
– n data output lines
n
– k address lines
– A Read control line address lines RAM
– A Write control line unit
Read
Write
n
data output lines
19
12/15/2024
Register Transfer & - Bus and Memory Transfers
operations
MEMORY
TRANSFER
• Collectively, the memory is viewed at the register level
as a device, M.
• Since it contains multiple locations, we must
specify which address in memory we will be using
• This is done by indexing memory references
20
12/15/2024
Register Transfer & - Bus and Memory Transfers
operations
MEMORY READ
Read DR M[AR]
This causes a transfer of information into DR from the memory M
selected by the address in AR
21
12/15/2024
Register Transfer & - Bus and Memory Transfers
operations
MEMORY WRITE
M[AR] R1
22
12/15/2024
Register Transfer & -
Bus and Memory
operations
SUMMARY OF R. TRANSFER
Transfers
MICROOPERATIONS
24
12/15/2024
Register Transfer & - Arithmetic Microoperations
operations
ARITHMETIC MICROOPERATIONS
• The basic arithmetic microoperations are
– Addition
– Subtraction
– Increment
– Decrement
• Truth
x 0tables
011 for 16 functions
Boolean Micro-of 2 variables
Name and the
corresponding
y 0101 16 logic micro-operations
Function Operations
0000 F0 = 0 F0 Clear
0001 F1 = xy F A B AND
0010 F2 = xy' F A B’
0011 F3 = x FA Transfer A
0100 F4 = x'y F A’ B
0101 F5 = y FB Transfer B
0110 F6 = x y FAB Exclusive-OR
0111 F7 = x + y FAB OR
1000 F8 = (x + y)' F A B)’ NOR
1001 F9 = (x y)' F (A B)’ Exclusive-NOR
1010 F10 = y' F B’ Complement B
1011 F11 = x + y' F AB’
1100 F12 = x' F A’ Complement A
1101 F13 = x' + y F A’B
1110 F14 = (xy)' F (A NAND
1111 F15 = 1 B)’ Set to all 1's
F all 1's 26
12/15/2024
Register Transfer & - Logic Microoperations
operations
APPLICATIONS OF LOGIC MICROOPERATIONS
• Logic microoperations can be used to manipulate
individual bits or a portions of a word in a register
– Selective-set AA+B
– Selective-complement AAB
– Selective-clear A A • B’
– Mask (Delete) AA•B
– Clear AAB
– Insert A (A • B)
– Compare +C
AAB
27
12/15/2024
Register Transfer & - Logic Microoperations
operations
SELECTIVE SET
28
12/15/2024
Register Transfer & - Logic Microoperations
operations
SELECTIVE COMPLEMENT
1100 At
1010 B
0110 At+1 (A A B)
29
12/15/2024
Register Transfer & - Logic Microoperations
operations
SELECTIVE CLEAR
30
12/15/2024
Register Transfer & - Logic Microoperations
operations
MASK OPERATION
31
12/15/2024
Register Transfer & - Logic Microoperations
operations
CLEAR OPERATION
1100 At
1010 B
0110 At+1 (A A B)
32
12/15/2024
Register Transfer & - Logic Microoperations
operations
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
» four bits of
Suppose 1101to
A: wanted
you 1000 1011 0001
introduce 1010Ainto
(Original)
the low
order 1101 1000 1011 1010 A (Desired)
33
12/15/2024
Register Transfer & - Shift Microoperations
operations
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
34
12/15/2024
Register Transfer & - Shift Microoperations
operations
LOGICAL SHIFT
• In a logical shift the serial input to the shift is a 0.
36
12/15/2024
Register Transfer & - Shift Microoperations
operations
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
37
12/15/2024
Arithmetic Shift Right
• Arithmetic right-shift: Rn-1 remains unchanged;
• Rn-2 receives Rn-1, Rn-3 receives Rn-2, so on.
• For a negative number, 1 is shifted from the sign bit to the right. A negative
number is represented by the 2’s complement. The sign bit remained unchanged.
Arithmetic Shift Right
• Arithmetic Shift Right :
• Example 1
0100 (4)
0010 (2)
• Example 2
1010 (-6)
1101 (-3)
Arithmetic Shift Left
The operation is same with Logic shift-left
The only difference is you need to check
overflow problem
Carry out R 2 ashl R 2
Sign bit
LSB
Rn-1 Rn-2
43
12/15/2024