[VARIABLE declaration] BEGIN. sequential statements

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

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

CprE 583 Reconfigurable Computing

Introduction to VHDL #3

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

EEL 4712 Digital Design Test 1 Spring Semester 2008

Sequential Statement

Sequential Logic - Module 5

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

Counters and Simple Design Example

Hardware Description Language VHDL (1) Introduction

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

Lattice VHDL Training

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6

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

Concurrent & Sequential Stmts. (Review)

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

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

CS/EE Homework 7 Solutions

Inferring Storage Elements

Control and Datapath 8

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

VHDL And Synthesis Review

SEQUENTIAL STATEMENTS

ELCT 501: Digital System Design

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

EEL 4712 Digital Design Test 1 Spring Semester 2007

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

Lecture 12 VHDL Synthesis

ECOM 4311 Digital Systems Design

Timing in synchronous systems

EEL 4712 Digital Design Test 2 Spring Semester 2008

Control Unit: Binary Multiplier. Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN

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

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs

VHDL in 1h. Martin Schöberl

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

Computer-Aided Digital System Design VHDL

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

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

ELE432. ADVANCED DIGITAL DESIGN HACETTEPE UNIVERSITY Designing with VHDL

8 Register, Multiplexer and

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

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

Summary of FPGA & VHDL

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

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1

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

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

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

ECE 459/559 Secure & Trustworthy Computer Hardware Design

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

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013

CSCB58 - Lab 3. Prelab /3 Part I (in-lab) /2 Part II (in-lab) /2 TOTAL /8

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

PALMiCE FPGA Probing Function User's Manual

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

Senior Project Design Review: Internal Hardware Design of a Microcontroller in VLSI

Sequential Circuit Design: Principle

EECE-4740/5740 Advanced VHDL and FPGA Design. Lecture 3 Concurrent and sequential statements

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

Contents. Chapter 9 Datapaths Page 1 of 28

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

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

Review of Digital Design with VHDL

The VHDL Hardware Description Language

CCE 3202 Advanced Digital System Design

VHDL Examples Mohamed Zaky

EL 310 Hardware Description Languages Midterm

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

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

Problem Set 10 Solutions

Using ModelSim to Simulate Logic Circuits in VHDL Designs. 1 Introduction. For Quartus II 13.0

CprE 583 Reconfigurable Computing

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

VHDL VS VERILOG.

Digital Systems Design

CCE 3202 Advanced Digital System Design

VHDL: Modeling RAM and Register Files. Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2

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

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

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

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

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

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 3

EITF35: Introduction to Structured VLSI Design

Field Programmable Gate Array

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

DESIGN AND IMPLEMENTATION OF MOD-6 SYNCHRONOUS COUNTER USING VHDL

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

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

ECE 545 Lecture 12. Datapath vs. Controller. Structure of a Typical Digital System Data Inputs. Required reading. Design of Controllers

COE Design Process Tutorial

VHDL for FPGA Design. by : Mohamed Samy

Pollard s Tutorial on Clocked Stuff in VHDL

Ripple Counters. Lecture 30 1

VHDL HIERARCHICAL MODELING

ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL. Fall 2017 Final Exam (6.00 to 8.30pm) Verilog SOLUTIONS

Transcription:

PROCESS statement (contains sequential statements) Simple signal assignment statement <= Variable assignment statement := IF-THEN-ELSE statement WAIT UNTIL statement CASE-WHEN statement FOR-LOOP and WHILE-LOOP statements Syntax: [process_label] PROCESS (sensitivity_list) [VARIABLE declaration] sequential statements END PROCESS [process_label]; Sensitivity list: When there is a change in the value of any signal in the sensitivity list, the process becomes active. Active: when a process block becomes active, the statements inside the process block are evaluated sequentially: at synthesis time (determine what circuit to build), not at run-time (not like a program running inside a microprocessor). 1

