Introduction to Sequential Circuits

Slides:



Advertisements
Similar presentations
ENGIN112 L23: Finite State Machine Design Procedure October 27, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 23 Finite State Machine.
Advertisements

Tutorial 2 Sequential Logic. Registers A register is basically a D Flip-Flop A D Flip Flop has 3 basic ports. D, Q, and Clock.
Digital Design - Sequential Logic Design Chapter 3 - Sequential Logic Design.
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Circuits require memory to store intermediate data
Sequential Circuit Analysis & Design Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh.
Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Chapter 3: Sequential Logic Design -- Controllers Slides to accompany the textbook Digital.
Sequential Logic Design Process A sequential circuit that controls Boolean outputs and a specific time- ordered behavior is called a controller. StepDescription.
Sequential Circuits and Finite State Machines Prof. Sin-Min Lee
Give qualifications of instructors: DAP
Overview Finite State Machines - Sequential circuits with inputs and outputs State Diagrams - An abstraction tool to visualize and analyze sequential circuits.
Basic Register Typically, we store multi-bit items
Overview Finite State Machines
1 Synchronous Sequential Circuit Design. 2 Sequential circuit design In sequential circuit design, we turn some description into a working circuit – We.
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
Chapter 3: Sequential Logic Design -- Controllers
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
Controller Design Five step controller design process.
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic CMOS logic elements Combinational logic elements and design.
Lecture 21 Overview Counters Sequential logic design.
Sequential Circuits Chapter 4 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S.
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Digital Logic Design Sequential circuits
Models of Computation: FSM Model Reading: L. Lavagno, A.S. Vincentelli and E. Sentovich, “Models of computation for Embedded System Design”
Introduction to Sequential Logic Design Finite State-Machine Design.
1 Lecture 22 Sequential Circuits Analysis. 2 Combinational vs. Sequential  Combinational Logic Circuit  Output is a function only of the present inputs.
EEE2243 Digital System Design Chapter 4: Verilog HDL (Sequential) by Muhazam Mustapha, January 2011.
Introduction to State Machine
Counters. In class excercise How to implement a “counter”, which will count as 0,3,1,4,5,7,0,3,1,…… Q2Q1Q0D2D1D
CS 352 : Computer Organization and Design University of Wisconsin-Eau Claire Dan Ernst Latches & Flip-Flops.
DLD Lecture 26 Finite State Machine Design Procedure.
Digital Design 2e Copyright © 2010 Frank Vahid 1 How To Capture Desired Behavior as FSM List states –Give meaningful names, show initial state –Optionally.
Lecture 20: Sequential Logic (5)

1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Chapter 3: Sequential Logic Design -- Controllers Slides to accompany the textbook Digital.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Digital Design - Sequential Logic Design
Week #7 Sequential Circuits (Part B)
Sequential Networks and Finite State Machines
Lecture 4. Sequential Logic #2
Homework Reading Machine Projects Labs Tokheim Chapter 9.1 – 9.6
Learning Outcome By the end of this chapter, students are expected to be able to: Design State Machine Write Verilog State Machine by Boolean Algebra and.
COMP541 Sequential Logic – 2: Finite State Machines
Sequential Circuit: Counter
Synchronous Sequential Circuit Design
Sequential Circuits Most digital systems like digital watches, digital phones, digital computers, digital traffic light controllers and so on require.
Assistant Prof. Fareena Saqib Florida Institute of Technology
Sequential Logic Design – Controllers Instructor: Dr. Hyunyoung Lee
Sequential circuit design
Lecture 13: Sequential Circuits, FSM
Hakim Weatherspoon CS 3410 Computer Science Cornell University
Sequential circuit design
CSE 370 – Winter Sequential Logic-2 - 1
Sequential circuit design
Lecture 15 Logistics Last lecture Today HW4 is due today
Lecture 16 Logistics Last lecture Today HW5 out, due next wednesday
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
State Machine Design State Machine Design Digital Electronics
Sequential Circuit Analysis & Design
Lecture 16 Logistics Last lecture Today HW5 out, due next wednesday
FLIP-FLOPS.
ECE 352 Digital System Fundamentals
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
EGR 2131 Unit 12 Synchronous Sequential Circuits
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
Finite State Machine Continued
Presentation transcript:

