330 likes | 992 Views
Flip-Flops. Lecture L8.2 Section 8.1. !S. Q . !Q. !R. Recall the !S-!R Latch. !S !R Q !Q. 1. 0. 0 0 0 1 1 0 1 1. 1 1 Disallowed. 1 0 Set. 0 1 Reset. 1. 1. 0 1. Store. 1 0. Q 0 !Q 0. X Y nand. 0 0 1 0 1 1 1 0 1 1 1 0.
E N D
Flip-Flops Lecture L8.2 Section 8.1
!S Q !Q !R Recall the !S-!R Latch !S !R Q !Q 1 0 0 0 0 1 1 0 1 1 1 1 Disallowed 1 0 Set 0 1 Reset 1 1 0 1 Store 1 0 Q0 !Q0 X Y nand 0 0 1 0 1 1 1 0 1 1 1 0
Edge-triggered D Flip-flop 1 1 0 1 1 0
Edge-triggered D Flip-flop 1 1 0 1 1 0 1 0
Edge-triggered D Flip-flop 1 1 0 1 1 0 0 1
Edge-triggered D Flip-flop 0 1 1 0 1 0 0 1
Edge-triggered D Flip-flop 0 0 1 1 0 1 0 1
Edge-triggered D Flip-flop 0 0 1 1 0 1 1 1
Edge-triggered D Flip-flop 1 0 1 0 1 1 1 0
Edge-triggered D Flip-flop with asynchronous preset and clear
Edge-triggered D Flip-flop with asynchronous preset and clear
D Q CLK !Q D CLK Q !Q 0 0 1 1 1 0 X 0 Q0 !Q0 D Flip-Flop Positive edge triggered D gets latched to Q on the rising edge of the clock.
Controlled inverter Each Xilinx 95108 macrocell contains a D flip-flop
Each Xilinx 95108 macrocell contains a D flip-flop Note asynchronous preset Q.AP = x x z Q.D = z y Note asynchronous reset Q.AR = y
Q0.D D Q Q0 CLK !Q !Q0 Q0.D = !Q0 Divide-by-2 Counter CLK Q0 Q0.D = !Q0
Q0.D D Q Q0 CLK !Q !Q0 Q0.D = !Q0 div2cnt.abl MODULE div2cnt TITLE 'Divide By 2 Counter' DECLARATIONS " INPUT PINS " PB PIN 70; " push-button switch (clock) " OUTPUT PINS " Q0 PIN 44 ISTYPE 'reg buffer'; " LED 16 Registered Buffer output
Q0.D D Q Q0 CLK !Q !Q0 Q0.D = !Q0 div2cnt.abl (cont’d) EQUATIONS Q0.C = PB; Q0.D = !Q0; test_vectors(PB -> Q0) .C. -> 1; .C. -> 0; .C. -> 1; .C. -> 0; .C. -> 1; .C. -> 0; END .C. means clock goes LO-HI-LO Power-on output Q0 = 0
MODULE reg1bit TITLE '1-bit register, R. Haskell, 10/13/02' DECLARATIONS hex7seg interface([D3..D0] -> [a,b,c,d,e,f,g]); d7R FUNCTIONAL_BLOCK hex7seg; " INPUT PINS " PB PIN 70; " push-button switch (clock) LOAD PIN 11; " switch S6:1 clear PIN 7; " switch S6:2 INP0 PIN 1; " switch S7:4 " OUTPUT PINS " Q0 PIN 44 ISTYPE 'reg buffer'; " LED 16 [a,b,c,d,e,f,g] PIN 15,18,23,21,19,14,17 ISTYPE 'com'; " Rightmost (units) 7-segment LED display
EQUATIONS Q0.C = PB; Q0.AR = clear; Q0.D = Q0 & !LOAD # INP0 & LOAD; [a,b,c,d,e,f,g] = d7R.[a,b,c,d,e,f,g]; d7R.D0 = Q0; d7R.[D3..D1] = [0,0,0]; test_vectors([PB,clear,LOAD,INP0] -> Q0) [.C.,1,0,1] -> 0; [.C.,0,1,1] -> 1; [.C.,0,0,0] -> 1; [.C.,0,1,0] -> 0; [.C.,0,0,1] -> 0; [.C.,0,1,1] -> 1; [.C.,0,0,0] -> 1; [.C.,0,0,1] -> 1; [.C.,0,1,0] -> 0; END
MODULE reg4bit5 INTERFACE (clk,reset,load,[IN3..IN0] -> [Q3..Q0]); TITLE '<Name 1>, <Name 2>, <Date>' DECLARATIONS " Input Pins " clk PIN ; reset PIN ; load PIN ; IN3..IN0 Pin ; INP = [IN3..IN0]; " 4-bit input data " Output Pins " Q3..Q0 PIN ISTYPE 'reg buffer'; Q = [Q3..Q0]; " 4-bit register EQUATIONS Q.c = clk; [Q2, Q0].ar = reset; [Q3, Q1].ap = reset; "reset Q = 5 Q.d = INP & load # Q & !load; END reg4bit5
J-K Flip-flops Q.D = J & !Q # !K & Q
T Flip-flops Q.D = T $ Q
MODULE Tdiv2cnt TITLE 'Divide By 2 Counter using T flip-flop' DECLARATIONS " INPUT PINS " PB PIN 70; " push-button switch (clock) " OUTPUT PINS " Q0 PIN 44 ISTYPE 'reg buffer'; " LED 16 EQUATIONS Q0.C = PB; Q0.T = 1; test_vectors(PB -> Q0) .C. -> 1; .C. -> 0; .C. -> 1; .C. -> 0; .C. -> 1; .C. -> 0; END 1