ENTITY Dflipflop IS PORT ( D, LamClk : IN STD_LOGIC ; Q : OUT STD_LOGIC) ; END Dflipflop ; ARCHITECTURE Behavior OF Dflipflop IS PROCESS ( LamClk ) IF LamClk'EVENT AND LamClk = '1' THEN Q <= D ; Figure 7.37 Code for a D flip-flop LamClk EVENT: EVENT is an attribute of the signal LamClk, which becomes TRUE when there is any change in the LamClk signal. When a condition in the form of LamClk'EVENT AND LamClk = '1' " is found in an IF statement, any signals that are assigned values inside the IF statement are implemented as the outputs of edge-triggered components (i.e., flip-flips). 2

ENTITY DFFSynchClear IS PORT ( D, Resetn, Clock : IN STD_LOGIC ; Q : OUT STD_LOGIC) ; END DFFSynchClear ; ARCHITECTURE Behavior OF DFFSynchClear IS PROCESS ( Clock ) IF Clock'EVENT AND Clock = '1' THEN IF Resetn = '0' THEN Q <= '0'; ELSE Q <= D ; END IF; D flip-flop with synchronous reset 3

ENTITY DFFaSynchClear IS PORT ( D, Resetn, Clock : IN STD_LOGIC ; Q : OUT STD_LOGIC) ; END DFFaSynchClear; ARCHITECTURE Behavior OF DFFaSynchClear IS PROCESS ( Resetn, Clock ) IF Resetn = '0' THEN Q <= '0' ; ELSIF Clock'EVENT AND Clock = '1' THEN Q <= D ; Figure 7.39 D flip-flop with asynchronous reset 4

ENTITY reg8 IS PORT ( D : IN STD_LOGIC_VECTOR(7 DOWNTO 0) ; Resetn, Clock : IN STD_LOGIC ; Q : OUT STD_LOGIC_VECTOR(7 DOWNTO 0) ) ; END reg8 ; ARCHITECTURE Behavior OF reg8 IS PROCESS ( Resetn, Clock ) IF Resetn = '0' THEN Q <= "00000000" ; ELSIF Clock'EVENT AND Clock = '1' THEN Q <= D ; Figure 7.45 Code for an eight-bit register with asynchronous clear 5