Introduction to Sequential Circuits 1 a 1 Sequential circuit Output depends not just on present inputs (as in combinational circuit), but on past sequence of inputs Stores bits, also known as having “state” Combinational digital circuit F b 1 a ? Sequential digital circuit F b Must know sequence of past inputs to know output Note: Slides with animation are denoted with a small red "a" near the animated items

Storing One Bit – Flip-Flops Example Requiring Bit Storage 3.2 Storing One Bit – Flip-Flops Example Requiring Bit Storage Bit Storage Blue light Call button Cancel 1 Flight attendant call button Press call: light turns on Stays on after button released Press cancel: light turns off Stays off after button released Logic gate circuit to implement this? 1. Call button pressed – light turns on Bit Storage Blue light Call button Cancel 2. Call button released – light stays on 1 a Q Call Cancel Doesn’t work. Q=1 when Call=1, but doesn’t stay 1 when Call returns to 0 Need some form of “feedback” in the circuit Bit Storage Blue light Call button Cancel 3. Cancel button pressed – light turns off a

To Design Sequential Circuits Need A way to capture desired sequential behavior A way to convert such behavior to a sequential circuit Like we had for designing combinational circuits

Capturing Sequential Circuit Behavior as FSM Outputs : x Hi Lo x=0 x=1 clk ^ Finite-State Machine (FSM) Describes desired behavior of sequential circuit Akin to Boolean equations for combinational behavior List states, and transitions among states Example: Toggle x every clock cycle Two states: “Lo” (x=0), and “Hi” (x=1) Transition from Lo to Hi, or Hi to Lo, on rising clock edge (clk^) Arrow points to initial state (when circuit first starts) Lo Hi Lo Hi Lo Hi Lo Hi cycle 1 cycle 2 cycle 3 cycle 4 clk Lo Hi state x Outputs : Depicting multi-bit or other info in a timing diagram a

FSM Example: Three Cycles High System Want 0, 1, 1, 1, 0, 1, 1, 1, ... For one clock cycle each Capture as FSM Four states: 0, first 1, second 1, third 1 Transition on rising clock edge to next state Outputs : x x=0 clk ^ x=1 clk ^ x=1 clk ^ x=1 Off On1 On2 On3 clk ^ a Off On1 On2 On3 clk x State Outputs : a

Three-Cycles High System with Button Input Four states Wait in “Off” while b is 0 (b’*clk^) When b is 1 (b*clk^), transition to On1 Sets x=1 Next two clock edges, transition to On2, then On3 So x=1 for three cycles after button pressed Inputs: b Outputs: x x=0 clk ^ Off b'*clk ^ b*clk ^ x=1 clk ^ x=1 clk ^ x=1 On1 On2 On3 Off On1 On2 On3 clk State Outputs : Inputs x b

FSM Simplification: Rising Clock Edges Implicit ff x=1 x=0 b’ clk ^ *clk b Inputs: b; Outputs: x Every edge ANDed with rising clock edge What if we wanted a transition without a rising edge We don’t consider such asynchronous FSMs – less common, and advanced topic Only consider synchronous FSMs – rising edge on every transition On2 On1 On3 Off x=1 x=0 b ’ Inputs: b; Outputs: x a Note: Transition with no associated condition thus transistions to next state on next clock cycle

FSM Capture Example: Code Detector Unlock door (u=1) only when buttons pressed in sequence: start, then red, blue, green, red Input from each button: s, r, g, b Also, output a indicates that some colored button pressed Capture as FSM List states Some transitions included s 1 Start u r Door Red Code g lock Green detector b Blue a a W ait s' u=0 s f or sta r t b utton Inputs: s , r ,g, b ,a Outputs: u Sta r t u=0 W ait f or first colored b utton a ar ab ag Red1 u=0 Blue u=0 Green u=0 ar Red2 u=1

FSM Capture Example: Code Detector Capture as FSM List states Create transitions s Start u r Door Red Code g lock a Green detector b Blue a Inputs: s , r ,g, b ,a Outputs: u W ait a u=0 s s' ar' Sta r t a' u=0 ar ab ag ar Red1 Blue Green Red2 u=0 u=0 u=0 u=1

