Register and Its Operations
Register and Its Operations
Register and Its Operations
Organization &
Architecture
UNIT 1:RTL
Register Transfer
Language(RTL)
CONTENTS
• Register Transfer Language
• Register Transfer
• Arithmetic Microoperations
• Logic Microoperations
• Shift Microoperations
1. Main Memory Unit (Registers) –Accumulator: Stores the results of calculations made by ALU. This is the most common register,
used to store data taken out from the memory.
2. Special Purpose Registers: Users do not access these registers. These registers are for Computer system such as MAR,MBR,PC, IR
etc.
i) Program Counter (PC): Keeps track of the memory location of the next instructions to be dealt with. The PC then passes this
next address to Memory Address Register (MAR).
ii) Memory Address Register (MAR): It stores the memory locations of instructions that need to be fetched from memory or stored
into memory.
iii) Memory Data Register (MDR): It stores instructions fetched from memory or any data that is to be transferred to, and stored
in, memory.
iv) Current Instruction Register (CIR): It stores the most recently fetched instructions while it is waiting to be coded and
executed.
v) Instruction Buffer Register (IBR): The instruction that is not to be executed immediately is placed in the instruction buffer
register IBR.
3. General Purpose Registers: This is used to store data intermediate results during program execution. It can be accessed via assembly
programming.
Memory Transfer
Most of the standard notations used for specifying operations on memory transfer are
stated below.
o The transfer of information from a memory unit to the user end is called a Read operation.
o The transfer of new information to be stored in the memory is called a Write operation.
o A memory word is designated by the letter M.
o We must specify the address of memory word while writing the memory transfer
operations.
o The address register is designated by AR and the data register by DR.
o Thus, a read operation can be stated as:
Read/Write Operation
Read: DR ← M [AR]
o The Read statement causes a transfer of information into the data register (DR) from the
memory word (M) selected by the address register (AR).
o And the corresponding write operation can be stated as:
Write: M [AR] ← R1
o The Write statement causes a transfer of information from register R1 into the memory
word (M) selected by address register (AR).
Register Transfer Language
The symbolic notation used to describe the micro-operation transfers amongst registers is
called Register transfer language.
The word language is borrowed from programmers who apply this term to programming
languages. This programming language is a procedure for writing symbols to specify a
given computational process
Register Transfer
The term Register Transfer refers to the availability of hardware logic circuits that can
perform a given micro-operation and transfer the result of the operation to the same or
another register. Most of the standard notations used for specifying operations on various
registers are stated below.
o The memory address register is designated by MAR.
o Program Counter PC holds the next instruction's address.
o Instruction Register IR holds the instruction being executed.
o R1 (Processor Register).
o We can also indicate individual bits by placing them in parenthesis. For instance, PC (8-
15), R2 (5), etc.
o Data Transfer from one register to another register is represented in symbolic form by
means of replacement operator. For instance, the following statement denotes a transfer of
the data of register R1 into register R2.
Contd..
R2 ← R1
o Typically, most of the users want the transfer to occur only in a predetermined control
condition. This can be shown by following if-then statement:
If (P=1) then (R2 ← R1); Here P is a control signal generated in the control section.
o It is more convenient to specify a control function (P) by separating the control variables
from the register transfer operation. For instance, the following statement defines the data
transfer operation under a specific control function (P).
Notations of Registers
The following image shows the block diagram that depicts the transfer of data from R1 to
R2.
HARDWARE IMPLEMENTATION OF CONTROLLED TRANSFERS
Block diagram
Timing diagram t t+1
Clock
Load
Transfer occurs here
Timing diagram
• 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
Bus Design
BUS Design Using Multiplexer
Bus Design Using Three State buffer gate
Bus Designing Using Multiplexer
A bus system will multiplex K register of n bits each to produce
an n-line common bus .
The number of multiplexers needed to construct the bus is equal
to n.
The size of each multiplexer must be K X1 since it multiplexes k
datalines
NUMERICAL PROBLEM
A3A2A1A0
0 0 0 1 110 0 A
1 10 1 B
1 1 0 0 1 A+B
A+B
A-B =A+B’+1
n Bit Binary Adder
BINARY ADDER / SUBTRACTOR / INCREMENTER Cont. …
Binary adder-Subtractor
If M = 0 , the circuit is adder and when M = 1, the circuit is a subtractor,
When M = 0, B = B 0 = B, and the circuit performs A + B,
When M = 1, B = B 1 = B′ and C0 = 1, the circuit performs A plus 2’s
complement of B.
For unsigned number, this gives A – B if A ≥B or the 2’s complement
of (B – A) if A < B,
For signed numbers, the result is A – B provided there is no overflow.
The increment microoperation adds one in a register and this can be
implemented with a binary counter as sequential circuit.
Alternatively, this can be implemented as combination circuit through half
adder
This approach can be extended to an n-bit binary incrementer by n-half
adder
n Bit Adder Subtractor
Binary Incrementer
Arithmetic Circuit
ARITHMETIC CIRCUIT Analysis
By controlling Y with the two selection inputs (S1 and S0) and Cin equals to 1 or 0, it is pos-
sible to generate eight microoperations.
When S1S0 = 00, the value of B is applied to the Y inputs of the
adder
If Cin = 0, the output D = A + B
If Cin = 1, the output D = A + B +1
…
Arithmetic Circuit Truth Table
S1 S0 Cin Y Output Microoperation
0 0 0 B D = A + B Add
0 0 1 B D=A+B+1 Add with carry
0 1 0 B’ D = A + B’ Subtract with borrow
0 1 1 B’ D = A + B’+ 1 Subtract
1 0 0 0 D = A Transfer A
1 0 1 0 D=A+1 Increment A
1 1 0 1 D=A-1 Decrement A
1 1 1 1 D = A Transfer A
Numerical
Design an arithmetic circuit with one selection variable S and two n-bit data inputs A and
B. The circuit generates the following four arithmetic operations in conjunction with the
input carry Cin. Draw the logic diagram for the first two stages.
S Cin = 0 Cin =1
0 D=A+B(Add) D= A+1(Increment)
1 D = A-1 (Decrement) D = A+B’+1(Subtract)
Logic Microoperations
LOGIC MICROOPERATIONS
Ai
0
Bi
1
4X1 Fi
MUX
2
3 Select
S1
S0
Function table
S1 S 0 Output -operation
0 0 F=AB AND
0 1 F = AB OR
1 0 F=AB XOR
1 1 F = A’ Complement
Logic Microoperations
Consider the data in a register A. In another register, B, is bit data that will be used to
modify the contents of A
Selective-set AA+B
Selective-complement AAB
Selective-clear A A • B’
Mask (Delete) AA• B
Clear AAB
Insert A (A • B) + C
Compare AAB
SELECTIVE-SET operation
1100 At before
1010 B (logic operand)
1110 At+1 (A A + B) after
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
OR micro-operation can be used to selective set
SELECTIVE-COMPLEMENT
In a selective complement operation, the bit pattern in B is used to complement certain bits
in A
1100 At before
1010 B (logic operand)
0110 At+1 (A A B) after
If a bit in B is set to 1, that same position in A gets complemented from its original value,
otherwise it is unchanged
Xor micro-opration can be used.
SELECTIVE-CLEAR
1100 At before
1010 B (logical operand)
0100 At+1 (A A B’) after
MASK OPERATION
1100 At before
1010 B (logical operand)
1000 At+1 (A A B) after masking
In a clear operation, if the bits in the same position in A and B are the same, they are
cleared in A, otherwise they are set in A
1100 At
1010 B
0110 At+1 (A A B)
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 1010 A (Desired)
Serial
• A left shift operation input
LOGICAL SHIFT
In a logical shift the serial input to the shift is a 0.
sign
bit
ARITHMETIC SHIFT
An left arithmetic shift operation must be checked for the overflow
0
sign
bit
The 8-bit register AR,BR,CR and DR initially have the following values
AR = 11110010
BR = 11111111
CR = 10111001
DR = 11101010
Determine the 8-bit values in each register after execution of the following sequence of micro-
operations
AR ← AR+BR
CR ← CR^DR, BR← BR+1
AR ← AR -CR
HARDWARE IMPLEMENTATION OF SHIFT MICROOPERATIONS
S
H0 Function table
0 MUX
1
Select output
A0
S H0 H1 H2 H3
A1 S
H1 0 IR A0 A1 A2
0 MUX
A2 1 1 A1 A2 A3 IL
A3
S
MUX H2
0
1
S
MUX H3
0
1
Serial
input (IL)
Figure 4-bit combinational circuit shifter
ARITHMETIC LOGIC SHIFT UNIT
S3
S2 Ci
S1
S0
Arithmetic Di
Circuit
Select
Ci+1
0 4x1 Fi
1 MUX
2
3
Ei
Logic
Bi
Ai
Circuit
shr Figure 4.13 One stage of arithmetic logic shift unit
Ai-1
A i+1 shl