Part 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits

Similar documents
Sequential Logic - Module 5

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

Inferring Storage Elements

Field Programmable Gate Array

[VARIABLE declaration] BEGIN. sequential statements

COE 405, Term 062. Design & Modeling of Digital Systems. HW# 1 Solution. Due date: Wednesday, March. 14

Sequential Statement

Lecture 12 VHDL Synthesis

ELCT 501: Digital System Design

Lecture 4: Modeling in VHDL (Continued ) EE 3610 Digital Systems

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2016

VHDL Examples Mohamed Zaky

Sequential VHDL. Katarzyna Radecka. DSD COEN 313

The process. Sensitivity lists

ECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles

Control and Datapath 8

OUTLINE SYSTEM-ON-CHIP DESIGN. GETTING STARTED WITH VHDL September 3, 2018 GAJSKI S Y-CHART (1983) TOP-DOWN DESIGN (1)

Introduction to VHDL #3

Summary of FPGA & VHDL

Hardware Description Language VHDL (1) Introduction

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks.

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture

Concurrent & Sequential Stmts. (Review)

Test Benches - Module 8

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University

IT T35 Digital system desigm y - ii /s - iii

VHDL And Synthesis Review

EITF35: Introduction to Structured VLSI Design

APPLICATION NOTE. A CPLD VHDL Introduction. Introduction. Overview. Entity. XAPP 105 January12, 1998 (Version 1.0) 0 4* Application Note

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

Timing in synchronous systems

UNIT I Introduction to VHDL VHDL: - V -VHSIC, H - Hardware, D - Description, L Language Fundamental section of a basic VHDL code Library :

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents

JUNE, JULY 2013 Fundamentals of HDL (10EC45) PART A

ECE Digital Design Laboratory. Lecture 3 Finite State Machines!

!"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"

Introduction to VHDL. Yvonne Avilés Colaboration: Irvin Ortiz Flores Rapid System Prototyping Laboratory (RASP) University of Puerto Rico at Mayaguez

CprE 583 Reconfigurable Computing

Problem Set 10 Solutions

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

In our case Dr. Johnson is setting the best practices

CS211 Digital Systems/Lab. Introduction to VHDL. Hyotaek Shim, Computer Architecture Laboratory

VHDL: RTL Synthesis Basics. 1 of 59

EITF35: Introduction to Structured VLSI Design

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language

The University of Alabama in Huntsville ECE Department CPE Midterm Exam February 26, 2003

CS232 VHDL Lecture. Types

Getting Started with VHDL

EL 310 Hardware Description Languages Midterm

VHDL Modeling Behavior from Synthesis Perspective -Part B - EL 310 Erkay Savaş Sabancı University

VHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit

ECEU530. Homework 4 due Wednesday Oct 25. ECE U530 Digital Hardware Synthesis. VHDL for Synthesis with Xilinx. Schedule

Department of Electronics & Communication Engineering Lab Manual E-CAD Lab

Midterm Exam Thursday, October 24, :00--2:15PM (75 minutes)

Assignment 01 Computer Architecture Lab ECSE

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1. Your name 2/13/2014

VHDL for Synthesis. Course Description. Course Duration. Goals

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013

VHDL/Verilog Simulation. Testbench Design

VHDL Testbench Design. Textbook chapters 2.19, , 9.5

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

IE1204 Digital Design L7: Combinational circuits, Introduction to VHDL

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. Behavioral Design Style: Registers & Counters.

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

CS/EE Homework 7 Solutions

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 3