USE ieee.std_logic_unsigned.all ; ENTITY upcount IS PORT ( Clock, Resetn, E : IN STD_LOGIC ; Q : OUT STD_LOGIC_VECTOR (3 DOWNTO 0)) ; END upcount ; ARCHITECTURE Behavior OF upcount IS SIGNAL Count : STD_LOGIC_VECTOR (3 DOWNTO 0) ; PROCESS ( Clock, Resetn ) IF Resetn = '0' THEN Count <= "0000" ; ELSIF (Clock'EVENT AND Clock = '1') THEN IF E = '1' THEN Count <= Count + 1 ; ELSE Count <= Count ; Q <= Count ; Figure 7.52 Code for a four-bit up-counter 6

Understanding PROCESS block 1. Identify all outputs (Z <=.) Outside of PROCESS block Inside of PROCESS block Inside or outside of the scope of CLOCK EVENT 1. For each output signal, determine the type Combinatorial Edge-triggered flip-flop if inside the scope of clock event (for IF and WAIT UNTIL) Latch if implied memory 2. Evaluation vs. assignment The statements inside the process block are evaluated sequentially: at synthesis time (determine what circuit to build), not at run-time (not like a program running inside a microprocessor). If different values are assigned to the same output Z at different places in the PROCESS block, it will build the last circuit. Remember, the bottom line is that the PROCESS statement results in some hardware. It is not a program. 7

USE ieee.std_logic_unsigned.all ; ENTITY upcountmanyqs IS PORT ( Clock, Resetn, E : IN STD_LOGIC ; Qa,Qb,QcBefore,QcAfter, Qd,Qe,Qf : OUT STD_LOGIC_VECTOR (3 DOWNTO 0)) ; END upcountmanyqs ; ARCHITECTURE Behavior OF upcountmanyqs IS SIGNAL Count : STD_LOGIC_VECTOR (3 DOWNTO 0) ; Qa <= Count ; PROCESS ( Clock, Resetn ) Qb <= Count ; IF Resetn = '0' THEN Count <= "0000" ; ELSIF (Clock'EVENT AND Clock = '1') THEN IF E = '1' THEN QcBefore <= Count; Count <= Count + 1 ; QcAfter <= Count ; ELSE Count <= Count ; Qd <= Count ; Qe <= Count ; Qf <= Count ; 8

9

LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY flipflop IS PORT ( D, Clock : IN STD_LOGIC ; Q : OUT STD_LOGIC ) ; END flipflop ; ARCHITECTURE Behavior OF flipflop IS PROCESS WAIT UNTIL Clock'EVENT AND Clock = '1' ; Q <= D ; Figure 7.38 Code for a D flip-flop using WAIT UNTIL A PROCESS statement without a sensitivity list can use a WAIT UNTIL statement as the first statement of the process. The process will not be active until the condition in the WAIT UNTIL statement is true. If the condition is in the form (Clock'EVENT AND Clock = '1 ) is used in the WAIT UNTIL statement, any signals that are assigned values inside the entire process are implemented as the outputs of flip-flips. 10

ENTITY muxdff IS PORT ( D0, D1, Sel, Clock : IN STD_LOGIC ; Q : OUT STD_LOGIC ) ; END muxdff ; ARCHITECTURE Behavior OF muxdff IS PROCESS WAIT UNTIL Clock'EVENT AND Clock = '1' ; IF Sel = '0' THEN Q <= D0 ; ELSE Q <= D1 ; Figure 7.47 Code for a D flip-flop with a 2-to-1 multiplexer on the D input 11

ENTITY shift4 IS PORT ( R : IN STD_LOGIC_VECTOR(3 DOWNTO 0) ; L, w, Clock : IN STD_LOGIC ; Q : BUFFER STD_LOGIC_VECTOR(3 DOWNTO 0) ) ; END shift4 ; ARCHITECTURE Structure OF shift4 IS COMPONENT muxdff PORT ( D0, D1, Sel, Clock : IN STD_LOGIC ; Q : OUT STD_LOGIC ) ; END COMPONENT ; Stage3: muxdff PORT MAP ( w, R(3), L, Clock, Q(3) ) ; Stage2: muxdff PORT MAP ( Q(3), R(2), L, Clock, Q(2) ) ; Stage1: muxdff PORT MAP ( Q(2), R(1), L, Clock, Q(1) ) ; Stage0: muxdff PORT MAP ( Q(1), R(0), L, Clock, Q(0) ) ; END Structure ; Figure 7.48 Hierarchical code for a four-bit shift register 12

ENTITY shift4 IS PORT ( R : IN STD_LOGIC_VECTOR(3 DOWNTO 0) ; Clock : IN STD_LOGIC ; L, w : IN STD_LOGIC ; Q : BUFFER STD_LOGIC_VECTOR(3 DOWNTO 0) ) ; END shift4 ; ARCHITECTURE Behavior OF shift4 IS PROCESS WAIT UNTIL Clock'EVENT AND Clock = '1' ; IF L = '1' THEN Q <= R ; ELSE Q(0) <= Q(1) ; Q(1) <= Q(2); Q(2) <= Q(3) ; Q(3) <= w ; Figure 7.49 Alternative code for a shift register 13

ENTITY shift4 IS PORT ( R : IN STD_LOGIC_VECTOR(3 DOWNTO 0) ; Clock : IN STD_LOGIC ; L, w : IN STD_LOGIC ; Q : BUFFER STD_LOGIC_VECTOR(3 DOWNTO 0) ) ; END shift4 ; ARCHITECTURE Behavior OF shift4 IS PROCESS WAIT UNTIL Clock'EVENT AND Clock = '1' ; IF L = '1' THEN Q <= R ; ELSE Q(3) <= w ; Q(2) <= Q(3) ; Q(1) <= Q(2); Q(0) <= Q(1) ; Figure 7.50 Code that reverses the ordering of statements 14