EE434 ASIC & Digital Systems

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

Computer-Aided Digital System Design VHDL

Sequential Statements

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

Lattice VHDL Training

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

Introduction to VHDL

Review. LIBRARY list of library names; USE library.package.object; ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type;

Basic Language Concepts

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

VHDL Examples Mohamed Zaky

Lecture 10 Subprograms & Overloading

Digital Systems Design

Lecture 12 VHDL Synthesis

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

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

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

Sequential VHDL. Katarzyna Radecka. DSD COEN 313

VHDL for FPGA Design. by : Mohamed Samy

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

Lecture 4. VHDL Fundamentals. George Mason University

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

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

SEQUENTIAL STATEMENTS

Very High Speed Integrated Circuit Har dware Description Language

Mridula Allani Fall Fall

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

Constructing VHDL Models with CSA

Nanosistemų programavimo kalbos 4 paskaita. Nuosekliai vykdomi sakiniai

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

EEL 4712 Digital Design Test 1 Spring Semester 2007

COE 405 Behavioral Descriptions in VHDL

Introduction to VHDL #3

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

Lecture 4. VHDL Fundamentals. Required reading. Example: NAND Gate. Design Entity. Example VHDL Code. Design Entity

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

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

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

Hardware Description Language VHDL (1) Introduction

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

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

Control and Datapath 8

ECE 545 Lecture 4. Simple Testbenches. George Mason University

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

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

Elektrotechnik und Informationstechnik, Stiftungsprofessur hochparallele VLSI Systeme und Neuromikroelektronik. Oberseminar Informationstechnik

Contents. Appendix D VHDL Summary Page 1 of 23

Summary of FPGA & VHDL

EEL 4712 Digital Design Test 1 Spring Semester 2008

CprE 583 Reconfigurable Computing

In our case Dr. Johnson is setting the best practices

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

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

VHDL simulation and synthesis

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

Performance Engineering of Real-Time and Embedded Systems. Introduction to VHDL

Modeling Complex Behavior

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

Review of Digital Design with VHDL

Lab # 2. Sequential Statements

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

COVER SHEET: Total: Regrade Info: 5 (5 points) 2 (8 points) 6 (10 points) 7b (13 points) 7c (13 points) 7d (13 points)

VHDL in 1h. Martin Schöberl

Introduction to VHDL Lecture D

Hardware Description Languages. Modeling Complex Systems

Sequential Statement

Building Blocks. Entity Declaration. Entity Declaration with Generics. Architecture Body. entity entity_name is. entity register8 is

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

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

RTL Implementation. Introduction to Structured VLSI Design. Concurrent Statements and Processes. Combinational and Sequential Logic.

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

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

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

Fundamental Design Concepts. Fundamental Concepts. Modeling Domains. Basic Definitions. New terminology and overloaded use of common words

CET ECET CET 486. C. Sisterna Spring 2003

EEL 4783: Hardware/Software Co-design with FPGAs

Subprograms, Packages, and Libraries

VHDL. Chapter 7. Behavioral Modeling. Outline. Behavioral Modeling. Process Statement

Lab # 5. Subprograms. Introduction

ECE 545 Lecture 7. Advanced Testbenches. George Mason University

VHDL: RTL Synthesis Basics. 1 of 59

Concurrent & Sequential Stmts. (Review)

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University

Sequential Logic - Module 5

Quartus Counter Example. Last updated 9/6/18

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.

Exercise: how can we do?

ECE 545 Lecture 7. Modeling of Circuits with a Regular Structure. Aliases, Attributes, Packages. Mixing Design Styles. George Mason University

VHDL VS VERILOG.


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

Designing with VHDL and FPGA

COVER SHEET: Total: Regrade Info: Problem#: Points. 7 (14 points) 6 (7 points) 9 (6 points) 10 (21 points) 11 (4 points)

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

VHDL And Synthesis Review

Entity, Architecture, Ports

Announcement. VHDL in Action. Review. Statements. Process Execution with no sensitivity list. Sequential Statements

EL 310 Hardware Description Languages Midterm

Getting Started with VHDL

Transcription:

