Digital Electronics Chapter 8
Digital Electronics Chapter 8
Shift Registers
Dr Abdelaziz Yousif
Ahmed 22-03-23
Ext: 7845
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Course Outcome
1. Explain number systems, codes, digital arithmetic operation and
circuits.
2. Use Boolean algebra and Karnaugh Maps to minimize Boolean
expressions for the design of digital logic circuits.
3. Explain and use flip-flops, latches, counters, multiplexers
and de-multiplexers.
4. Design and construct combinational digital logic circuits using
appropriate logic design techniques.
5. Design and construct synchronous sequential digital
logic circuits using appropriate logic design techniques.
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Learning Outcome
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Outline
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift register Operations
Basic Shift Register Operations
A shift register is group of flip-flops is used to store more
that 1-bit.
Some basic data movements are illustrated here.
Data in
Serial in/shift right/serial out Serial in/shift left/serial out Parallel in/serial out
Data in
Data in
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Type of Shift Register Data I/O
Serial-in/Serial out Shift Register
Shift registers are available in IC form or can be constructed
from discrete flip-flops as is shown here with a five-bit serial-in
serial-out register.
Each clock pulse will move an input bit to the next flip-flop. For
example, a 1 is shown as it moves across.
CCL
L KK
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Type of Shift Register Data I/O
Serial-in/Serial out Shift Register
The serial in/serial out shift register accepts data serially that is,
one bit at a time on a single line. It produces the stored
information on its output also in serial form.
1010
Initial 0 0 0 0
1 0 0 0 0
2 1 0 0 0
3 0 1 0
0
4 1 0 1
Digital Fundamentals, Eleventh Edition, Global Edition
0
Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Type of Shift Register Data I/O
Serial-in/Serial out Shift Register
Initial 1 0 1 0
5 0 1 0 1
6 0 0 1 0
7 0 0 0 1
8 0 0 0 0
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Type of Shift Register Data I/O
Serial-in/Serial out Shift Register - Example
Show the states of the 5-bit register in figure below for the
specified data input and clock waveforms. Assume that the
register is initially cleared (all 0s).
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Type of Shift Register Data I/O
Serial-in/Serial out Shift Register
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Type of Shift Register Data I/O
Serial-in/Parallel out Shift Register
Data bits are entered serially (least-significant bit first) into a serial
in/parallel out shift register in the same manner as in serial in/serial out
registers.
The difference is the way in which the data bits are taken out of the
register; in the parallel output register, the output of each stage is
available.
Once the data are stored, each bit appears on its respective output line,
and all bits are available simultaneously, rather than on a bit-by-bit basis
as with the serial output.
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Type of Shift Register Data I/O
Serial-in/Parallel out Shift Register - Example
Show the states of the 4-bit register (SRG 4) for the data input
and clock waveforms in Figure below. The register initially
contains all 1s.
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Type of Shift Register Data I/O
Serial-in/Parallel out Shift Register - Example
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Type of Shift Register Data I/O
Parallel in/Serial out Shift Register
Shift registers can be used to convert parallel data to
serial form. A logic diagram for this type of register is
shown:
D0 D1 D2
D3
SHIFT/LOAD
G1 G5 G6 G3 G7
G2 G4
Serial
D D D D
Q0 Q1 Q2 Q3 data out
C C C C
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Type of Shift Register Data I/O
Parallel in/Serial out Shift Register
D2 D3
D0 D1
SHIFT/LOAD
G1 G5 G2 G6 G3 G7 G4
Q0 Q1 Q2 Q3
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Type of Shift Register Data I/O
Parallel in/Serial out Shift Register
Load mode
D0 D1 D2 D3
0 1 1
SHIFT/LOAD 1 1
0 0 0 0
G1 G5 G2 G6 G3 G7 G4
0 D1 0 D2 0 D3
D0
0 0 0 0 Serial
D1
Q 1 D2
D D D D
Q0 Q2 D3
Q3 data out
C C C C
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Type of Shift Register Data I/O
Parallel in/Serial out Shift Register
Shift mode
D0 D1 D2 D3
1 0 0
SHIFT/LOAD 0 0
1 1 1
1
G1 G5 G6 G7
G2 G4
0
G3
Q0 0 Q2 0
Q1
Q0 Serial
Q 1 Q1
D D D D
Q0 Q2 Q2
Q3 data out
C C C C
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Type of Shift Register Data I/O
Parallel In/Parallel Out Shift Registers
The parallel in/parallel out register employs both methods.
Immediately following the simultaneous entry of all data bits, the bits
appear on the parallel outputs.
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Bidirectional Shift Register
A bidirectional shift register is one in which the data can be shifted
either left or right.
A HIGH on the RIGHT/LEFT control input allows data bits inside the
register to be shifted to the right, and a LOW enables data bits inside the
register to be shifted to the left.
When the RIGHT/LEFT control input is HIGH, gates G1 through G4 are
enabled.
When a clock pulse occurs, the data bit are shifted one place to the right.
When the RIGHT/LEFT control input is LOW, gates G5 through G8 are
enabled.
When a clock pulse occurs, the data bits are then shifted one place to the
left.
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Bidirectional Shift Register
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Bidirectional Shift Register
RIGHT/LEFT
Serial
data in
G1 G5 G2 G6 G3 G7 G4 G8
Q0 Q1 Q2 Q3
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Bidirectional Shift Register
Bidirectional Shift Register (shift right)
0 0 0 0
1 1 1 1
1 Din
Din Din
Din
Din
0 0 0 0
Din Din Din Din
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Bidirectional Shift Register
Bidirectional Shift Register (shift left)
1 1 1 1
0 0 0 0
0 Din
Din Din Din
Din
0 0 0 0
Din Din Din Din
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Bidirectional Shift Register
EXAMPLE
Determine the state of the shift register of Bidirectional Shift
Register after each clock pulse for the given RIGHT/LEFT control
input waveform in (a). Assume that Q0 = 1, Q1 = 1, Q2 = 0, and Q3 = 1
and that the serial data-input line is LOW.
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Counters
The Johnson Counter
The complement of the output of the last flip-flop is connected
back to the D input of the first flip-flop.
Johnson counter will produce a modulus of 2n, where n is the
number of stages in the counter.
FF0 FF1 FF2 FF3
flip-flops Q3 Q3
CLK
CLK
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Counters
Johnson Counter
Redrawing the same Johnson counter (without the clock shown)
illustrates why it is sometimes called as a “twisted-ring” counter.
FF0
J0 Q0
“twist” C
K0 Q0
Q3
Q3
Q3
Q
3
Q1
K1
Q1
J1
FF3
FF1
C
C
K3
J3
Q2 K2
Q2 2 J
2FF
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Counters
Five-bit Johnson Counter
1 0
0 0 0 0 0 0
1 1 0 0 0 0
2 1 1 0 0 0
3 1 1 1 0 0
4 1 1 1 1 0
5 1 1 1 1 1
6 0 1 1 1 1
7 0 0 1 1 1
8 0 0 0 1 1
9 0 0 0 0 1
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Counters
Johnson Counter
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Counters
Ring Counter
The only change is the output of the last FF is connected to the input of
first FF0.
The ring counter can be implemented with either D flip-flops or J-K
flip-flops.
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Counters
A 10-bit Ring
Counter
0 1 0 0 0 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0 0 0
2 0 0 1 0 0 0 0 0 0 0
3 0 0 0 1 0 0 0 0 0 0
4 0 0 0 0 1 0 0 0 0 0
5 0 0 0 0 0 1 0 0 0 0
6 0 0 0 0 0 0 1 0 0 0
7 0 0 0 0 0 0 0 1 0 0
8 0 0 0 0 0 0 0 0 1 0
9 0 0 0 0 0 0 0 0 0 1
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Counters
Ring Counter -Example
If a 10-bit ring counter similar to the figure below has the initial state
1010000000, determine the waveform for each of the Q outputs.
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Counters
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Application
Time Delay
A serial in/serial out shift register can be used to provide a time delay
from input to output that is a function of both the number of stages (n) in
the register and the clock frequency.
When a data pulse is applied to the serial input, it enters the first stage on
the triggering edge of the clock pulse. It is then shifted from stage to
stage on each successive clock pulse until it appears on the serial output
n clock periods later.
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Application
Time Delay -EXAMPLE
Determine the amount of time delay between the serial input and
each output. Show a timing diagram to illustrate.
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Application
The clock period is 2 µs. Thus, the time delay can be increased or
decreased in 2 µs increments from a minimum of 2 µs to a maximum of
16 µs.
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register
Application
An 8-bit serial in/serial out shift register has a 40 MHz clock. What
is the total delay through the register?
A SRG 8 Q7
Data in Data out
B
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Application
Serial-to-Parallel Data Converter
Serial data transmission from one digital system to another
commonly
is used to reduce the number of wires in the transmission line.
A simplified serial-to-parallel data converter, in which two types of
shift registers are used.
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Application
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Shift Register Application
Keyboard Encoder
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Power on LOAD
SH / LD +VCC
Ring counter
D0 D1 D2 D3 D4 D5 D6 D7
J J
K K
CLK
SRG 4 SRG 4 +V
(5 kHz) 74HC195 74HC195
Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
C C
Clock inhibit
123456 7 8 1 234567 8
ROW encoder COLUMN encoder
74HC147 74HC147
124 12 4
Switch closure
Q Q
D0 D1 D2 D3 D4 D5
C
Key code register
C C 74HC174
Q0 Q1 Q2 Q3 Q4 Q5
Q
One-shots To ROM
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Quiz
a. c.
Data in Data out Data out
Data in
b. Data in
d.
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Quiz
2. The circuit shown is a
a. serial-in/serial-out shift register
b. serial-in/parallel-out shift register
c. parallel-in/serial-out shift register
d. parallel-in/parallel-out shift register
D0 D3
SHIFT / LOAD D1
D2
G4 G1 G5 G2 G6 G3
Serial
D0 Q0 D1 Q1 D2 Q2 D3 Q3 data
out
C C C C
CLK
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Quiz
SHIFT /LOAD
G4 G1 G5 G2 G6 G3
Serial
D0 Q0 D1 Q1 D2 Q2 D3 Q3 data
out
C C C C
CLK
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Quiz
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Quiz
5.The 74HC164 (shown) has two serial inputs. If data is
placed on the A input, the B input
a. could serve as an active LOW enable
b. could serve as an active HIGH enable
c. should be connected to ground
d. should be left open
(9)
CLR
(8)
CLK
Serial A (1)
R R R R R R R R
inputs B (2) C C C C C C C C
S S S S S S S S
Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Quiz
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Quiz
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Quiz
C
C C C
Q3
K0 Q0
K1 Q1 K2 Q2 K3 Q3
CLK
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Quiz
A SRG Q7
Data in Data
B 8
out
CL Q7
C
20K
MHz
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Quiz
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved
Quiz
Answers:
1. a 6. d
2. c 7. d
3. c 8. d
4. a 9. c
5. b 10.
a
Digital Fundamentals, Eleventh Edition, Global Edition Copyright © 2016 by Pearson Education, Ltd.
Thomas L. Floyd All Rights Reserved