VHDL for Finite State Machines. Sorry – no standard way One way –Use TYPE and SIGNAL ARCHITECTURE Behavior OF two_ones_fsm IS TYPE State_type IS ( A,

Slides:



Advertisements
Similar presentations
Digital Logic with VHDL EE 230 Digital Systems Fall 2006 (10/17/2006)
Advertisements

Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
Arbitrary Waveform Discussion 5.5 Example 34.
Edge-Triggered D Flip-Flops Discussion D4.2 Example 26.
Multiplexer as a Universal Element Discussion D2.6 Example 9.
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)
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
2-to-1 Multiplexer: if Statement Discussion D2.1 Example 4.
Integer Square Root.
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.
Dr. Turki F. Al-Somani VHDL synthesis and simulation – Part 3 Microcomputer Systems Design (Embedded Systems)
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
4-to-1 Multiplexer: case Statement Discussion D2.3 Example 6.
Sequencing and Control Mano and Kime Sections 8-1 – 8-7.
Finite State Machines Discussion D8.1 Example 36.
55:035 Computer Architecture and Organization
Algorithmic State Machine (ASM) Charts
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts,
IC-UNICAMP MC 603/ Finite State Machines Mixed Style RTL Modeling Extraído da George Mason Univ. ECE 545 Lecture 5.
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.
CS/EE 3700 : Fundamentals of Digital System Design Chris J. Myers Lecture 8: Synchronous Sequential Circuits Chapter 8.
12004 MAPLDSynthesis Issues Synthesis Issues Demonstrated with a Simple Finite State Machine Using Gray Codes.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
George Mason University ECE 545 – Introduction to VHDL ECE 545 Lecture 5 Finite State Machines.
CprE / ComS 583 Reconfigurable Computing
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
Introduction to Computer Organization and Architecture Lecture 3 By Juthawut Chantharamalee wut_cha/home.htm.
George Mason University Design of Controllers Finite State Machines and Algorithmic State Machine (ASM) Charts ECE 545 Lecture 14.
1 ECE 545—Digital System Design with VHDL Lecture 6 Behavioral VHDL Coding (for Synthesis): Finite State Machines and ASMs 9/30/08.
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
George Mason University Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code ECE 448 Lecture 6.
Reaction Timer Project
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
ECE-C302 Serial Addition – A Finite State Machine 1. Serial Parity Checker 2. Decimal Serial Adder 3. Radix r Serial Adder.
4-to-1 Multiplexer: Module Instantiation Discussion D2.2 Example 5.
Digital System Projects
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
Controllers ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering Dr. Filip Cuckov.
State Machine & Timing Design
Algorithmic State Machines Sorting Signed & Unsigned Data Types
Hao Zheng Comp Sci & Eng USF CDA 4253 FPGA System Design Chapter 5 Finite State Machines.
Figure 9.1 Architecture of a Simple Computer System.
INF H131 Clock and Reset Unit (CRU) module library ieee; use ieee.std_logic_1164.all; entity cru is port ( arst : in std_logic; -- Asynch. reset.
Sequential Statements Multi-valued logic systems Bus example Case Statement Looping statement Assert statement Finite State machines.
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
1 AL and CA Lecture 13: System Design 1 2 Outline System Level Design Control Signals Controller Design.
Describing Combinational Logic Using Processes
Part IV: VHDL CODING.
CPE 528: Session #7 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
VHDL (VHSIC Hardware Description Language)
ECE 448 Lecture 13 Multipliers Timing Parameters
ECE 545 Lecture 12 Design of Controllers Finite State Machines and Algorithmic State Machine (ASM) Charts.
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
VHDL Introduction.
Figure 8.1. The general form of a sequential circuit.
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code.
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL code ECE 448 – FPGA and ASIC Design.
CprE / ComS 583 Reconfigurable Computing
Sequntial-Circuit Building Blocks
High-Low Guessing Game
4-Input Gates VHDL for Loops
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Digital Logic with VHDL
(Sequential-Circuit Building Blocks)
Presentation transcript:

VHDL for Finite State Machines

Sorry – no standard way One way –Use TYPE and SIGNAL ARCHITECTURE Behavior OF two_ones_fsm IS TYPE State_type IS ( A, B, C ) ; SIGNAL y : State_type ;

LIBRARY ieee ; USE ieee.std_logic_1164.all ; ENTITY two_ones_fsm IS PORT ( Clock : IN STD_LOGIC ; Resetn: IN STD_LOGIC ; w: IN STD_LOGIC ; z: OUT STD_LOGIC ); END two_ones_fsm; ARCHITECTURE Behavior OF two_ones_fsm IS TYPE State_type IS ( A, B, C ) ; SIGNAL y : State_type ; BEGIN PROCESS ( Resetn, Clock ) BEGIN IF Resetn = '0' THEN y <= A ; ELSIF Clock'EVENT AND Clock = '1' THEN CASE y IS WHEN A => IF w = '0' THEN y <= A ; ELSE y <= B ; END IF ; WHEN B => IF w = '0' THEN y <= A ; ELSE y <= C ; END IF ; WHEN C => IF w = '0' THEN y <= A ; ELSE y <= C ; END IF ; END CASE ; END IF ; END PROCESS ; z <= '1' WHEN y = C ELSE '0' ; END Behavior ;

ARCHITECTURE Behavior OF simple IS TYPE State_type IS (A, B, C) ; SIGNAL y_present, y_next : State_type ; BEGIN PROCESS ( w, y_present ) BEGIN CASE y_present IS WHEN A => IF w = '0' THEN y_next <= A ; ELSE y_next <= B ; END IF ; WHEN B => IF w = '0' THEN y_next <= A ; ELSE y_next <= C ; END IF ; WHEN C => IF w = '0' THEN y_next <= A ; ELSE y_next <= C ; END IF ; END CASE ; END PROCESS ; PROCESS (Clock, Resetn) BEGIN IF Resetn = '0' THEN y_present <= A ; ELSIF (Clock'EVENT AND Clock = '1') THEN y_present <= y_next ; END IF ; END PROCESS ; z <= '1' WHEN y_present = C ELSE '0' ; END Behavior ;

Simulation Edit/Insert/Insert Node or Bus –Node Finder Filter = SignalTap II: pres-synthesis List Add y.A – y.C OK, OK –Highlight all three y’s Right click on y’s and choose grouping/group Group name y, Radix Hexadecimal