Digital Electronics and Computer Interfacing Tim Mewes 3. Digital Electronics
Digital Electronics and Computer Interfacing2 3.7 Flip-flops A flip-flop is a digital circuit that is capable of serving as a one bit memory A flip-flop is constructed using gates So how could it possibly work? But we said that the output of a gate only depends on its inputs and not on its history?! No memory – output remains only as long as the inputs are set Somehow create a “loop” – called Feedback
Digital Electronics and Computer Interfacing Set/reset flip-flop (SR flip-flop) One possible implementation: NAND gate latch S R Q Q
Digital Electronics and Computer Interfacing Set/reset flip-flop (SR flip-flop) Reset of the flip-flop: S=1, R=0 S R Q Q ? 00 1
Digital Electronics and Computer Interfacing Set/reset flip-flop (SR flip-flop) Set of the flip-flop: S=0, R=1 S R Q Q ? 11 0
Digital Electronics and Computer Interfacing Set/reset flip-flop (SR flip-flop) What happens when we now change to: S=1, R=1 ? S R Q Q Flip-flop does not change its output ! (latch)
Digital Electronics and Computer Interfacing Set/reset flip-flop (SR flip-flop) What happens for: S=0, R=0 ? S R Q Q 0 ? ? Both outputs are 1! Q NOT(Q) !!!
Digital Electronics and Computer Interfacing Set/reset flip-flop (SR flip-flop) Summary S R Q Q Q R S invalid Timing diagram
Digital Electronics and Computer Interfacing Gated SR flip-flop Sometimes also called: Clocked SR flip-flop S’ R’ Q Q E The input E is called enable input or clock input
Digital Electronics and Computer Interfacing Gated SR flip-flop Reset of the gated SR flip-flop: S’=0, R’=1 and E=1 S’ R’ Q Q E S R This corresponds to the Reset case (S=1, R=0) of the SR flip-flop (page 4) Thus: Q=0 and Q=1 0 1
Digital Electronics and Computer Interfacing Gated SR flip-flop Set of the gated SR flip-flop: S’=1, R’=0 and E=1 S’ R’ Q Q E This corresponds to the Set case (S=0, R=1) of the SR flip-flop (page 5) Thus: Q=1 and Q=0 1 0 S R
Digital Electronics and Computer Interfacing Gated SR flip-flop What happens if we now set E=0? S’ R’ Q Q E With E=0 the flip-flop does not change its outputs! S R
Digital Electronics and Computer Interfacing Gated SR flip-flop Summary Q R’ S’ Timing diagram S’ R’R’ Q Q E E 0 1 invalid