EE434 ASIC & Digital Systems VHDL Sequential Processing Spring 2016 Dae Hyun Kim daehyun@eecs.wsu.edu 1

Sequential Statements Sequential statements are executed sequentially. Format ARCHITECTURE architecture_name OF entity_name IS PROCESS ( signal names ) Sensitivity list (should include all input signals -- Sequential statements used inside the process) END architecture_name; 2

Example 2:1 MUX ARCHITECTURE vmux2_arch OF vmux2 IS PROCESS (a, b, s) IF s = 0 THEN z <= a; ELSE z <= b; END vmux2_arch; 3

Example 2:1 MUX ARCHITECTURE vmux2_arch OF vmux2 IS PROCESS (a, b, s) IF s = 0 THEN z <= a; ELSIF s = 1 THEN z <= b; ELSE z <= X ; END vmux2_arch; 4

Example If multiple assignment statements are executed for a signal, only the last one will be active. Actual assignments happen at the end of the process. ARCHITECTURE vmux2_arch OF vmux2 IS PROCESS (a, b, s) z <= a; IF s = 1 THEN z <= b; END vmux2_arch; 5

Sequential Statements IF CASE LOOP FOR WHILE EXIT WAIT 6

IF Format IF condition THEN sequential_statements; ELSIF condition THEN sequential_statements; ELSIF condition THEN sequential_statements; ELSE sequential_statements; 7

Example Example 2:1 MUX ARCHITECTURE vmux2_arch OF vmux2 IS PROCESS (a, b, s) IF s = 0 THEN z <= a; ELSIF s = 1 THEN z <= b; ELSE z <= X ; END vmux2_arch; 8

IF Example (sequential + concurrent) FA ARCHITECTURE vfa_arch OF vfa IS PROCESS (a, b, ci) IF (a = 1 ) AND (b = 1 ) THEN co <= 1 ; ELSIF (b = 1 ) AND (ci = 1 ) THEN co <= 1 ; ELSIF (a= 1 ) AND (ci = 1 ) THEN co <= 1 ; ELSE co <= 0 ; s <= a XOR b XOR ci; END vfa_arch; 9

CASE Format CASE expression IS WHEN choices => sequential_statements; WHEN choices => sequential_statements;... WHEN OTHERS => sequential_statements; END CASE; 10

CASE Example 2:1 MUX ARCHITECTURE vmux2_arch OF vmux2 IS PROCESS (a, b, s) CASE s IS WHEN 0 => z <= a; WHEN OTHERS => z <= b; END CASE; END vmux2_arch; 11

CASE Example 2:1 MUX ARCHITECTURE vmux2_arch OF vmux2 IS PROCESS (a, b, s) CASE s IS WHEN 0 => z <= a; WHEN 1 => z <= b; WHEN OTHERS => z <= X ; END CASE; END vmux2_arch; 12

CASE Example 4:1 MUX (s : std_logic_vector (1 downto 0)) ARCHITECTURE vmux4_arch OF vmux4 IS PROCESS (a, b, c, d, s) CASE s IS WHEN 00 => z <= a; WHEN 01 => z <= b; WHEN 10 => z <= c; WHEN 11 => z <= d; WHEN OTHERS => z <= X ; END CASE; 13 END vmux4_arch;

FOR Loop Format Example FOR range LOOP sequential_statements; END LOOP; FOR i IN 1 TO 10 LOOP a := i + 3; b := i * 2; d := a + b; END LOOP; FOR i IN 10 DOWNTO 1 LOOP a := i + 3; b := i * 2; d := a + b; END LOOP; Note: Loop variables (i in the above example) do not need to be explicitly declared outside the loop. 14

FOR Loop Example count # 1 s input: x std_logic_vector (2 DOWNTO 0) output : z std_logic_vector (1 DOWNTO 0) 15

FOR Loop ARCHITECTURE vc_arch OF vc IS PROCESS (x) VARIABLE sum : INTEGER; sum := 0; -- initialization FOR i IN 2 DOWNTO 0 LOOP IF x(i) = 1 THEN sum := sum + 1; END LOOP; IF ( sum = 0 ) THEN z <= 00 ; ELSIF ( sum = 1 ) THEN z <= 01 ; ELSIF ( sum = 2 ) THEN z <= 10 ; ELSE z <= 11 ; END vc_arch; 16

