Finite State Machines Discussion D8.1 Example 36.

Slides:



Advertisements
Similar presentations
Arbitrary Waveform Discussion 5.5 Example 34.
Advertisements

1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Top-level VHDL Designs
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
Multiplication Discussion Multiplier Binary Multiplication 4 x 4 Multiplier.
A Simple Microcontroller VHDL Tutorial R. E. Haskell and D. M. Hanna T6: VHDL State Machines.
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Registers VHDL Tutorial R. E. Haskell and D. M. Hanna T2: Sequential Logic Circuits.
RS-232 Port Discussion D7.1. Loop feedback RS-232 voltage levels: +5.5 V (logic 0) -5.5 V (logic 1)
Integer Square Root.
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.
Single-Cycle Instructions VHDL Tutorial R. E. Haskell and D. M. Hanna T5: VHDL ROM.
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A Register.
Structural VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T3: ALU Design.
Counters Discussion D5.3 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
Finite State Machines Discussion D7.1 Mealy and Moore Machines.
Multiplication Discussion Multiplier Binary Multiplication 4 x 4 Multiplier.
7-Segment Display DIO1 Board. Digilab2 – DIO1 Boards Four 7-segment displays A0A1A2A3.
Dr. Turki F. Al-Somani VHDL synthesis and simulation – Part 3 Microcomputer Systems Design (Embedded Systems)
Lecture L6.2 VHDL Multiply Operator (*)
Lab 2 4-Bit Adder Digilent Spartan 3 Board Lecture L2.3.
Division Lecture L6.3. Division
Finite State Machines Mano and Kime Sections 4-4, 4-5, 4-8.
Digilab 7-Segment Displays Lab 4. selyInstruction name “000”true if b = a false otherwise = “001”true if b /= a false otherwise “010”true if b < a.
7-Segment Displays Digilent Spartan 3 Board Discussion DS-4.2.
Introduction to VHDL Multiplexers Discussion D1.1.
Division Discussion D11.3. Division
Algorithmic State Machine (ASM) Charts
7-Segment Displays VHDL Tutorial R. E. Haskell and D. M. Hanna T4: Xilinx LogiBLOX.
Sequential Multiplication Lecture L6.4. Multiplication 13 x = 8Fh 1101 x
Shift Registers Discussion D5.2 Example Bit Shift Register qs(3) qs(2) qs(1) qs(0) if rising_edge(CLK) then for i in 0 to 2 loop s(i) := s(i+1);
Random-Access Memory Distributed and Block RAM Discussion D10.3 Example 41.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
1 Part V: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
Chapter 10 State Machine Design. 2 State Machine Definitions State Machine: A synchronous sequential circuit consisting of a sequential logic section.
Finite State Machines VHDL ET062G & ET063G Lecture 6 Najeem Lawal 2012.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
Main Project : Simple Processor Mini-Project : 3-bit binary counter (using 7400 series) Memory By Oluwayomi B. Adamo.
VHDL Discussion Finite State Machines
Finite state machines Modelling FSM in VHDL. Types of automata (FSM) A sequential automaton has: –Inputs –States (a finite number of states) –Outputs.
VHDL Discussion Finite State Machines IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
George Mason University Controllers for Keccak_F and AES ECE 545 Lecture 11 Addendum.
Controllers ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering Dr. Filip Cuckov.
ECE DIGITAL LOGIC LECTURE 21: FINITE STATE MACHINE Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/24/2015.
Prime Numbers Lecture L6.1 Sieve of Eratosthenes.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
Sequential statements (1) process
Finite State Machines (part 1)
Main Project : Simple Processor Mini-Project : Vending Machine Memory
Controllers for Keccak_F and AES Advanced Coding Style for Datapaths
Lecture L5.1 Mealy and Moore Machines
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Part IV: VHDL CODING.
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
VHDL (VHSIC Hardware Description Language)
A Greatest Common Divisor (GCD) Processor
Fibonacci Sequence Lecture L4.1 Lab 3.
Multiplication Discussion 11.1.
Figure 8.1. The general form of a sequential circuit.
Finite State Machines (part 1)
Fast, Asynchronous SRAM
RS-232 Port Discussion D12.1.
Finite state machines Modelling FSM in VHDL.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Presentation transcript:

