Intro to Sequential Circuits 1 ECE 352 Digital
















- Slides: 16
Intro to Sequential Circuits 1 ECE 352 Digital System Fundamentals Intro to Sequential Circuits
Definitions Intro to Sequential Circuits • • Combinational Circuit • Outputs are a function of only current circuit inputs Sequential Circuits • • Outputs are a function of not only the current circuit inputs but also what has happened in the past Example: An automated sign that shows how many parking spots are free in a parking deck by keeping track of when cars enter or leave • • 2 We don’t need to remember anything about specific cars, only how many are still in the garage! Can also think of sequential circuits as blocks of combinational logic separated by flip-flops
State Intro to Sequential Circuits • • The “state” of matter: solid, liquid, gas, plasma The “state” of a circuit: the set of values stored in its flip-flops (which represent its status) • • • Examples: • • 3 A code of 1 s and 0 s that representing everything “important” that happened since the circuit was reset A circuit’s state affects how that circuit reacts to different sets of input values The state of a washing machine includes its current cycle (wash, rinse, spin) and the time left in the cycle The state of a vending machine includes the amount of money entered (not necessarily the exact coins!)
Finite State Machine (FSM) Intro to Sequential Circuits • 4 • • A sequential circuit that has a finite number of possible states • Limited by the number of flip-flops in the circuit All practical sequential circuits are FSMs We commonly use this term to refer to machines that perform tasks rather than just store data for later retrieval (such as memory in a computer)
Synchronous Sequential Circuits Intro to Sequential Circuits • 5 • • Storage elements hold current state: a code that provides information from the past that the circuit uses in determining how to react to new input values A special signal called a clock marks the passage of time • • Synchronous: ruled by the clock (synchronized to the clock) The clock goes DIRECTLY to the flip-flops—don’t gate the clock! The clock alternates between 0 and 1 at a constant rate • • Cycle: from one rising/falling edge to the next rising/falling edge Period: the length of time of a clock cycle
Synchronous Sequential Circuits Intro to Sequential Circuits • 6 • • Once per clock cycle, the values in the storage elements are updated with the new state information • The “next state” becomes the “current state” The next state values are produced by a combinational function of the current state values and the circuit inputs The circuit outputs are produced by a combinational function of the current state and possibly the circuit inputs
Intro to Sequential Circuits Anatomy of a Simple Seq. Circuit What the state will become at the next cycle Next State Current State Circuit Output Circuit Inputs Clock 7 What the state is now in this cycle Reset
Current vs. Next State Intro to Sequential Circuits • • • Remember: FFs output their current values Next state is the set of values that will be stored into the FFs when they change state • • 8 Current state is the set of values that are stored in the FFs at a given time The inputs to the FFs that have not yet been stored into the FFs Understanding the difference between these two is very important!
State Table Intro to Sequential Circuits • • • Essentially a truth table that shows all possible combinations of current state and circuit inputs and the resulting next state and circuit outputs The equations for the next state represent combinational logic that feeds the FF inputs • • 9 Lists the next state and circuit output values for all possible current state and circuit input values aka input forming logic (IFL) The output equations may be: • • Based exclusively on the FF outputs (Moore) Based on FF outputs and circuit inputs (Mealy)
State Tables in Circuit Analysis Intro to Sequential Circuits • • • Examine the diagram and write equations for the circuit’s flip-flop inputs and circuit outputs Use those equations to fill in the state table Examine the state table (and/or equations) to see what the circuit does D=A�Q Y=Q 10 Moore: Output depends only on the current state
Intro to Sequential Circuits Waveform Example 11 “Toggle” the output if input A is 1 D=A�Q Y=Q
State Tables in Circuit Design Intro to Sequential Circuits • 12 • Fill in the desired circuit behavior in the state table for each current state / input combination Use state table to create minimized logic equations for flip-flop inputs and circuit outputs • • • Equation inputs: flip-flop outputs and circuit inputs Equation outputs: flip-flop inputs and circuit outputs The logic that determines the next state (FF inputs) and the circuit outputs is some combinational function of the current state (FF outputs) and the circuit inputs
State Tables in Circuit Design Intro to Sequential Circuits D=A Y=A�Q Y D D= A 13 Y= =A⊕Q
State Tables in Circuit Design Intro to Sequential Circuits D=A 14 Y=A�Q Detect if input’s current value is different than it was at the end of the previous cycle D=A Y=A�Q
Intro to Sequential Circuits Another FSM Example 15
Intro to Sequential Circuits 16 ECE 352 Digital System Fundamentals Intro to Sequential Circuits