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

Similar documents
VHDL And Synthesis Review

Sequential Logic - Module 5

Sequential Statement

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

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

SEQUENTIAL STATEMENTS

Summary of FPGA & VHDL

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

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

Inferring Storage Elements

[VARIABLE declaration] BEGIN. sequential statements

In our case Dr. Johnson is setting the best practices

Computer-Aided Digital System Design VHDL

EITF35: Introduction to Structured VLSI Design

Lecture 12 VHDL Synthesis

Concurrent & Sequential Stmts. (Review)

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

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

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

Modeling Sequential Circuits in Verilog

CprE 583 Reconfigurable Computing

EITF35: Introduction to Structured VLSI Design

Luleå University of Technology Kurskod SMD152 Datum Skrivtid

VHDL Examples Mohamed Zaky

Problem Set 10 Solutions

The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 2005 Homework #6 Solution

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

Introduction to VHDL #3

VHDL for FPGA Design. by : Mohamed Samy

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013

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

Hardware Description Languages. Modeling Complex Systems

COVER SHEET: Total: Regrade Info: 5 (14 points) 7 (15 points) Midterm 1 Spring 2012 VERSION 1 UFID:

VHDL in 1h. Martin Schöberl

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

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

Verilog for Synthesis Ing. Pullini Antonio

ELCT 501: Digital System Design

Lab # 5. Subprograms. Introduction

Note: Closed book no notes or other material allowed, no calculators or other electronic devices.

Lecture 5: State Machines, Arrays, Loops. EE 3610 Digital Systems

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

Lattice VHDL Training

VHDL: RTL Synthesis Basics. 1 of 59

Control and Datapath 8

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

310/ ICTP-INFN Advanced Tranining Course on FPGA and VHDL for Hardware Simulation and Synthesis 27 November - 22 December 2006

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1 Solutions

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

Latch Based Design (1A) Young Won Lim 2/18/15

Hardware Description Language VHDL (1) Introduction

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

General Coding Style Guidelines 5

Lecture 10 Subprograms & Overloading

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

VHDL. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning

VHDL Packages for Synthesis Base Types Standard bit types may be used Typically IEEE 1164 Std. types are used. CPE 528: Session #9

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

Counters. Counter Types. Variations. Modulo Gray Code BCD (Decimal) Decade Ring Johnson (twisted ring) LFSR

Advanced Training Course on FPGA Design and VHDL for Hardware Simulation and Synthesis. 26 October - 20 November, 2009

Sequential VHDL. Katarzyna Radecka. DSD COEN 313

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

Luleå University of Technology Kurskod SMD098 Datum Skrivtid

Test Benches - Module 8

ECE Digital Design Laboratory. Lecture 3 Finite State Machines!

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

Timing in synchronous systems

Digital Integrated Circuits

Finite State Machines (FSM) Description in VHDL. Review and Synthesis

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

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

Mridula Allani Fall Fall

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

Modeling Complex Behavior

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

Synthesis of Combinational and Sequential Circuits with Verilog

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

The block diagram representation is given below: The output equation of a 2x1 multiplexer is given below:

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

CDA 4253 FPGA System Design Op7miza7on Techniques. Hao Zheng Comp S ci & Eng Univ of South Florida

ECE 459/559 Secure & Trustworthy Computer Hardware Design

FPGA BASED SYSTEM DESIGN. Dr. Tayab Din Memon Lecture 9 & 10 : Combinational and Sequential Logic

Tutorial 4 HDL. Outline VHDL PROCESS. Modeling Combinational Logic. Structural Description Instantiation and Interconnection Hierarchy

CS232 VHDL Lecture. Types

Sign here to give permission to return your test in class, where other students might see your score:

EE434 ASIC & Digital Systems

VHDL for Modeling - Module 10

VHDL/Verilog Simulation. Testbench Design

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

VHDL VS VERILOG.

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

ECOM 4311 Digital Systems Design

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

Synthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden

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

COE 405 Design Methodology Based on VHDL

L5: Simple Sequential Circuits and Verilog

Introduction to Design Vision. Instructor: Prof. Shantanu Dutt. TA: Soumya Banerjee

Chapter 8 VHDL Code Examples

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

Transcription:

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

Sequential Statements Use Process process (sensitivity list) variable/constant declarations Sequential Statements end process; 2