Finite State Machines Discussion D8.1 Example 36

Canonical Sequential Network State Register Combinational Network x(t) s(t+1) s(t) z(t) clk init present state input next output

Mealy Machine init s(t+1) State Register C1 next C2 s(t) present z(t) clk init present state input next C2

Moore Machine init C2 z(t) s(t+1) State Register C1 next s(t) present clk init present state input next C2

VHDL Canonical Sequential Network init Combinational Network s(t+1) s(t) State Register next state present state x(t) present input process(clk, init) present output clk z(t) process(present_state, x)

VHDL Mealy Machine process(present_state, x) init s(t+1) State Register next state s(t) present state z(t) x(t) present input process(present_state, x) clk process(clk, init)

VHDL Moore Machine init C2 z(t) s(t+1) State Register C1 next s(t) present state x(t) present input process(present_state, x) process(present_state) clk process(clk, init)

Example Detect input sequence 1101 din fsm clk dout clr din dout 1 0 1 1 0 1 1 0 1 0 0 1 1 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0

Use State Diagram Detect input sequence 1101 S1 1 1 S0 S11 CLR 1 1 S1101 1 S110 1

fsm.vhd din fsm clk dout clr

fsm.vhd clr dout din

fsm.vhd clr dout din

fsm.vhd S0 S1 S11 S110 S1101 1 CLR

fsm.vhd S0 S1 S11 S110 S1101 1 CLR

fsm.vhd clr dout din

fsmx.vhd fsmx ld(0) ld(1) din fsm dout clr ld(7) btn(3) clk btn(1) bn clk_pulse btn(0) fsmx cclk mclk clkdiv

fsmx.vhd entity fsmx is port( mclk : in STD_LOGIC; sw : in STD_LOGIC_VECTOR(7 downto 0); btn : in STD_LOGIC_VECTOR(3 downto 0); ld : out STD_LOGIC_VECTOR(7 downto 0); a_to_g : out STD_LOGIC_VECTOR(6 downto 0); dp : out STD_LOGIC; an : out STD_LOGIC_VECTOR(3 downto 0) ); end fsmx;

fsmx.vhd

fsmx.vhd component clock_pulse port( inp : in std_logic; cclk : in std_logic; clr : in std_logic; outp : out std_logic); end component; signal clr, clk, cclk, bn: std_logic; signal clkdiv: std_logic_vector(23 downto 0);

fsmx.vhd bn <= btn(1) or btn(0); clr <= btn(3); U0: clk_pulse port map (inp => bn, cclk => cclk, clr =>clr, clk => clk); U1: fsm port map (clr =>clr, clk => clk, din => btn(1), dout => ld(7)); ld(0) <= BTN(0); ld(1) <= BTN(1);

Detect input sequence 1101 Moore Machine

Mealy Machine Sequence Detector Detect 1101

Mealy State Machine

-- Example 36b: Detect 1101 with Mealy machine library IEEE; use IEEE.STD_LOGIC_1164.all; entity seqdetb is port (clk: in STD_LOGIC; clr: in STD_LOGIC; din: in STD_LOGIC; dout: out STD_LOGIC); end seqdetb; architecture seqdetb of seqdetb is type state_type is (s0, s1, s2, s3); signal present_state, next_state: state_type; begin

sreg: process(clk, clr) begin if clr = '1' then present_state <= s0; elsif clk'event and clk = '1' then present_state <= next_state; end if; end process;

C1: process(present_state, din) begin case present_state is when s0 => if din = '1' then next_state <= s1; else next_state <= s0; end if; when s1 => next_state <= s2; when s2 => if din = '0' then next_state <= s3; when s3 => when others => null; end case; end process;

Note that dout is a registered output Seq2: process(clk, clr) begin if clr = '1' then dout <= '0'; elsif clk'event and clk = '1' then if present_state = s3 and din = '1' then dout <= '1'; else end if; end process; end seqdetb; Note that dout is a registered output dout

Detect input sequence 1101 Mealy Machine