29/10/58 1 Copyright  1997, KJH Introduction to VHDL Lecture 3 Prof. K. J. Hintz Department of Electrical and Computer Engineering George Mason University.

Slides:



Advertisements
Similar presentations
Control Structures Any mechanism that departs from straight-line execution: –Selection: if-statements –Multiway-selection: case statements –Unbounded iteration:
Advertisements

Sequential Statements
Sequential Statements Module F3.2. Sequential Statements Statements executed sequentially within a process If Statements Case Statements Loop Statements.
Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.
Sistemas Digitais I LESI - 2º ano Lesson 5 - VHDL U NIVERSIDADE DO M INHO E SCOLA DE E NGENHARIA Prof. João Miguel Fernandes Dept.
ECE C03 Lecture 121 Lecture 12 Introduction to VHDL Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
SubprogramsSubprograms. SubprogramsSubprograms ä Similar to subprograms found in other languages ä Allow repeatedly used code to be referenced multiple.
Topics of Lecture Structural Model Procedures Functions Overloading.
CSCI 660 EEGN-CSCI 660 Introduction to VLSI Design Lecture 3 Khurram Kazi Some of the slides were taken from K Gaj ’ s lecture slides from GMU ’ s VHDL.
Topics Entity DeclarationsEntity Declarations Port ClausePort Clause Component DeclarationComponent Declaration Configuration DeclarationConfiguration.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
HDL-Based Digital Design Part I: Introduction to VHDL (I) Dr. Yingtao Jiang Department Electrical and Computer Engineering University of Nevada Las Vegas.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
Loops Repetition Statements. Repetition statements allow us to execute a statement multiple times Often they are referred to as loops Like conditional.
Simple Testbenches Behavioral Modeling of Combinational Logic
Lecture Review (If-else Statement) if-else statement has the following syntax: if ( condition ) { statement1; } else { statement2; } The condition.
Package with 4-valued logic Signal Attributes Assertion Data Flow description.
ECE122 L9: While loops March 1, 2007 ECE 122 Engineering Problem Solving with Java Lecture 9 While Loops.
CSM-Java Programming-I Spring,2005 Control Flow Lesson - 3.
Reconfigurable Computing - VHDL – Types & Statements John Morris The University of Auckland Iolanthe on the Hauraki Gulf.
Introduction to VHDL (part 2)
Data Flow Modeling of Combinational Logic Simple Testbenches
Fac of Ene & Surveying U.S.Q.1 E0001 Computers in Engineering DO.... LOOP.
Introduction to VHDL Arab Academy for Science, Technology & Maritime Transport Computer Engineering Department Magdy Saeb, Ph.D.
CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #17 – Introduction.
PL/SQL Loops. Building Logical Conditions All logical conditions must yield a boolean condition. You can build a simple Boolean condition by combining.
7/10/2007DSD,USIT,GGSIPU1 Basic concept of Sequential Design.
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
Chapter 8 Chapter 8 Control Structures. Control Structures  A control structure is a control statement and the statements whose execution it controls.
Saeed Ghanbartehrani Summer 2015 Lecture Notes #5: Programming Structures IE 212: Computational Methods for Industrial Engineering.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
1 ECE 545 – Introduction to VHDL Dataflow Modeling of Combinational Logic Simple Testbenches ECE 656. Lecture 2.
Bordoloi and Bock Control Structures: Iterative Control.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
IAY 0600 Digital Systems Design VHDL discussion Verification: Testbenches Alexander Sudnitson Tallinn University of Technology.
Mixed Style RTL Modeling
Sequential statements. If statement [if_label:] if boolean_expression then {sequential_statement} {elsif boolean_expression then {sequential_statement}}
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
George Mason University Simple Testbenches ECE 545 Lecture 4.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
© 조준동 2008 ECE C03 Lecture 121 Lecture 12 Introduction to VHDL Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Coding for Synthesis ECE 448 Lecture 12.
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
55:032 - Intro. to Digital DesignPage 1 VHDL and Processes Defining Sequential Circuit Behavior.
Sequential Statements Multi-valued logic systems Bus example Case Statement Looping statement Assert statement Finite State machines.
Case Study: Xilinx Synthesis Tool (XST). Arrays & Records 2.
Dataflow modelling Lecture 4. Dataflow modelling Specifies the functioning of a circuit without explicitly refer to its structure Functioning is described.
EGRE 6311 LHO 04 - Subprograms, Packages, and Libraries EGRE 631 1/26/09.
Lecture #12 Page 1 ECE 4110– Digital Logic Design Lecture #12 Agenda 1.VHDL : Behavioral Design (Processes) Announcements 1.n/a.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
ECE 4110–5110 Digital System Design
Introduction To VHDL 홍 원 의.
Chapter 4 Repetition Statements (loops)
Timing Model Start Simulation Delay Update Signals Execute Processes
Sequential Design.
JavaScript: Control Statements.
ECE 448 Lab 1a Developing Effective Testbenches
ECE 434 Advanced Digital System L08
Outline Altering flow of control Boolean expressions
Sequential Statements
IAS 0600 Digital Systems Design
Signals - Drivers Value holder for a signal.
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
IAS 0600 Digital Systems Design
ICT Programming Lesson 3:
CprE / ComS 583 Reconfigurable Computing
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

