Unit1 P2JSPSingh
Unit1 P2JSPSingh
Unit1 P2JSPSingh
Shift Register
Register
Group of flip flop with each F/F capable of storing One bit of information
‘n’ bit register – ‘n’ F/F
Can have additional combinational gates to perform specific tasks
Transferring of new information into register – Loading
All the bits of the register are loaded simultaneously with common clock pulse – Parallel
Loading
4-bit Register with Parallel Load
Load Input – Determines action to be taken with each
clock pulse
The clock input receive clock pulses at all times
The Buffer gate in the clock input will increase “Fan-out”
When the load input is 1, the data in the four inputs are
transferred into the register with the next positive
transition of a clock pulse
When the load input is 0, the data inputs are inhibited and
the D-output of flip flop are connected to their inputs.
Shift Register
Register capable of shifting its Binary information in one or both directions – Shift Register
Logical Configuration of Shift Register consists of chain of Flip Flops in cascade, with the
output of one flip flop connected to the input of next F/F
The Serial Input determines what goes into the leftmost position during the shift
The Serial output is taken from the output of the rightmost flip flop
Bidirectional Shift Register with Parallel Load
Mode Operation
S1 S0
0 0 No Change
0 1 Shift Right (Down)
1 0 Shift Left (Up)
1 1 Parallel Load
Content
Register Transfer Language
Register Transfer
Combinational and sequential circuits can be used to create simple digital systems.
These are the low-level building blocks of a digital computer
Simple digital systems are frequently characterized in terms of
the registers they contain, and
the operations that are performed on data stored in them
The operations executed on the data in registers – micro-operations e.g. shift, count, clear
and load
Register Transfer Language (RTL) …
Control signals that initiate the sequence of micro-operations (to perform the functions)
Register Transfer Language (RTL) …
Rather than specifying a digital system in words, a specific notation is used – Register
Transfer Language
Symbolic notation used to describe the micro-operation transfer among register –
Register Transfer Language
For any function of the computer, the register transfer language can be used to describe the
(sequence of) micro-operations
Register Transfer Language
A symbolic language
A convenient tool for describing the internal organization of digital computers in concise/precise
manner.
Register Transfer Language (RTL) …
Registers are designated by capital letters, sometimes followed by numbers (e.g., A, R13,
IR)
Registers and their contents can be viewed and represented in various ways
A register can be viewed as a single entity:
MAR
Register Transfer Language (RTL) …
Individual F/F in ’n’ bit register are numbered in sequence [0(rightmost) to n-1]
15 0 15 8 7 0
R2 PC(H) PC(L)
Numbering of bits Subfields
Register Transfer
Information transfer from one register to another is designated in symbolic form by means
of a replacement operator
In this case the contents of register R1 are copied (loaded) into register R2
A simultaneous transfer of all bits from the source R1 to the destination register R2, during
one clock pulse
Note that this is a non-destructive; i.e. the contents of R1 are not altered by copying
(loading) them to R2
Register Transfer …
Which means “if P = 1, then load the contents of register R1 into register R2”, i.e.,
Hardware Implementation of Controlled
Transfer
Implementation of controlled transfer
P: R2 R1
‘n’ outputs of R1 are connected to ‘n’ inputs of R2
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
Basic Symbols for Register Transfer
Register Transfer
BUS STRUCTURE CONSISTS OF SET OF COMMON LINES, ONE FOR EACH BIT OF A
REGISTER THROUGH WHICH BINARY INFORMATION IS TRANSFERRED ONE AT A TIME
Have control circuits to select which register is the source, and which is the destination
Common Bus System
0 0 A
0 1 B
1 0 C
1 1 D
Common Bus System …
Transfer of information from a bus into one of many destination registers can be
accomplished by connecting the bus lines to the inputs of all the destination registers and
activating load control of the particular destination register selected.
Connecting Registers - Bus Transfer
Connecting Registers - Bus Transfer
Memory – RAM
M
Memory Read
AR
unit Write
RAM
R1 R1
100 66
Summary of Register Transfer Microoperations
Symbolic Description
Transfer content of reg. B into reg. A
Transfer a binary constant into reg. A
Transfer content of R1 into bus A and, at the same time,
transfer content of bus A into R2
Address register
Data register
Memory word specified by reg. R
Equivalent to M[AR]
Memory read operation: transfers content of memory word
specified by AR into DR
Memory write operation: transfers content of DR into
memory word specified by AR
Micro-operations
Register Transfer
Arithmetic Micro-operation
C3 C2 C1 C0
FA FA FA FA
C4 S3 S2 S1 S0
For unsigned numbers, this gives A – B if A≥B
or the 2’s complement of (B – A) if A < B (example: 3 – 5 = -2= 2’s complement of (110)
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
4-bit Binary Incrementer
A binary decrementer can be implemented by adding 1111 to the desired register each time!
Arithmetic Circuit
This circuit performs eight distinct arithmetic operations and the basic component of it is
the parallel adder
Output of the binary adder is calculated from the following arithmetic sum:
Arithmetic Circuits S1
S0
A0 X0 C0
S1 D0
S1 S0 Cin I /P O/P Operation S0 FA
(Y) B0 0
4x1
Y0 C1
1
0 0 0 B D=A+B Add 2 MUX
3
1 1 0 1 D=A-1 Decrement A S0 FA
B2 Y2 C3
0
1 4x1
1 1 1 1 D=A Transfer A 2 MUX
3
A3 X3 C3
1011 S1 D3
S0 FA
+ 1111 Y3 C4
B3 0
4x1
1010 1
2 MUX
3 Co
0 1
Content
Register Transfer Language
Register Transfer
Arithmetic Micro-operation
Symbol: , +
Gate:
OR OR
Add
Logic Operation (AND Microoperation)
Symbol:
Gate:
Symbol:
Gate:
Example:
Logic Operation (XOR Microoperation)
Exclusive – OR
Symbol:
Gate:
1 Ei
S1 S0 Output Operation
2
0 0 E=A B AND
0 1 E=AvB OR
3
1 0 E=AB XOR
1 1 E = A’ Complement
Applications of Logic Microoperations
Logic micro operations can be used to manipulate individual bits or a portions of a word
in a register. They can be used to change bit values, delete a group of bits, or insert new
bit values into a register.
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 A Av B
Selective-complement A A B
Selective-clear A A • B’
Mask (Delete) A A• B
Clear A A B
Insert A (A • B) v C
Compare A A B
Selective-Set Operation (OR)
In a selective set operation, the bit pattern in B is used to set certain bits in A
1010 At
1100 B (Logic
operand)
1110 A(t+1) (A A v B)
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
Selective-Complement Operation (XOR)
1010 At
1100 B (Logic
operand)
0110 A(t+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
Selective-Clear Operation (A.B’)
1010 At
1100 B (Logic
operand)
0010 A(t+1) (A A B’)
In a mask operation, the bit pattern in B is used to clear certain bits in A. It is similar to
selective-clear operation except that the bits of A are cleared only where there are
corresponding 0’s in B
1010 At
1100 B (Logic
operand)
1000 A(t+1) (A A B)
1010 At
1100 B (Logic operand)
0110 A(t+1) (A A B)
0000 1010 At
0110 1010 At
1001 0000 B (Logic
0000 1111 B (Logic operand)
operand)
0000 1010 A(t+1) (A A B) 1001 1010 A(t+1) (A A v B)
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)
Solution
1101 1000 1011 0001 A (Original)
1111 1111 1111 0000 Mask
1101 1000 1011 0000 A (Intermediate)
0000 0000 0000 1010 Added bits
1101 1000 1011 1010 A (Desired)
Content
Register Transfer Language
Register Transfer
Arithmetic Micro-operation
Shift Left
**Note that the bit ri is the bit at position (i) of the register
Logical Shift
In a logical shift the serial input to the shift is a 0.
A right logical shift operation:
Shift Right
A left logical shift operation:
Serial Output Serial Input (0)
rn-1 r3 r2 r1 r0
Shift Left
In a Register Transfer Language, the following notation is used
shl for a logical shift left
shr for a logical shift right
Examples:
R1 shl R1
R2 shr R2
Circular Shift (Rotate)
• In a circular shift the serial input is the bit that is shifted out of the other
end of the register.
0
sign
bit
CSE 211
Shift Micro-Operations
Select
0 for shift right
S 1 0 S 1 0 S 1 0 S 1 0
1 for shift left
MUX MUX MUX MUX
H0 H1 H2 H3
Select Output
S H0 H1 H2 H3
0 IR A0 A1 A2
1 A1 A2 A3 IL
Arithmetic Logic and Shift Unit
S3
S3 S2 S1 S0 Cin Operation
S2
S1 Ci 0 0 0 0 0 F=A
S0 0 0 0 0 1 F = A+1
0 0 0 1 0 F = A+B
One stage of Di 0 0 0 1 1 F = A+B+1
arithmetic circuit
(Fig.A) F=A+B’
0 0 1 0 0
One stage of Select
0 0 1 0 1 F=A+B’+1
ALU
Fi 0 0 1 1 0 F=A-1
Ci+1 0 4×1 F=A
0 0 1 1 1
1 MUX
0 1 0 0 X F=A
One stage of Ei 2
logic circuit 0 1 0 1 X F=AvB
Bi (Fig.B) 3
Ai
0 1 1 0 X F=AB
0 1 1 1 X F=A’
shr
Ai+1 F=shr A
shl 1 0 X X X
Ai-1
1 1 X X X F=shl A