Lecture #24 Page 1 EE 367 – Logic Design Lecture #24 Agenda 1.State Machines Review Announcements 1.n/a.

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

VHDL 5 FINITE STATE MACHINES (FSM) Some pictures are obtained from FPGA Express VHDL Reference Manual, it is accessible from the machines in the lab at.
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.
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
Sequential Circuits Storage elements
State-machine structure (Mealy)
Synchronous Sequential Logic
State Machine Design Procedure
Analysis of Clocked Sequential Circuits
Give qualifications of instructors: DAP
Registers and Counters. Register Register is built with gates, but has memory. The only type of flip-flop required in this class – the D flip-flop – Has.
CS 151 Digital Systems Design Lecture 21 Analyzing Sequential Circuits.
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
CS 151 Digital Systems Design Lecture 25 State Reduction and Assignment.
6/27/20061 Sequence Detectors Lecture Notes – Lab 5 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
6/12/20151 Sequence Detectors Lecture Notes – Lab 4 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
Give qualifications of instructors: DAP
Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design Finite State.
Spring 2002EECS150 - Lec15-seq2 Page 1 EECS150 - Digital Design Lecture 15 - Sequential Circuits II (Finite State Machines revisited) March 14, 2002 John.
CS 140L Lecture 7 Professor CK Cheng 11/12/02. Transformation between Mealy and Moore Machines Algorithm: 1) For each NS, z = S i, j create a state S.
Digital Logic Design Lecture 26. Announcements Exams will be returned on Thursday Final small quiz on Monday, 12/8. Final homework will be assigned Thursday,
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
ENGIN112 L25: State Reduction and Assignment October 31, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 25 State Reduction and Assignment.
EE 261 – Introduction to Logic Circuits
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Lecture 18 More Moore/Mealy machines.
Introduction to Sequential Logic Design Finite State-Machine Design.
Module : FSM Topic : types of FSM. Two types of FSM The instant of transition from the present to the next can be completely controlled by a clock; additionally,
Fall 2004EE 3563 Digital Systems Design EE3563 Chapter 7, 8, 10 Reading Assignments  7.1, 7.2, 7.3  8.1, ,   8.5.1, 8.5.2,
Digital Logic Design Lecture # 19 University of Tehran.
DLD Lecture 26 Finite State Machine Design Procedure.
Digital Logic Design.
Sequential Circuit: Analysis BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
Analysis and Synthesis of Synchronous Sequential Circuits A “synchronizing” pulse/edge signal (clock) controls the operation of the memory portion of the.
CEC 220 Digital Circuit Design Timing Analysis of State Machines
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Digital System Design using VHDL
CEC 220 Digital Circuit Design Mealy and Moore State Machines Friday, March 27 CEC 220 Digital Circuit Design Slide 1 of 16.
ENG241 Digital Design Week #7 Sequential Circuits (Part B)
A sequential logic circuit (a.k.a. state machine) consists of both combinational logic circuit(s) and memory devices (flip flops). The combinational circuits.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Introduction to Sequential Logic Design Finite State-Machine Analysis.
Mealy and Moore Machines Lecture 8 Overview Moore Machines Mealy Machines Sequential Circuits.
Week #7 Sequential Circuits (Part B)
Introduction to Sequential Logic Design
Introduction to Advanced Digital Design (14 Marks)
FIGURE 5.1 Block diagram of sequential circuit
Sequential Circuit: Counter
Digital Design Lecture 9
ECE 4110–5110 Digital System Design
CSCE 211: Digital Logic Design
ECE 301 – Digital Electronics
CSCE 211: Digital Logic Design
CSCE 211: Digital Logic Design
Digital Logic & Design Dr. Waseem Ikram Lecture No. 34.
CSCE 211: Digital Logic Design
ECE 3130 – Digital Electronics and Design
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Instructor: Alexander Stoytchev
The Verilog Hardware Description Language
SYEN 3330 Digital Systems Chapter 6 – Part 3 SYEN 3330 Digital Systems.
Instructor: Alexander Stoytchev
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
CSCE 211: Digital Logic Design
Lecture 14: State Tables, Diagrams, Latches, and Flip Flop
Instructor: Alexander Stoytchev
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
Presentation transcript:

