Sequential Statements

Similar documents
Nanosistemų programavimo kalbos 4 paskaita. Nuosekliai vykdomi sakiniai

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

Outline. Concurrent Signal Assignment Statements. 2. Simple signal assignment statement. 1. Combinational vs. sequential circuit

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

Introduction to VHDL #3

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

EE434 ASIC & Digital Systems

Digital Systems Design

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

Outline. Combinational Circuit Design: Practice. Sharing. 2. Operator sharing. An example 0.55 um standard-cell CMOS implementation

Combinational Circuit Design: Practice

Digital Systems Design

Digital Systems Design

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 3

Parallel- and sequential data processing

Sequential VHDL. Katarzyna Radecka. DSD COEN 313

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

VHDL for FPGA Design. by : Mohamed Samy

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

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

Hardware Description Languages. Modeling Complex Systems

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 3

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

Computer-Aided Digital System Design VHDL

EEL 4783: Hardware/Software Co-design with FPGAs

VHDL for Synthesis. Course Description. Course Duration. Goals

Lab # 2. Sequential Statements

Hardware Modeling. VHDL Architectures. Vienna University of Technology Department of Computer Engineering ECS Group

8 Register, Multiplexer and

EITF35: Introduction to Structured VLSI Design

Overview. Ram vs Register. Register File. Introduction to Structured VLSI Design. Recap Operator Sharing FSMD Counters.

CSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\

General Coding Style Guidelines 5

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

2/14/2016. Hardware Synthesis. Midia Reshadi. CE Department. Entities, Architectures, and Coding.

Design units can NOT be split across different files

Basic Language Constructs of VHDL

! ISP (circa 1977) - research project at CMU " Simulation, but no synthesis

Chapter 6 Combinational-Circuit Building Blocks

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

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

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

Hardware Description Language VHDL (1) Introduction

EECS150 - Digital Design Lecture 4 - Verilog Introduction. Outline

Simple Behavioral Model: the always block

VHDL simulation and synthesis

Lecture 4. VHDL Fundamentals. George Mason University

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

VHDL: RTL Synthesis Basics. 1 of 59

Speaker: Kayting Adviser: Prof. An-Yeu Wu Date: 2009/11/23

SEQUENTIAL STATEMENTS

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

VHDL And Synthesis Review

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

Introduction to VHDL

HIERARCHICAL DESIGN. RTL Hardware Design by P. Chu. Chapter 13 1

Outline HIERARCHICAL DESIGN. 1. Introduction. Benefits of hierarchical design

4. VHDL Describes Behaviour

Lattice VHDL Training

Chapter 2 Basic Logic Circuits and VHDL Description

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

EEL 4712 Digital Design Test 1 Spring Semester 2008

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

The process. Sensitivity lists

CprE 583 Reconfigurable Computing

Lecture 12 VHDL Synthesis

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

VHDL Sequential Statements. Cristian Sisterna

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

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

Hardware Description Languages: Verilog. Quick History of HDLs. Verilog/VHDL. Design Methodology. Verilog Introduction. Verilog.

ENGIN 241 Digital Systems with Lab

Hardware Description Languages: Verilog

C-Based Hardware Design

Very High Speed Integrated Circuit Har dware Description Language

Control and Datapath 8

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

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

CCE 3202 Advanced Digital System Design

EEL 4712 Digital Design Test 1 Spring Semester 2007

VHDL: Concurrent Coding vs. Sequen7al Coding. 1

Digitaalsüsteemide disain

Control Structures. Outline. In Text: Chapter 8. Control structures Selection. Iteration. Gotos Guarded statements. One-way Two-way Multi-way

קורס VHDL for High Performance. VHDL

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

This Lecture. Some components (useful for the homework) Verilog HDL (will continue next lecture)

Contents. Appendix D VHDL Summary Page 1 of 23

IE1204 Digital Design L7: Combinational circuits, Introduction to VHDL

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

EE6301 DIGITAL LOGIC CIRCUITS UNIT V VHDL PART A

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

Modeling Complex Behavior

Chapter 7. - FORTRAN I control statements were based directly on IBM 704 hardware

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

Mridula Allani Fall Fall

ECOM 4311 Digital System Design using VHDL. Chapter 7

structure syntax different levels of abstraction

Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

Chapter 4. Combinational Logic

What Is VHDL? VHSIC (Very High Speed Integrated Circuit) Hardware Description Language IEEE 1076 standard (1987, 1993)

Transcription:

Sequential Statements Chapter 5 1

Outline 1. VHDL process 2. Sequential signal assignment statement 3. Variable assignment statement 4. If statement 5. Case statement 6. Simple for loop statement Chapter 5 2

1. VHDL Process Contains a set of sequential statements to be executed sequentially The whole process is a concurrent statement Can be interpreted as a circuit part enclosed inside of a black box May or may not be able to be mapped to physical hardware Chapter 5 3

Two types of process A process with a sensitivity list A process with wait statement Chapter 5 4

A process with a sensitivity list Syntax process(sensitivity_list) declarations; begin sequential statement; sequential statement;... end process; Chapter 5 5

A process is like a circuit part, which can be active (known activated) inactive (known as suspended). A process is activated when a signal in the sensitivity list changes its value Its statements will be executed sequentially until the end of the process Chapter 5 6

E.g, 3-input and circuit signal a,b,c,y: std_logic; process(a,b,c) begin y <= a and b and c; end process; How to interpret this: process(a) begin y <= a and b and c; end process; For a combinational circuit, all input should be included in the sensitivity list Chapter 5 7

A process with wait statement Process has no sensitivity list Process continues the execution until a wait statement is reached and then suspended Forms of wait statement: wait on signals; wait until boolean_expression; wait for time_expression; Chapter 5 8