29/10/58 1 Copyright  1997, KJH Introduction to VHDL Lecture 3 Prof. K. J. Hintz Department of Electrical and Computer Engineering George Mason University

29/10/58 2 Copyright  1997, KJH Sequential Statements  If Statements  Case Statements  Null Statements  Loop Statements  Assertion & Report Statements

29/10/58 3 Copyright  1997, KJH If Statements

29/10/58 4 Copyright  1997, KJH If Statement Example entity NiCadCharger is port ( Voltage, Current : in real ; AC : in bit ; Charged, Recharge : out bit ); end entity NiCadCharger ;

29/10/58 5 Copyright  1997, KJH If Statement Example architecture ChargerArch1 of NiCadCharger is begin Charger_A: process (Voltage, Current, AC ) is begin if Voltage >= 9.6 then Charged <= ‘1’; Recharge <= ‘0’; elseif (AC = ‘1’ and Current < 0.5 then Charged <= ‘0’; Recharge <= ‘1’; else Charged <= ‘0’; Recharge <= ‘0’; end process Charger_A ; end architecture ChargerArch1 ;

29/10/58 6 Copyright  1997, KJH Case Statements

29/10/58 7 Copyright  1997, KJH Choices in Case Statements  Locally Static, Determined During Analysis Phase  Exactly One Choice for Each Possible Value of Selector Expression  More than one choice can be listed for each “when”  Case Specification Alternatives  Enumerate specific value(s)  Discrete Range  Subtype  others  Keyword Which Precedes the Alternative to Be Used If All Other Case Alternatives Fail

29/10/58 8 Copyright  1997, KJH Case Statement Example entity Multiplexer is port ( MuxSelect : in subtype MuxType is positive range 0 to 3; In_0, In_1, In_2, In_3: in bit ; MuxOut: out bit ); end entity Multiplexer ;

29/10/58 9 Copyright  1997, KJH Case Statement Example 4_to_1_MUX : case MuxSelect is when 0 => MuxOut <= In_0 ; when 1 => MuxOut <= In_1 ; when 2 => MuxOut <= In_2 ; when 3 => MuxOut <= In_3 ; end case 4_to_1_MUX ;

29/10/58 10 Copyright  1997, KJH Null Statements

29/10/58 11 Copyright  1997, KJH Loop Statements  Used for Repeated Execution of Sequential Statements  Alternatives  Infinite  Single or multi-phase clock  Whole system turned on  Exit on condition  Inner & Outer Loops  Next  While  For

29/10/58 12 Copyright  1997, KJH Loop Statement Syntax

29/10/58 13 Copyright  1997, KJH Infinite Loop Example entity 2_Phase_Clock is port (Clk: in bit ; Phase_1, Phase_2: out bit ); end entity 2_Phase_Clock ;

29/10/58 14 Copyright  1997, KJH Infinite Loop Example architecture 2PC of 2_Phase_Clock begin variable P1 : bit ; loop wait until Clk = ‘1’ if P1 = ‘0’ then Phase_1 <= ‘0’; Phase_2 <= ‘1’; P1 := ‘1’; else Phase_1 <= ‘1’; Phase_2 <= ‘0’; P1 := ‘0’; end if ; end loop 2PC; end architecture 2PC ;

29/10/58 15 Copyright  1997, KJH Exit on Condition variable String_Length : positive:= 0 ; constant String_Max : positive:= 80 ; StringFill:loop wait until Char_In; String_Length := String_Length + 1; exit when String_Length = String_Max ; end loop StringFill ;

29/10/58 16 Copyright  1997, KJH Inner & Outer Loops for Row_Index in 1 to Row_Max Outer_Loop: loop Inner_Loop: loop exit Outer_Loop when Pixel_In = EOF ; New_Image ( Row_index, Col_Index ) := Pixel_In ; end loop Inner_Loop ; end loop OuterLoop ;

29/10/58 17 Copyright  1997, KJH Next Loops  The ‘next’ statement terminates execution of the current iteration and starts the subsequent iteration  If There Is a Loop Label the Statement Applies to That Loop  If There Is No Loop Label, the Statement Applies to the Inner-Most Enclosing Loop

29/10/58 18 Copyright  1997, KJH In/Out Loops, Next Example loop_1: loop loop_2: loop something; next loop_1 when String_Length = 0 ; more_something; end loop loop_2; end loop loop_1;

29/10/58 19 Copyright  1997, KJH While  The Loop Only Executes, and Continues to Execute, If the Boolean Expression Evaluates to True, and Continues to Be Evaluated As True. while String_Length <= String_Max String1: loop String_Length := String_Length + 1 ; end loop String1: ;

29/10/58 20 Copyright  1997, KJH For Loops  The Loop Variable Is of Type Constant and Hence It Cannot Be Modified Within the Loop  The Loop Variable Is a Strictly Local Constant for String_Index in 1 to String_Max String_Reverse : loop My_String( String_Index ) := Buffer (String_Max - String_Index + 1); end loop String_Reverse ;

29/10/58 21 Copyright  1997, KJH Assertion & Report Statements

29/10/58 22 Copyright  1997, KJH Assertion Statements  Expression Must Evaluate to String  Uses  Simulation  notify user when statement is executed  optionally print report expression  optionally print severity e.g., (note, warning, error, failure)  determine whether to continue  Synthesis: value in assertion statement is assumed and circuit optimized on that value  Verification: determine that the assertation statement is true for all possible values based on all possible routes to the statement

29/10/58 23 Copyright  1997, KJH Report Statement

29/10/58 24 Copyright  1997, KJH HW 2-11 LIBRARY ieee; USE ieee.std_logic_1164.all; PACKAGE Clock_2_11_pkg IS COMPONENT Clock_2_11 --GENERIC ( ); PORT ( ClockOut : out bit := '0'); END COMPONENT; END Clock_2_11_pkg;

29/10/58 25 Copyright  1997, KJH HW 2-11 ENTITY Clock_2_11 IS --GENERIC ( ); PORT ( ClockOut : out bit := '0' ); END Clock_2_11;

29/10/58 26 Copyright  1997, KJH HW 2-11 ARCHITECTURE KJH_Clock OF Clock_2_11 IS BEGIN clock_gen: PROCESS BEGIN ClockOut <= '1'; WAIT FOR 10 ns; Clockout <= '0'; WAIT FOR 10 ns; END PROCESS clock_gen ; END KJH_Clock;