DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN Sequential Circuits 1 Note Most of the figures are from your course book Sequential Circuits 2 Sequential Circuits Combinational The outputs depend only on the current input values It uses only logic gates Sequential The outputs depend on the current and past input values It uses logic gates and storage elements Example Sequential Circuits Vending machine They are referred as finite state machines since they have a finite number of states 3 Block Diagram Memory elements can store binary information Sequential Circuits This information at any given time determines the state of the circuit at that time 4 Sequential Circuit Types Synchronous The circuit behavior is determined by the signals at discrete instants of time The memory elements are affected only at discrete instants of time A clock is used for synchronization Memory elements are affected only with the arrival of a clock pulse If memory elements use clock pulses in their inputs, the circuit is called Sequential Circuits Clocked sequential circuit 5 Sequential Circuit Types ASynchronous Sequential Circuits The circuit behavior is determined by the signals at any instant of time It is also affected by the order the inputs change 6 Clock It emits a series of pulses with a precise pulse width and precise interval between consecutive pulses Timing interval between the corresponding edges of two consecutive pulses is known as the clock cycle time, or period Sequential Circuits 7 Flip-Flops They are memory elements They can store binary information Sequential Circuits 8 Flip-Flops Can keep a binary state until an input signal to switch the state is received There are different types of flip-flops depending on the number of inputs and how the inputs affect the binary state Sequential Circuits 9 Latches The most basic flip-flops They operate with signal levels The flip-flops are constructed from latches They are not useful for synchronous sequential circuits They are useful for asynchronous sequential circuits Sequential Circuits 10 SR Latch with NOR Sequential Circuits 11 SR Latch with NOR S set R reset Q 1, Q' 0 set state Q 0, Q' 1 reset state S 1, R 1 undefined, Q and Q' are set to 0 In normal conditions , avoid S 1, R 1 Sequential Circuits 12 SR Latch with NAND Sequential Circuits 13 SR Latch with NAND S set R reset Q 0, Q' 1 set state Q 1, Q' 0 reset state S 0, R 0 undefined, Q and Q' are set to 1 In normal conditions , avoid S 0, R 0 Sequential Circuits 14 SR Latch with Control Input Sequential Circuits 15 D Latch Sequential Circuits 16 Symbols for Latches Sequential Circuits 17 Note The control input changes the state of a latch or flip-flop The momentary change is called a trigger Example: D Latch Sequential Circuits It is triggered every time the pulse goes to the logic level 1 As long as the pulse remains at the logic level 1, the change in the data (D) directly affects the output (Q) THIS MAY BE A BIG PROBLEM since the state of the latch may keep changing depending on the input (may be coming from a combinational logic network) 18 How to Solve? Trigger the flip-flop only during a signal transition Sequential Circuits 19 Edge-Triggered D Flip-Flop Sequential Circuits 20 Characteristics of D FlipFlop Q(t 1) D Sequential Circuits 21 Edge-Triggered J-K Flip-Flop Q(t 1) JQ' K ' Q How??????? Sequential Circuits 22 Excitation Table Sequential Circuits 23 Edge-Triggered T Flip-Flop T Q (t 1) 0 Q (t ) 1 Q ' (t ) Sequential Circuits Q(t 1) T Q TQ'T ' Q 24 Excitation Table Sequential Circuits 25 Direct Inputs You can use asynchronous inputs to put a flip-flop to a specific state regardless of the clock You can clear the content of a flip-flop The content is changed to zero (0) This is called clear or direct reset This is particularly useful when the power is off Sequential Circuits The state of the flip-flop is set to unknown 26 D Flip-Flop with Asynchronous Reset Sequential Circuits 27 State Equations A state equation shows the next state as a function of the current state and inputs A(t 1) A(t ) x(t ) B(t ) x(t ) B(t 1) A' (t ) x(t ) y (t ) A(t ) B(t )x' (t ) A(t 1) Ax Bx B(t 1) A' x y ( A B) x' Sequential Circuits 28 State Table Sequential Circuits 29 State Diagram Sequential Circuits 30 Analysis with D Flip-Flops DA A x y A(t 1) A x y Sequential Circuits 31 State Reduction Reduce the number of states but keep the input-output requirements Reducing the number of states may reduce the number of flip-flops If there are n flip-flops, there are 2^n states If you have two circuits that produce the same output sequence for any given input sequence, the two circuits are equivalent Sequential Circuits They may replace each other 32 State Reduction Example Find the states for which the next states and outputs are the same Sequential Circuits 33 Example (Cont.) In the next state, g is replaced with e In the next state, f is replaced with d Sequential Circuits 34 Example (Cont.) Sequential Circuits 35 State Assignment You need to assign binary values for each state so that they can be implemented You need to use enough number of bits to cover all the states Sequential Circuits 36 State Assignments Sequential Circuits 37 Design Procedure Derive a state diagram Reduce the number of states Assign binary values to the states Obtain binary coded state table Choose the type of flip-flop to be used Derive simplified flip-flop input equations and output equations Draw the logic diagram Sequential Circuits 38 Example Design a circuit (with D flip-flops) that detects three or more consecutive 1’s in a string of bits coming through an input line Sequential Circuits 39 Example (Cont.) A(t 1) DA ( A, B, x) 3,5,7 B(t 1) DB ( A, B, x) 1,5,7 y ( A, B, x) 6,7 Sequential Circuits 40 Example (Cont.) Sequential Circuits 41 Example (Cont.) Sequential Circuits 42 Example Design a circuit (with JK flip-flops) that detects three or more consecutive 1’s in a string of bits coming through an input line Sequential Circuits 43 Example (Cont.) Sequential Circuits 44 Example (Cont.) Sequential Circuits 45 Example (Cont.) Sequential Circuits 46 Study Problems Course Book Chapter – 5 Problems Sequential Circuits 5–3 5–5 5–6 5–7 5 – 10 5 – 12 5 – 13 5 – 19 47 Questions Sequential Circuits 48