WHILE Loop Format WHILE condition LOOP sequential_statements; END LOOP; Example WHILE ( a <= b ) LOOP a := a + 3; b := b 2; c := a + b; END LOOP; 17

Count # 1 s WHILE Loop ARCHITECTURE vc_arch OF vc IS PROCESS (x) VARIABLE tmp, sum : INTEGER; tmp := 0; -- initialization sum := 0; WHILE ( tmp < 3 ) LOOP IF x(tmp) = 1 THEN sum := sum + 1; tmp := tmp + 1; END LOOP; IF ( sum = 0 ) THEN z <= 00 ; ELSIF ( sum = 1 ) THEN z <= 01 ; ELSIF ( sum = 2 ) THEN z <= 10 ; ELSE z <= 11 ; END vc_arch; 18

Loop (How to Skip) If Next; is used, all the statements below the next statement will be skipped and the for loop go back to the first line of the loop. Example FOR i IN 1 TO 10 LOOP IF ( i /= 8 ) THEN a := i + 3; b := i * 2; d := a + b; END LOOP; FOR i IN 1 TO 10 LOOP IF ( i = 8 ) THEN NEXT; a := i + 3; b := i * 2; d := a + b; END LOOP; 19

Loop (How to Exit) If Exit; is used, we immediately exit from the loop. Example FOR i IN 1 TO 10 LOOP IF ( i = 8 ) THEN NEXT; ELSIF ( ( i + a ) = 9 ) THEN EXIT; a := i + 3; b := i * 2; d := a + b; END LOOP; 20

PROCESS If a process has a sensitivity list, the process is held at the beginning of the process until any of the signals in the sensitivity list changes. If a process does not have a sensitivity list, the process is executed infinitely. PROCESS (a, b, s) IF s = 0 THEN z <= a; ELSIF s = 1 THEN z <= b; ELSE z <= X ; 21

WAIT WAIT FOR time_expression The process is held at the WAIT statement for the time specified by the expression. Example PROCESS... WAIT FOR time_expression;... PROCESS... WAIT FOR 10 NS;... WAIT FOR ( a + b );... 22

WAIT WAIT UNTIL condition The process is held at the WAIT statement until the condition is satisfied. Example PROCESS... WAIT UNTIL condition;... PROCESS... WAIT UNTIL rising_edge (clock);... 23

WAIT WAIT ON signals The process is held at the WAIT statement until one of the signals changes. Example PROCESS... WAIT ON clk, reset;... PROCESS IF reset = 1 THEN Q <= 0 ; ELSIF clk = 1 THEN Q <= D; WAIT ON clk, reset; 24

Sensitivity List vs. WAIT PROCESS ( clock ) PROCESS WAIT ON clock; Why should we put the WAIT ON statement at the end of the process? All processes are executed at least once. To guarantee that the process having a wait statement is exactly the same as the sensitivity-list-based process, we need a wait statement at the end of the process. 25

Signals vs. Variables Signal assignment t1 <= a AND b; Scheduled as an event for signal t1. Variable assignment v1 := a AND b; Happens immediately (no delay). Variables can be used only in a PROCEESS or a SUBPROGRAM. 26

Example ARCHITECTURE and2beh OF and2 IS SIGNAL t1 : BIT; PROCESS ( a, b ) t1 <= a AND b; IF (t1 = 1 ) THEN z <= t1 AFTER 5 NS; ELSIF (t1 = 0 ) THEN z <= t1 AFTER 4 NS; ELSE z <= t1 AFTER 6 NS; END and2beh; This is wrong. ARCHITECTURE and2beh OF and2 IS PROCESS ( a, b ) VARIABLE t1 : BIT; t1 := a AND b; IF (t1 = 1 ) THEN z <= t1 AFTER 5 NS; ELSIF (t1 = 0 ) THEN z <= t1 AFTER 4 NS; ELSE z <= t1 AFTER 6 NS; END and2beh; This is correct. 27