Sequential Statements Process waits for 1 or more of the signals in the sensitivity list to change It executes the statements in order then waits again Sequential Assignment <signal> <= <expression>; -evaluates expression and schedules assignment to the signal at t + 3

Sequential Statements 4 What does this process do? process (A, B) C <= A and B; Not_C <= not C; end process Not_C will be erratic. Add C in the sensitivity list If you use variables, then assignment is instantaneous (e.g. variable C : std_logic := 1 comes before and variables are local to the process)

Sequential Statements 5 Sequential if-then-else if <condition> then else if needs end if elsif doesn t statements elsif <condition> then else end if statements.. statements

Q: What does this model? 6 -------------------------------------------- process(d, G) if (G='1') then Q <= D; end if; end process; --------------------------------------------

A: Transparent Latch (D Latch) 7

What is wrong with this model? 8 -------------------------------------------- process(clk) Q <= D; end process; --------------------------------------------

Flip Flop with Asynchronous Reset 9 -------------------------------------------- process(clk, rst) if rst= 1 then Q <= 0; else if clk= 1 then Q <= D; end if end process; --------------------------------------------

Flip Flop with Asynchronous Reset 10 -------------------------------------------- process(clk, rst) if rst= 1 then Q <= 0; else if clk= 1 then Q <= D; end if end process; - This creates phantom clk when reset goes to 0 - It won t synthesize --------------------------------------------

Flip Flop with Asynchronous Reset We only want to execute the clocked code if a change in clock (edge) triggered this execution: process(clk, rst) if rst= 1 then Q <= 0; else if clk event and clk= 1 then end if Q <= D; end process; - Can also use - rising_edge(clk) 11

Clocked vs. non-clock processes Non-clocked process (clock is NOT in the sensitivity list) process (sel, a, my_data) -- default all driven signals a_out <= x 00 ; data_out <= x 00 ; if (sel = 1 ) then a_out <= a; data_out <= my_data; end if; end process; Clocked process (clock is ONLY in the sensitivity list) process (clk) -- check for rising edge of the clk if(clk event and clk = 1 ) then -- initialize all driven signals during reset if(reset = 1 ) then a_out <= x 00 ; data_out <= x 00 ; else if (sel = 1 ) then a_out <= a; data_out <= my_data; end if; end if; end if; end process;

Wait Statements Wait Statements replace sensitivity list Makes process un-synthesizable Wait on <sensitivity list> Wait on A,B,C; Wait for <time expression> --Use in test bench only Wait for 5 ns Wait until <Boolean expression> Wait until A=B

2-to-1 Multiplexer when statement Example

Example Cascaded 2-to-1 Multiplexer when statement

Example 4-to-1 Multiplexer if-elsif statement If(A= 0 and B='0')then F <= I0; elsif(a= 0 and B= 1') then F <= I1; elsif(a= 1 and B= 0') then F <= I2; elsif(a= 1 and B= 1') then F <= I3; else -- (A or B are not 0 or 1) F <= 'X'; end if;

4-to-1 Multiplexer when statement Example F <= I0 when(a&b)="00" else I1 when(a&b)="01" else I2 when(a&b)="10" else I3 when(a&b)="11" else 'X';

Example 4-to-1 Multiplexer With and when statement sel <= A&B; --selected signal assignment statement with sel select F <= I0 when "00" I1 when "01" I2 when "10" I3 when "11"

Case Statements case <expression> is when <case1> => <sequential statements> when <case2> => <sequential statements> when others => <sequential statements> end case

Example 4-to-1 Multiplexer Case statement (inside process) process (A,B,I0,I1,I2,I3) variable sel:std_logic_vector(1 downto 0); sel:= A & B; --concatenate A and B case sel is when "00" => F <= I0; when "01" => F <= I1; when 10" => F <= I2; when 11" => F <= I3; when others=> F <= X ; end case; End process

CLR Rising Edge of the Clock Can also use if rising_edge(clk)) then D Flip Flop entity DFF is port (D, CLK, CLR: in std_logic; Q: out std_logic; QN: out std_logic:='1'); ---initialize Q' to '1' since bit signals are initialized to '0' by default end DFF architecture so of DFF is process (CLK,CLR) if CLR='0' then Q <='0'; QN<='1'; else if CLK'event and CLK='1' then Q <= D after 10 ns; QN <= not D after 10 ns; end if; end if; end process;