Designing State Machines Lecture L9.2 Handout Section 9.2.

Slides:



Advertisements
Similar presentations
Implementation Strategies
Advertisements

Modulo-N Counters Module M10.4 Section 7.2.
Sequential Circuits Storage elements
Demultiplexers Module M6.4 Section 6.4. Demultiplexers YIN 1 x 4 DeMUX d0d1 Y0 Y1 Y2 Y3 Y0 Y1 Y2 Y3 d1d0 0 0 YIN YIN YIN
State-machine structure (Mealy)
Shift Registers Module M11.1 Section 7.3.
7-Segment Displays Lecture L6.1 Section 6.3. Turning on an LED.
Table 7.1 Verilog Operators.
Analysis of Clocked Sequential Circuits
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
//HDL Example 6-1 // //Behavioral description of //Universal shift register // Fig. 6-7 and Table 6-3 module shftreg.
1 EE121 John Wakerly Lecture #10 Some shift-register stuff Sequential-circuit analysis.
Binary Counters Module M10.3 Section 7.2. Counters 3-Bit Up Counter 3-Bit Down Counter Up-Down Counter.
Sequential Design Part II. Output A(t+1) =D A = AX + BX B(t+1) =D B = AX Y = AX + BX.
Using State Machines as Control Circuits Lecture L9.4.
Multiplexers Lecture L6.4 Section 6.4.
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.
Arbitrary Waveforms Lecture L8.5 Section 7.2. CLK DQ !Q CLK DQ !Q CLK DQ !Q Q0Q0.D Q1 Q2 Q1.D Q2.D s s s s3 0 1.
Counters as State Machines Lecture L9.1 Handout Section 9.1.
Designing State Machines SQRT controller Lecture L9.2a Section 9.2.
Equality Detector Lecture L6.1 Section 6.1. Equality Detector XNOR X Y Z Z = !(X $ Y) X Y Z
Flip-Flops Module M10.2 Section 7.1. D Latch Q !Q CLK D !S !R S R X 0 Q 0 !Q 0 D CLK Q !Q Note that Q follows D when the clock in high, and.
Binary Counters Lecture L8.3 Section 8.2. Counters 3-Bit Up Counter 3-Bit Down Counter Up-Down Counter.
Modulo-N Counters Lecture L8.4 Section 7.2. Counters Modulo-5 Counter 3-Bit Down Counter with Load and Timeout Modulo-N Down Counter.
Finite State Machines Discussion D7.1 Mealy and Moore Machines.
Logic Design Review – 3 Basic Sequential Circuits Lecture L14.3 Verilog.
Arbitrary Waveforms Module M10.5 Section 7.2. CLK DQ !Q CLK DQ !Q CLK DQ !Q Q0Q0.D Q1 Q2 Q1.D Q2.D s s s s3 0 1.
Give qualifications of instructors: DAP
Pulse-Width Modulated DAC Lecture 11.3 Section 11.5.
Multiplexers Module M6.1 Section 6.4. Multiplexers A 4-to-1 MUX TTL Multiplexer A 2-to-1 MUX.
Shifters Lecture L7.4 Section 7.4. MODULE shift TITLE 'shifter' DECLARATIONS " INPUT PINS " D3..D0 PIN 11,7,6,5; D = [D3..D0]; s2..s0 PIN 3,2,1; S.
Finite State Machines Mano and Kime Sections 4-4, 4-5, 4-8.
Flip-Flops Lecture L8.2 Section 8.1. Recall the !S-!R Latch !S !R Q !Q !S !R Q !Q X Y nand 1 0 Set 1 0.
Arithmetic Logic Unit (ALU) Lecture L9.3 Lab 10. ALU CB = carry_borrow flag Z = zero flag (Z = 1 if Y = 0)
Shift Registers Lecture L6.6 Section Bit Shift Register.
Finite State Machines Discussion D8.1 Example 36.
Equality Detector Lecture L6.3 Section 6.1. Equality Detector XNOR X Y Z Z = !(X $ Y) X Y Z
7-Segment Displays Module M7.2 Section 6.5. Turning on an LED Common Anode.
Flip-Flops Lecture L8.2 Section 7.1 – Book Sect. 8.1– Handout.
Sequential Logic in Verilog
ECE 331 – Digital Systems Design Sequential Logic Circuits: FSM Design (Lecture #20)
State Machines.
Review of Digital Logic Design Concepts OR: What I Need to Know from Digital Logic Design (EEL3705)
Traffic Lights Discussion D8.3a. Recall Divide-by-8 Counter Use Q2, Q1, Q0 as inputs to a combinational circuit to produce an arbitrary waveform. s0 0.
EE121 John Wakerly Lecture #11
DLD Lecture 26 Finite State Machine Design Procedure.
A Greatest Common Divisor (GCD) Processor Lecture L10.3 Sections 10.4, 10.5.
Sequential Circuit: Analysis BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
Registers; State Machines Analysis Section 7-1 Section 5-4.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL State Machines Anselmo Lastra.
1 State Reduction Goal: reduce the number of states while keeping the external input-output requirements unchanged. State reduction example: a: input 0.
Digital Electronics.
EE121 John Wakerly Lecture #9
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Cpe 252: Computer Organization1 Lo’ai Tawalbeh Lecture #3 Flip-Flops, Registers, Shift registers, Counters, Memory 3/3/2005.
Mealy and Moore Machines Lecture 8 Overview Moore Machines Mealy Machines Sequential Circuits.
Digital Logic & Design Dr. Waseem Ikram Lecture No. 35.
Lecture L5.1 Mealy and Moore Machines
FIGURE 5.1 Block diagram of sequential circuit
Counters as State Machines
Digital Logic & Design Dr. Waseem Ikram Lecture No. 34.
Using a State Machine to Design a Sequence Detector
Shift Registers Lecture L8.6 Section 8.3.
ECE 3130 – Digital Electronics and Design
CS 140 Lecture 16 Professor CK Cheng 11/21/02.
COE 202 Introduction to Verilog
Digital Logic & Design Dr. Waseem Ikram Lecture No. 36.
The Verilog Hardware Description Language
CSE 370 – Winter Sequential Logic-2 - 1
Implementation Strategies
Presentation transcript:

Designing State Machines Lecture L9.2 Handout Section 9.2

Sequence Detectors Mealy and Moore Machines A Sequence Detector using D Flip-flops Detecting Sequences using State Machines –Moore machine –Mealy machine

A canonical sequential network

A Mealy state machine

A Moore state machine

Sequence Detector using a Shift Register Detecting 1101 using a shift register

More General: Use State Diagram Detect input sequence 1101 S0 0 S1 0 S11 0 S110 0 S CLR

Moore Machine Sequence Detector allowing repetition counted as two

Moore Machine Sequence Detector Accepting or success state

MODULE seqdetmo TITLE 'Moore Machine Sequence Detector for 1101' DECLARATIONS " INPUT PINS " Clk PIN 74; " push-button S1:T2 (clock) DataIn PIN 54;" push-button S4:T6 Clear PIN 70;" push-button S2:T4 " OUTPUT PINS " Q2..Q0 PIN 41,43,44 ISTYPE 'reg buffer'; " LED Q = [Q2..Q0]; " 3-bit state vector Z PIN 35 ISTYPE 'com'; " LED 9 seqdetmo.abl Note: Combinational output

" Definitions QSTATE = [Q2, Q1, Q0]; s0 = [0, 0, 0]; s1 = [0, 0, 1]; s2 = [0, 1, 0]; s3 = [0, 1, 1]; s4 = [1, 0, 0]; state_diagram QSTATE state s0: if DataIn then s1 else s0; state s1:if DataIn then s2 else s0; state s2:if !DataIn then s3 else s2; state s3:if DataIn then s4 else s0; state s4: if DataIn then s2 else s0; seqdetmo.abl (cont.)

EQUATIONS WHEN QSTATE == s4 then Z = 1; ELSE Z = 0; Q.C = Clk; Q.AR = Clear; test_vectors([Clk,Clear,DataIn] -> [Q,Z]) [.C.,1,0] -> [0,0]; [.C.,0,1] -> [1,0]; [.C.,0,1] -> [2,0]; [.C.,0,0] -> [3,0]; [.C.,0,1] -> [4,1]; [.C.,0,1] -> [2,0]; [.C.,0,0] -> [3,0]; [.C.,0,1] -> [4,1]; [.C.,0,1] -> [2,0]; [.C.,0,0] -> [3,0]; [.C.,0,0] -> [0,0]; END Double equal sign for comparison Single equal sign for assigments seqdetmo.abl (cont.)

Sequence Detectors Moore machine: Output is a function of only the state -- 5 states Mealy machine: Output is a function of the state and the input -- 4 states output

Mealy Machine Note: Output changes when input changes

Mealy Machine Note: Registered output z(t) implied with := assignment Z := 1

MODULE seqdetmr TITLE 'Mealy Machine Sequence Detector for Reg output' DECLARATIONS " INPUT PINS " Clk PIN 74; " push-button S1:T2 (clock) DataIn PIN 54;" push-button S4:T6 Clear PIN 70;" push-button S2:T4 " OUTPUT PINS " Q1..Q0 PIN 43,44 ISTYPE 'reg buffer'; " LED Q = [Q1..Q0]; " 2-bit state vector Z PIN 35 ISTYPE 'reg'; " LED 9 seqdetmr.abl Note that Z is now a reg output

" Definitions QSTATE = [Q1, Q0]; s0 = [0, 0]; s1 = [0, 1]; s2 = [1, 0]; s3 = [1, 1]; state_diagram QSTATE state s0: if DataIn then s1 else s0; state s1:if DataIn then s2 else s0; state s2:if !DataIn then s3 else s2; state s3:if DataIn then s1 with Z := 1 else s0; seqdetmr.abl (cont.) Implies registered output with := assignment Default is Z := 0

EQUATIONS Q.C = Clk; Q.AR = Clear; Z.C = Clk; Z.AR = Clear; test_vectors([Clk,Clear,DataIn] -> [Q,Z]) [.C.,1,0] -> [0,0]; [.C.,0,1] -> [1,0]; [.C.,0,1] -> [2,0]; [.C.,0,0] -> [3,0]; [.C.,0,1] -> [1,1]; [.C.,0,1] -> [2,0]; [.C.,0,0] -> [3,0]; [.C.,0,1] -> [1,1]; [.C.,0,1] -> [2,0]; [.C.,0,0] -> [3,0]; [.C.,0,0] -> [0,0]; END seqdetmr.abl (cont.) Z must be connected to a Clock since it is sequential