Presentation is loading. Please wait.

Presentation is loading. Please wait.

Shift Registers Lecture L8.6 Section 8.3.

Similar presentations


Presentation on theme: "Shift Registers Lecture L8.6 Section 8.3."— Presentation transcript:

1 Shift Registers Lecture L8.6 Section 8.3

2 4-Bit Shift Register

3 shift4.abl MODULE shift4 TITLE '4-bit Shift Register' DECLARATIONS
DECLARATIONS " INPUT PINS " CLK PIN 70; " push-button switch (clock) clear PIN 11; " Switch S6:1 data_in PIN 1; " Switch S7:4 " OUTPUT PINS " Q3..Q0 PIN 40,41,43,44 ISTYPE 'reg buffer'; " LED Q = [Q3..Q0]; " 4-bit output vector

4 shift4.abl (cont’d) EQUATIONS Q.AR = clear; Q.C = CLK; Q3.D = data_in;
Q.AR = clear; Q.C = CLK; Q3.D = data_in; Q2.D = Q3; Q1.D = Q2; Q0.D = Q1;

5 shift4.abl (cont’d) @radix 16;
@radix 16; test_vectors([CLK, clear, data_in] -> Q) [.C.,1,0] -> 0; [.C.,0,1] -> 8; [.C.,0,0] -> 4; [.C.,0,0] -> 2; [.C.,0,0] -> 1; [.C.,0,0] -> 0; [.C.,0,1] -> 0A; [.C.,0,0] -> 5; END

6 shift4 simulation

7 Ring Counter

8 ring4.abl MODULE ring4 TITLE '4-bit Ring Counter' DECLARATIONS
DECLARATIONS " INPUT PINS " CLK PIN 70; " push-button switch (clock) start PIN 11; " Switch S6:1 " OUTPUT PINS " Q3..Q0 PIN 40,41,43,44 ISTYPE 'reg buffer'; " LED Q = [Q3..Q0]; " 4-bit output vector Q31 = [Q3..Q1]; " upper 3 bits

9 ring4.abl (cont’d) start = 1 0 0 0 1 EQUATIONS
Q31.AR = start; " asynchronous reset Q0.AP = start; " asynchronous preset Q.C = CLK; Q3.D = Q0; Q2.D = Q3; Q1.D = Q2; Q0.D = Q1; start = 1

10 ring4.abl (cont’d) @radix 16; test_vectors([CLK, start] -> Q)
@radix 16; test_vectors([CLK, start] -> Q) [.C.,1] -> 1; [.C.,0] -> 8; [.C.,0] -> 4; [.C.,0] -> 2; [.C.,0] -> 1; END

11 ring4 simulation

12 Ring Counter

13 Johnson Counter

14 Exercise Detect input sequence 1101
din fsm clk dout clr din dout

15 Use Shift Register dout 1 1 1 din Q3 Q2 Q1 Q0 CLK D Q D Q D Q D Q CLK
1 1 din Q3 Q2 Q1 Q0 D Q D Q D Q D Q CLK !Q CLK !Q CLK !Q CLK !Q CLK

16 A Random Number Generator

17 Q3 Q2 Q1 Q0 C E F B Q3 Q2 Q1 Q0 A D


Download ppt "Shift Registers Lecture L8.6 Section 8.3."

Similar presentations


Ads by Google