Upload
mridanku-shekhar-pramanick
View
221
Download
0
Embed Size (px)
Citation preview
7/28/2019 DIGITAL Registers
1/27
Registers
7/28/2019 DIGITAL Registers
2/27
Registers
Registers hold larger quantities of data than individual flip-flops.
Registers are central to the design of modern processors.
There are many different kinds of registers.
Well show some applications of
these special registers.
Flip-flops are limited because they can store only one bit.
We had to use two flip-flops for our two-bit counter examples.
Most computers work with integers and single-precisionfloating-point numbers that are 32-bits long.
A register is an extension of a flip-flop that can store multiple bits.
Registers are commonly used as temporary storage in aprocessor.
They are faster and more convenient than main memory.
More registers can help speed up complex calculations.
Registers 1.2
7/28/2019 DIGITAL Registers
3/27
Basic registers are easy to build. We can store multiple bits just by putting a
bunch of flip-flops together!A 4-bit register internal implementation is below.This register uses D flip-flops, so its easy to store data without worryingabout flip-flop input equations. All the flip-flops share a common CLK and CLRsignal.
Registers 1.3
7/28/2019 DIGITAL Registers
4/27
Shift Register Applications
Shift Registers are an important Flip-Flopconfiguration with a wide range of applications,including: Computer and Data Communications
Serial and Parallel Communications
Multi-bit number storage Sequencing
Basic arithmetic such as scaling (a serial shift to the leftor right will change the value of a binary number a powerof 2)
Logical operations
7/28/2019 DIGITAL Registers
5/27
A shift registershifts its output once every clock cycle.
SI is an input that supplies a new bit to shift intothe register.
For example, if on some positive clock edge we have:
SI = 1Q
0-Q
3= 0110
then the next state will be:
Q0-Q3 = 1011
The current Q3 (0 in this example) will be lost on the next cycle.
Shift registers
Q0(t+1) = SIQ1(t+1) = Q0(t)Q2(t+1) = Q1(t)Q3(t+1) = Q2(t)
7/28/2019 DIGITAL Registers
6/27
Registers 1.6Registers 6
Shift direction
The circuit and example make it look like the register shifts
right.
But it really depends on your interpretation of the bits. If you
consider Q3 to be the most significant bit instead, then theregister is shifting in the opposite direction!
Q0(t+1) = SIQ
1(t+1) = Q
0(t)
Q2(t+1) = Q1(t)Q3(t+1) = Q2(t)
Present Q0-Q3 SI Next Q0-Q3
ABCD X XABC
Present Q3-Q0 SI Next Q3-Q0
DCBA X CBAX
7/28/2019 DIGITAL Registers
7/27
Registers
Shift registers with parallel load
We can add a parallel load, just like we did for regular registers.
When LD = 0, the flip-flop inputs will be SIQ0Q1Q2, so the register shifts on the nextpositive clock edge.
When LD = 1, the flip-flop inputs are D0-D3, and a new value is loaded into the shiftregister, on the next positive clock edge.
7/28/2019 DIGITAL Registers
8/27Registers 1.8
Basic Shift RegisterShift register consist of arrangements of flip-flop
and are important in applications involving thestorage and transfer of data in a digital system.
Serial in/serial out shift registersSerial in/parallel out shift registersParallel in/serial out shift registersParallel in/parallel out shift registers
Bidirectional shift registers
7/28/2019 DIGITAL Registers
9/27
Parallel versus Serial
Serial communications: provides a binarynumber as a sequence of binary digits, oneafter another, through one data line.
Parallel communications: provides a binarynumber as binary digits through multiple datalines at the same time.
7/28/2019 DIGITAL Registers
10/27
Shift Registers
Shift Registers are devices that store and move databits in serial (to the left or the right),
..or in parallel,
..or a combination of serial and parallel.
7/28/2019 DIGITAL Registers
11/27
Registers 1.11
7/28/2019 DIGITAL Registers
12/27
Configuration
In Shift Registers, the binary digit transfers (shifts)from the output of one flip-flop to the input of thenext individual Flip-Flop at every clock edge.
Once the binary digits are shifted in, the individualFlip-Flops will each retain a bit, and the wholeconfiguration will retain a binary number.
7/28/2019 DIGITAL Registers
13/27
Construction
Shift registers are constructed from flip-flops due to their
characteristics: Edge-triggered devices
Output state retention
Each Flip-Flop in a shift register can retain one binary digit.
For instance, if a 5-bit binary number needs to be stored andshifted, 5 flip-flops are required.
Each binary digit transfer operation requires a clock edge.
Asynchronous inputs are useful in resetting the wholeconfiguration.
7/28/2019 DIGITAL Registers
14/27
Shift Register Construction
Shift registers are comprised of D Flip-Flops thatshare a common clock input.
D Q
Q
D Q
Q
D Q
Q
7/28/2019 DIGITAL Registers
15/27
Combinations of Data Transfer Methods
SISO: Serial In, Serial Out
SIPO: Serial In, Parallel Out
PISO: Parallel In, Serial Out
PIPO: Parallel In, Parallel Out
How many clock edges are required for each operation?
10110 10110
10110
10110
10110
1011010110
10110
7/28/2019 DIGITAL Registers
16/27
SISO Flip-Flop Shift Register
a Serial In Serial Out shift register has a singleinput and a single output
D Q
Q
D Q
Q
D Q
Q
Input Output
7/28/2019 DIGITAL Registers
17/27
Registers 1.17
4-bit version One-bit at a time on asingle line
7/28/2019 DIGITAL Registers
18/27
Registers 1.18
Four Bits(1010) beingenteredserially intothe
register
7/28/2019 DIGITAL Registers
19/27
Registers 1.19
Four Bits (1010)beingserially shifted outof theregister and
replaced byall zeros
7/28/2019 DIGITAL Registers
20/27
SIPO Flip-Flop Shift Register
a Serial In Parallel Out shift register has a single inputand access to all outputs
D Q
Q
D Q
Q
D Q
Q
Input
Output Output Output
Registers 1.20
7/28/2019 DIGITAL Registers
21/27
PISO Flip-Flop Shift Register
aParallel In Serial Out
shift register requiresadditional gates, and the parallel input must revert tologic low.
Input
D Q
Q
Input
Output
Input
D Q
Q
D Q
Q
7/28/2019 DIGITAL Registers
22/27
PIPO Flip-Flop Shift Register
a Parallel In Parallel Out register has the simplestconfiguration. It represents a memory device.
D Q
Q
Input
Output
D Q
Q
Output
D Q
Q
Output
Input Input
7/28/2019 DIGITAL Registers
23/27
7/28/2019 DIGITAL Registers
24/27
Registers 1.24
Universal Shift Registers
Look up the 74LS194 and describe its function
by looking at the schematic. Fill in the table.
S0 S1 Mode
0 0
0 1
1 0
1 1
24
l ll l f h
7/28/2019 DIGITAL Registers
25/27
Application: Parallel transferring thecontents of a Register to another register.
Describe where this
circuit combinationmay be used.
7/28/2019 DIGITAL Registers
26/27
JK Shift Registers
J-K Shift registers are seldom used, as two inputs (J,K)are required to load the first flip-flop (note all othersreceive only set or reset inputs).
Input OutputJ Q
K Q
J Q
K Q
J Q
K QInput
7/28/2019 DIGITAL Registers
27/27
Registers summary
Registers 1 27
A register is a special state machine that stores multiple
bits of data.
Several variations are possible:
Parallel loading to store data into the register.
Shifting the register contents either left or right.
Counters are considered a type of register too! One application of shift registers is converting between
serial and parallel data.
Most programs need more storage space than registersprovide.
Well introduce RAM to address this problem. Registers are a central part of modern processors, as we
will see in coming weeks.