FSM Capture Example: Code Detector Capture as FSM List states Create transitions Repeat for remaining states Refine FSM Mentally execute Works for normal sequence Check unusual cases All colored buttons pressed Door opens! Change conditions: other buttons NOT pressed also s Start u r Door Red Code g lock a Green detector b Blue a Inputs: s , r ,g, b ,a Outputs: u W ait u=0 s s' ar' ab' ag' ar' Sta r t a' u=0 ar ab ag ar Red1 Blue Green Red2 a' a' a' u=0 u=0 u=0 u=1

FSM Capture Example: Code Detector Start u r Door Red Code g lock a Green detector b Blue a

Controller Design Laser timer FSM Converting FSM to sequential circuit 3.4 Controller Design Laser timer FSM Inputs: b; Outputs: x On2 On1 On3 Off x=1 x=0 b ’ Converting FSM to sequential circuit Circuit called controller Standard controller architecture State register stores encoding of current state e.g., Off:00, On1:01, On2:10, On3:11 Combinational logic computes outputs and next state from inputs and current state Rising clock edge takes controller to next state Controller for laser timer FSM General form a

Controller Design Process Step Description Step 1: Capture behavior Capture the FSM Create an FSM that describes the desired behavior of the controller. Use state register of appropriate width and combinational logic. The logic’s inputs are the state register bits and the FSM inputs; outputs are next state bits and the FSM outputs. 2A: Set up architecture Assign unique binary number (encoding) to each state. Usually use fewest bits, assign encoding to each state by counting up in binary. 2B: Encode the states Step 2: Convert to circuit Translate FSM to truth table for combinational logic such that the logic will generate the outputs and next state signals for the given FSM. Ordering the inputs with state bits first makes the correspondence between the table and the FSM clear. 2C: Fill in the truth table 2D: Implement combinational logic Implement the combinational logic using any method.

Controller Design: Laser Timer Example Step 1: Capture the FSM Already done Step 2A: Set up architecture 2-bit state register (for 4 states) Input b, output x Next state signals n1, n0 Step 2B: Encode the states Any encoding with each state unique will work Inputs: b; Outputs: x x=0 00 b ’ O ff a b x=1 x=1 x=1 01 On1 10 On2 11 On3 Combinational logic State register s1 s0 n1 n0 x b clk FSM inputs outputs a

Controller Design: Laser Timer Example (cont) Step 2C: Fill in truth table Inputs: b; Outputs: x x=0 00 b ’ O ff a b x=1 x=1 x=1 01 On1 10 On2 11 On3

Controller Design: Laser Timer Example (cont) Step 2D: Implement combinational logic a x = s1 + s0 (note that x=1 if s1=1 or s0=1) n1 = s1’s0b’ + s1’s0b + s1s0’b’ + s1s0’b n1 = s1’s0 + s1s0’ n0 = s1’s0’b + s1s0’b’ + s1s0’b n0 = s1’s0’b + s1s0’

Controller Design: Laser Timer Example (cont) Step 2D: Implement combinational logic (cont) s0 s1 clk Combinational Logic State register b x n0 n1 a x = s1 + s0 n1 = s1’s0 + s1s0’ n0 = s1’s0’b + s1s0’

Controller Example: Sequence Generator Want generate sequence 0001, 0011, 1100, 1000, (repeat) Each value for one clock cycle Common, e.g., to create pattern in 4 lights, or control magnets of a “stepper motor” Step 2A: Set up architecture Combinational logic n0 s1 s0 n1 clk State register w x y z Step 1: Create FSM A B D wxyz=0001 wxyz=1000 wxyz=0011 wxyz=1100 C Inputs: none; Outputs: w,x,y,z A B D wxyz=0001 wxyz=1000 wxyz=0011 wxyz=1100 C Inputs: none; Outputs: w,x,y,z Step 2B: Encode states 00 01 10 11 clk State register w x y z n0 s0 s1 n1 Step 2C: Fill in truth table w = s1 x = s1s0’ y = s1’s0 z = s1’ n1 = s1 xor s0 n0 = s0’ a Step 2D: Implement combinational logic