shift register section 6.1-6.2. register a register is a group of flip-flops, each one of which is...
TRANSCRIPT
![Page 1: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/1.jpg)
Shift Register
Section 6.1-6.2
![Page 2: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/2.jpg)
Register• A register is a group of flip-flops,
each one of which is capable of storing one bit of information.
• Issues of the circuit to the right.– You do not have an option hold
the output when you don’t want to outputs updated.
4 D flip-flops=4 bits of storage=4-bit register
![Page 3: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/3.jpg)
4-bit Register with Parallel Load Control
![Page 4: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/4.jpg)
Load=“1”→Update“1”
“0”
“0”
“1”
“I0”
“I0”
I0 is fed to DFF when Load is a 1.
![Page 5: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/5.jpg)
Load=“0”→Hold!“0”
“1”
“A0”
“0”
“0”
“A0”
A0 is fed to DFF when Load is a 0. So the outputis holding!
We will revisit this ideawhen we study the universalshift register.
![Page 6: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/6.jpg)
Four-Bit Serial Shift Register
1 2 3 4
Q of DFF1 gets SI after the first rising edge of the CLKQ of DFF2 gets SI after the second rising edge of the CLKQ of DFF3 gets SI after the third rising edge of the CLKQ of DFF4 gets SI after the fourth rising edge of the CLK
![Page 7: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/7.jpg)
Linear Feedback Shift Register
1 1 0 1
Exclusive OR
![Page 8: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/8.jpg)
Content of Four-Bit Shift Register1 1 0 1
1 1 1 0
1 1 1 1
0 1 1 1
0 0 1 1
0 0 0 1
1 0 0 0
0 1 0 0
0 0 1 0
1 0 0 1
1 1 0 0
0 1 1 0
1 0 1 1
0 1 0 1
1 0 1 0
![Page 9: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/9.jpg)
Block Diagram of a Universal Shift Register
This is called the universal shift register because it has both shifts and parallel load capabilities.
![Page 10: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/10.jpg)
Functionality of the Universal Shift Register
Clear: to clear the register to 0.CLK: to synchronize the operations.{S1,S0} for mode control.A_par: register outputI_par: register inputMSB_in and LSB_in: serial inputs
![Page 11: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/11.jpg)
Detail Implementation
![Page 12: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/12.jpg)
Four-to-one-line Mux
![Page 13: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/13.jpg)
Four-to-one-line Mux
1
0
11
I2 I2
0
0
00
0
0I2
![Page 14: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/14.jpg)
Mode Control
![Page 15: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/15.jpg)
S0=0, S1=0 [No Change Mode]
S0=0, S1=0
![Page 16: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/16.jpg)
S0=1, S1=0 [Shift Right Mode]
S1=0 , S0=1
![Page 17: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/17.jpg)
S0=0, S1=1 [Shift Left Mode]
S1=1 , S0=0
![Page 18: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/18.jpg)
S0=1, S1=1 [Parallel Load Mode]
S1=1 , S0=1
![Page 19: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/19.jpg)
Breadboard Implementation
Universal shift regsiter
Random Number Generator
![Page 20: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/20.jpg)
Waveform
CLK
Random
A3
A2
A1
A0
![Page 21: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/21.jpg)
4-Bit Universal Shift Register
![Page 22: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/22.jpg)
Behavioral Vs. Structural Description
• Behavioral Description– Behavior model of a shift register• Describe the operation of the register
without a preconceived structure.
– Random number generator• Binary values of msb_in, lsb_in, i_par
• Structural Description–Models the circuits in terms of a
collection of components such as gates, flip-flops…
![Page 23: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/23.jpg)
Behavioral Model of Shift Regsiter
a_par[3] a_par[2] a_par[1] a_par[0]
![Page 24: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/24.jpg)
Test Bench
1. Generate random numberWith matlab2. Read random numberat the neg edge of the clock
Test all input combinations by flipping {S1, S0}
Read numbers to i_par[3:0],msb_in, lsb_in at the negedge of t_clock
![Page 25: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/25.jpg)
[s1,s0=[1,1], Load
i_par=0111a_par=0111
![Page 26: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/26.jpg)
[s1,s0]=[0,0], No Change
i_par=0111a_par=0011
![Page 27: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/27.jpg)
[s1,s0]=[1,0], Shift Left
1101 1011
LSB_in
![Page 28: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/28.jpg)
[s1,s0]=[0,1], Shift Right
![Page 29: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/29.jpg)
Synthesized Schematic
![Page 30: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/30.jpg)
Structural Modeling of a 4-Bit Universal Shift Register
clr
clk
select
Q
i0i1
i2i3
![Page 31: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/31.jpg)
Waveform
Load No Change Shift Right Shift Left
![Page 32: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/32.jpg)
4-bit Universal Shift Register
![Page 33: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/33.jpg)
Verilog Code of Each Stage
![Page 34: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/34.jpg)
In-Class Exercise
![Page 35: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/35.jpg)
Load=“1”→Update“1”
“0”
“0”
“1”
“I0”
“I0”
I0 is fed to DFF when Load is a 1.
![Page 36: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/36.jpg)
Load=“0”→Hold!“0”
“1”
“A0”
“0”
“0”
“A0”
A0 is fed to DFF when Load is a 0. So the outputis holding!
We will revisit this ideawhen we study the universalshift register.
![Page 37: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/37.jpg)
S0=0, S1=0 [No Change Mode]
S0=0, S1=0
![Page 38: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/38.jpg)
S0=1, S1=0 [Shift Right Mode]
S1=0 , S0=1
![Page 39: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/39.jpg)
S0=0, S1=1 [Shift Left Mode]
S1=1 , S0=0
![Page 40: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/40.jpg)
S0=1, S1=1 [Parallel Load Mode]
S1=1 , S0=1
![Page 41: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/41.jpg)
If time permits
![Page 42: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/42.jpg)
Serial Transfer Using Shift Register
Information in A is made to circulate by connecting SO to SI.
![Page 43: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/43.jpg)
![Page 44: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/44.jpg)
Parallel Transfer Versus Serial Transfer
Parallel TransferTransfer all the bit in one clock cycle.Require combinatorial circuits.
(Serial Transfer)
Take multiple clock cyclesto transfer data.
Assume n=4, each shift Register has 4 DFF.
![Page 45: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/45.jpg)
Augend, Addend & Sum
1011+1001______10100
AugendAddend
Sum
![Page 46: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/46.jpg)
Serial Adder
1
1
0
1
Feed “1” to zat the next rising edge of the CLK
Assuming a shift-right register, the left most position becomes availablefor storage after the second rising edge of the clock.
Note thatThe sum can bestored in a thirdregister.
But if you want to save shift register, you can store it in A since more and moreslots in SRA become available.
(Augend)
(Addend)
![Page 47: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/47.jpg)
Serial Adder At the end of T4
A3A2A1A0
B3B2B1B0
________________
CoS3S2S1S0
S2S1S0A3
S3
Co
D2D1D0B3
![Page 48: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/48.jpg)
Allowing the Serial Adder to Accumulate
Co
S3 S2 S1S0
D3D2D1D0
________________
Ro T3 T2 T1 T0
T2T1T0S3
T3
Ro
X2X1X0D3
![Page 49: Shift Register Section 6.1-6.2. Register A register is a group of flip-flops, each one of which is capable of storing one bit of information. Issues of](https://reader031.vdocuments.mx/reader031/viewer/2022032203/56649dd45503460f94acb8b7/html5/thumbnails/49.jpg)
Accumulate with a Shift Register
• A, B and D, each represents a 4 bit sequence.• We want to perform A+B+D• Store A in shift register A.• Store B in shift register B.• Allow the CLK to go on for a couple of cycles.• Store the sum bits of A+B in Shift A and allow
D to enter shift register B.• Allow more cycles of CLK. • Add D to A+B, and allow A+B+C to enter shift
register A.