Multi-valued Logic. Standard Logic IEEE 1164 Type std_ulogic is ( U, uninitialized

EITF35: Introduction to Structured VLSI Design

VHDL 2 Combinational Logic Circuits. Reference: Roth/John Text: Chapter 2

Used to perform operations many times. See previous Parallel to Serial Example

SEQUENTIAL STATEMENTS

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6

Hardware Description Languages. Modeling Complex Systems

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution March 2, 2006

VHDL simulation and synthesis

ECE 545 Lecture 5. Data Flow Modeling in VHDL. George Mason University

Sequential Circuit Design: Principle

Lecture 9. VHDL, part IV. Hierarchical and parameterized design. Section 1 HIERARCHICAL DESIGN

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 6 Combinational and sequential circuits

Digital Systems Design

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques

VHDL: A Crash Course

Digital Systems Design

Nanosistemų programavimo kalbos 5 paskaita. Sekvencinių schemų projektavimas

Verilog for Synthesis Ing. Pullini Antonio

VHDL HIERARCHICAL MODELING

General Coding Style Guidelines 5

ECE 459/559 Secure & Trustworthy Computer Hardware Design

3 Designing Digital Systems with Algorithmic State Machine Charts

Quartus Counter Example. Last updated 9/6/18

EEL 4712 Digital Design Test 1 Spring Semester 2007

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

VHDL for FPGA Design. by : Mohamed Samy

Computer-Aided Digital System Design VHDL

8 Register, Multiplexer and

Chapter 8 VHDL Code Examples

CMPT 250: Computer Architecture. Using LogicWorks 5. Tutorial Part 1. Somsubhra Sharangi

ECEU530. Schedule. ECE U530 Digital Hardware Synthesis. Datapath for the Calculator (HW 5) HW 5 Datapath Entity

Transcription:

M1 Informatique / MOSIG Introduction to Modeling and erification of Digital Systems Part 4: HDL for sequential circuits Laurence PIERRE http://users-tima.imag.fr/amfors/lpierre/m1arc 2017/2018 81 Sequential circuits Memory elements! In digital circuit theory, sequential logic is a type of logic circuit whose output depends not only on the present value of its input signals but on the sequence of past inputs, the input history Wikipedia! Synchronous sequential circuit: the changes in the state of memory elements are synchronized by a (periodic) signal, the clock signal. 82 https://www.allaboutcircuits.com/textbook/digital/chpt-10/edge-triggered-latches-flip-flops/ 83

Memory elements Memory elements Data Enable Data Enable https://www.allaboutcircuits.com/textbook/digital/chpt-10/edge-triggered-latches-flip-flops/ 84 https://www.ibiblio.org/kuphaldt/electriccircuits/digital/digi_10.html 85 Memory elements Synchronous sequential circuits! Toy example (logic diagram) The D flip-flop is widely used. It captures the value of its D input on the rising edges of the clock Obtained by logic synthesis (see later) Combinational parts Flip-flops https://www.ibiblio.org/kuphaldt/electriccircuits/digital/digi_10.html 86 https://www.ee.usyd.edu.au/tutorials/digital_tutorial/part3/example1-4.htm 87

HDL HDL! The is a concurrent statement, commonly used in RTL descriptions of sequential circuits.! The is a concurrent statement, commonly used in RTL descriptions of sequential circuits. (sensitivity-list) HDL and or sequential circuits with the content of the sensitivity list with the wait statement(s) (sensitivity-list) or The "" statement combinational, sequential? with the content of the sensitivity list with the wait statement(s) 88 89 HDL Process activation! The is a concurrent statement, commonly used in RTL descriptions of sequential circuits. (sensitivity-list) or with the content of the sensitivity list with the wait statement(s)! With a sensitivity list! The sensitivity list is a list of signals. The will be reactivated and evaluated whenever the value of one of these signals changes (event)! When it is activated, the sequential statements are executed. After it has executed the last statement, the suspends again! In that case, the cannot include wait statements! With wait statement(s)! The activation of the is determined by its wait statement(s) 90 91

Wait statement Wait statement! Used to suspend the execution! The sequential statements are executed up to the first wait statement. The suspends until the activation condition holds. Then the is activated again, and the sequential statements are executed up to the next wait statement,! Syntax (each clause is optional) wait on signal-list until condition for time;! on: the suspends until a change (event) occurs on one or more of the signals! until: the suspends until the condition holds! for: timeout clause! Used to suspend the execution! The sequential statements are executed up to the first wait statement. The suspends until the activation condition holds. Then the is activated again, and the sequential statements are executed up to the next wait statement,! Syntax (each clause is optional) Example: wait on signal-list until condition for time;! on: the suspends wait until on a change A,B until (event) Enable occurs = '1'; on one or more of the signals T <= A and B after 5 ns;! until: the suspends ; until the condition holds! for: timeout clause 92 93 Combinational statement / Clocked statements! Note: combinational statements are equivalent to es.! Example: a concurrent signal assignment statement is equivalent to a that has a sensitivity list made of the signals of its right-hand side! What about flip-flop updates?! The activation condition is a clock (rising) edge! This induces a unique wait statement (as first statement of the ), that can be of the form: Output <= A or B;! Simple example of shift register entity shifter is port(clk : in std_logic; Data_in : in std_logic; Data_out : out std_logic_vector(3 downto 0); end shifter; 94 96

Clocked statements Clocked statements! What about flip-flop updates?! The activation condition is a clock (rising) edge! This induces a unique wait statement (as first statement of the ), that can be of the form wait until clk'event and clk='1';! Simple example of shift register entity shifter is port(clk : in std_logic; Data_in : in std_logic; Data_out : out std_logic_vector(3 downto 0); end shifter;! What about flip-flop updates?! The activation condition is a clock (rising) edge architecture arch1 of shifter is! This signal induces shift_reg a unique wait : std_logic_vector(3 statement (as first statement downto 0) of the ), that can be of the form := (others<='0'); wait until clk'event and clk='1';! Simple example of shift register entity shifter wait until is clk'event and clk='1'; port(clk shift_reg : in std_logic; <= shift_reg(2 downto 0) & Data_in; end Data_in ; : in std_logic; Data_out Data_out <= : shift_reg; out std_logic_vector(3 downto 0); end end shifter; arch1; 97 98 Sequential conditional statement Sequential conditional statement! The sequential conditional statement is as follows if condition 1 then statements 1 elsif condition 2 then statements 2 elsif condition 3 then statements 3 else statements N! The elsif and else clauses are optional! The conditions condition i are Boolean expressions! The statements statements i are (series of) sequential statements! The sequential conditional statement is as follows if condition 1 then statements 1 elsif condition 2 then statements 2 elsif condition 3 then statements 3 else statements Example: N! The elsif and else if clauses In1 = '0' are or optional In2 = '0' then Output <= '0' after 5 ns;! The conditions condition i are Boolean expressions elsif In1 = 'X' or In2= 'X' then! The statements statements Output i <= are 'X' (series after of) 5 sequential ns; statements else Output <= '1' after 5 ns; wait on In1, In2; 99 100

Sequential case statement Sequential case statement! The case statement is as follows case expression is when choice 1 => statements 1 when choice 2 => statements 2 when choice N => statements N end case;! The expression is of a discrete type! Each choice i can be of the form: a-choice 1 a-choice 2 a-choice 3 and the value others for choice N means otherwise! The statements statements i are (series of) sequential statements! The case statement is as follows case expression is when choice 1 => statements 1 when choice 2 => statements 2 when choice N Example: => statements N end case;! The expression is of a discrete type case X is! Each choice i can be of the when form: 1 => Output <= 0; a-choice 1 a-choicewhen 2 a-choice 2 3 => 3 Output <= 1; when others => Output <= 2; and the value others end for choice case; N means otherwise! The statements statements wait on i are X; (series of) sequential statements 101 102 Example Example! BCD code recognizer! Binary-coded decimal (BCD) is a class of binary encodings of decimal numbers where each decimal digit is represented by 4 bits! Simple implementation of a BCD code recognizer! BCD code recognizer entity BCD is port(i,clk: in std_logic; o: out std_logic); end BCD; architecture RTL of BCD is signal S1, S2, S3, S4 : std_logic := '0'; Such an initial value is only meaningful for simulation. The description wait until clk'event and clk='1'; should take into account S1 <= i; the reset signal (see later) S2 <= S1; S3 <= not S3; S4 <= (not S3 and S4) or (not S4 and S3); end RTL; 103 104

Example - Simulation Synthesis interpretation! BCD code recognizer! The testbench entity must "generate" the clock signal! Example entity testbcd is end testbcd;! Clocked statements infer flip-flops, combinational statements are interpreted as combinational blocks! Example: what are the interpretations of these pieces of HDL code? architecture Struct1 of testbcd is component BCD is port(i,clk: in std_logic; o: out std_logic); end component; signal X1,ck,Z1 : std_logic := '0'; B1: BCD port map(x1,ck,z1); ck <= not ck after 30 ns; X1 <= '0', '1' after 80 ns, '0' after 120 ns, '1' after 200 ns, '0' after 228 ns, '1' after 300 ns, '0' after 340 ns, '1' after 502 ns, '0' after 725 ns; end Struct1; wait until ck'event and ck='1'; x <= a xor y; y <= a and c; z <= y; wait until ck'event and ck='1'; x <= a xor y; y <= a and c; z <= y; 106 108 Synthesis interpretation What should I remember! A latch will be inferred when a signal is not assigned a value explicitly in all branches of a conditional statement! Example: what are the interpretations of these pieces of HDL code? (a, c, r) if (a ='1' or c='0') then x <= r xor a; (a, c, r) if (a ='1' or c='0') then x <= r xor a; else x <= r or c; 109 110