Lecture #24 Page 1 EE 367 – Logic Design Lecture #24 Agenda 1.State Machines Review Announcements 1.n/a

Lecture #24 Page 2 State Machines State Machines - there is a basic structure for a Clocked, Synchronous State Machine 1) State Memory(i.e., flip-flops) 2) Next State Logic “G”(combinational logic) 3) Output Logic “F”(combinational logic) we’ll revisit F later… - if we keep this structure in mind while designing digital machines in VHDL, then it is a very straight forward task - Each of the parts of the State Machine are modeled with individual processes - let’s start by reviewing the design of a state machine using a manual method

Lecture #24 Page 3 State Machines State Machines “Mealy Outputs” – outputs depend on the Current_State and the Inputs

Lecture #24 Page 4 State Machines State Machines “Moore Outputs” – outputs depend on the Current_State only

Lecture #24 Page 5 State Machines State Machines - the steps in a state machine design are: 1) Word Description of the Problem 2) State Diagram 3) State/Output Table 4) State Variable Assignment 5) Choose Flip-Flop type 6) Construct F 7) Construct G 8) Logic Diagram

Lecture #24 Page 6 State Machines State Machine Example “Sequence Detector” 1) Design a machine by hand that takes in a serial bit stream and looks for the pattern “1011”. When the pattern is found, a signal called “Found” is asserted 2) State Diagram

Lecture #24 Page 7 State Machines State Machine Example “Sequence Detector” 3) State/Output Table Current_StateInNext_StateOut (Found) S00S00 1S10 S10S20 1S00 S20S00 1S30 S30S00 1S01

Lecture #24 Page 8 State Machines State Machine Example “Sequence Detector” 4) State Variable Assignment – let’s use binary Current_StateInNext_StateOut Q1 Q0 Q1* Q0* Found ) Choose Flip-Flop Type - 99% of the time we use D-Flip-Flops

Lecture #24 Page 9 State Machines State Machine Example “Sequence Detector” 6) Construct Next State Logic “F” Q1* = Q1’∙Q0∙In’ + Q1∙Q0’∙In Q0* = Q0’∙In Q1 Q0 In In Q Q Q1 Q0 In In Q Q0

Lecture #24 Page 10 State Machines State Machine Example “Sequence Detector” 7) Construct Output Logic “G” Found = Q1∙Q0∙In 8) Logic Diagram - for large designs, this becomes impractical Q1 Q0 In In Q Q0

Lecture #24 Page 11 State Machines in VHDL State Memory - we use a process that updates the “Current_State” with the “Next_State” - we describe DFF’s using (CLK’event and CLK=‘1’) - this will make the assignment on the rising edge of CLK STATE_MEMORY : process (CLK) begin if (CLK’event and CLK='1') then Current_State <= Next_State; end if; end process; - at this point, we need to discuss State Names

Lecture #24 Page 12 State Machines in VHDL State Memory using “User-Enumerated Data Types" - we always want to use descriptive names for our states - we can use a user-enumerated type for this type State_Type is (S0, S1, S2, S3); signal Current_State : State_Type; signal Next_State : State_Type; - this makes our simulations very readable. State Memory using “Pre-Defined Data Types" - we haven’t encoded the variables though, we can either leave it to the synthesizer or manually do it subtype State_Type is BIT_VECTOR (1 downto 0); constant S0 : State_Type := “00”; constant S1 : State_Type := “01”; constant S2 : State_Type := “10”; constant S3 : State_Type := “11”; signal Current_State : State_Type; signal Next_State : State_Type;

Lecture #24 Page 13 State Machines in VHDL State Memory with “Synchronous RESET” STATE_MEMORY : process (CLK) begin if (CLK’event and CLK='1') then if (Reset = ‘1’) then Current_State <= S0;-- name of “reset” state to go to else Current_State <= Next_State; end if; end if; end process; - this design will only observe RESET on the positive edge of clock (i.e., synchronous)

Lecture #24 Page 14 State Machines in VHDL State Memory with “Asynchronous RESET” STATE_MEMORY : process (CLK, Reset) begin if (Reset = ‘1’) then Current_State <= S0;-- name of “reset” state to go to elsif (CLK’event and CLK='1') then Current_State <= Next_State; end if; end process; - this design is sensitive to both RESET and the positive edge of clock (i.e., asynchronous)