E.g, 3-input and circuit process begin y <= a and b and c; wait on a, b, c; end process; A process can has multiple wait statements Process with sensitivity list is preferred for synthesis Chapter 5 9

2. Sequential signal assignment Syntax statement signal_name <= value_expression; Syntax is identical to the simple concurrent signal assignment Caution: Inside a process, a signal can be assigned multiple times, but only the last assignment takes effect Chapter 5 10

E.g., process(a,b,c,d) begin -- y entry := y y <= a or c; -- y exit := a or c; y <= a and b; -- y exit := a and b; y <= c and d; -- y exit := c and d; end process; -- y <= y exit It is same as process(a,b,c,d) begin y <= c and d; end process; What happens if the 3 statements are concurrent statements? Chapter 5 11

3. Varible assignment statement Syntax variable_name := value_expression; Assignment takes effect immediately No time dimension (i.e., no delay) Behave like variables in C Difficult to map to hardware (depending on context) Chapter 5 12

E.g., process(a,b,c) variable tmp: std_logic; begin tmp := '0'; tmp := tmp or a; tmp := tmp or b; y <= tmp; end process; Chapter 5 13

interpretation: process(a,b,c) variable tmp0, tmp1, tmp2: std_logic; begin tmp0 := '0'; tmp1 := tmp0 or a; tmp2 := tmp1 or b; y <= tmp2; end process; Chapter 5 14

What happens if signal is used? process(a,b,c,tmp) begin -- tmp entry := tmp tmp <= '0'; -- tmp exit := 0 ; tmp <= tmp or a; -- tmp exit := tmp entry or a; tmp <= tmp or b; -- tmp exit := tmp entry or b; end process; -- tmp <= tmp exit Same as: process(a,b,c,tmp) begin tmp <= tmp or b; end process; Chapter 5 15

4. IF statement Syntax Examples Comparison to conditional signal assignment Incomplete branch and incomplete signal assignment Conceptual Implementation Chapter 5 16

Syntax if boolean_expr_1 then sequential_statements; elsif boolean_expr_2 then sequential_statements; elsif boolean_expr_3 then sequential_statements;... else sequential_statements; end if; Chapter 5 17

E.g., 4-to-1 mux Chapter 5 18

E.g., 2-to-2 2 binary decoder Chapter 5 19

E.g., 4-to-2 priority encoder Chapter 5 20

Comparison to conditional signal assignment Two statements are the same if there is only one output signal in if statement If statement is more flexible Sequential statements can be used in then, elsif and else branches: Multiple statements Nested if statements Chapter 5 21

Chapter 5 22

e.g., find the max of a, b, c Chapter 5 23

e.g., 2 conditional sig assignment codes Chapter 5 24

2 conditional sig assign implementations Chapter 5 25

e.g., sharing boolean condition Chapter 5 26

Chapter 5 27

Incomplete branch and incomplete signal assignment According to VHDL definition: Only the then branch is required; elsif and else branches are optional Signals do not need to be assigned in all branch When a signal is unassigned due to omission, it keeps the previous value (implying memory ) Chapter 5 28

Incomplete branch E.g., It implies Chapter 5 29

fix Chapter 5 30

Incomplete signal assignment E.g., Chapter 5 31

Fix #1: Fix #2 Chapter 5 32

Conceptual implementation Same as conditional signal assignment statement if the if statement consists of One output signal One sequential signal assignment in each branch Multiple sequential statements can be constructed recursively Chapter 5 33

e.g. Chapter 5 34

e.g. Chapter 5 35

Chapter 5 36

5. Case statement Syntax Examples Comparison to selected signal assignment statement Incomplete signal assignment Conceptual Implementation Chapter 5 37

Syntax case case_expression is when choice_1 => sequential statements; when choice_2 => sequential statements;... when choice_n => sequential statements; end case; Chapter 5 38

E.g., 4-to-1 mux Chapter 5 39

E.g., 2-to-2 2 binary decoder Chapter 5 40

E.g., 4-to-2 priority encoder Chapter 5 41

Comparison to selected signal assignment Two statements are the same if there is only one output signal in case statement Case statement is more flexible Sequential statements can be used in choice branches Chapter 5 42

Chapter 5 43

Incomplete signal assignment According to VHDL definition: Signals do not need to be assigned in all choice branch When a signal is unassigned, it keeps the previous value (implying memory ) Chapter 5 44

Incomplete signal assignment E.g., Chapter 5 45

Fix #1: Chapter 5 46

Fix #2: Chapter 5 47

Conceptual implementation Same as selected signal assignment statement if the case statement consists of One output signal One sequential signal assignment in each branch Multiple sequential statements can be constructed recursively Chapter 5 48

e.g. Chapter 5 49

Chapter 5 50

6. Simple for loop statement Syntax Examples Conceptual Implementation Chapter 5 51

VHDL provides a variety of loop constructs Only a restricted form of loop can be synthesized Syntax of simple for loop: for index in loop_range loop sequential statements; end loop; loop_range must be static Index assumes value of loop_range from left to right Chapter 5 52

E.g., bit-wide xor Chapter 5 53

E.g., reduced-xor Chapter 5 54

Conceptual implementation Unroll the loop For loop should be treated as shorthand for repetitive statements E.g., bit-wise xor Chapter 5 55

E.g., reduced-xor Chapter 5 56

Synthesis of sequential statements Concurrent statements Modeled after hardware Have clear, direct mapping to physical structures Sequential statements Intended to describe behavior Flexible and versatile Can be difficult to be realized in hardware Can be easily abused Chapter 5 57

Think hardware Designing hardware is not converting a C program to a VHDL program Chapter 5 58