Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi

Slides:



Advertisements
Similar presentations
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
Advertisements

ECE C03 Lecture 131 Lecture 13 VHDL Structural Modeling Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
LECTURE 4: The VHDL N-bit Adder
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Mridula Allani Fall 2010 (Refer to the comments if required) ELEC Fall 2010, Nov 21(Adopted from Profs. Nelson and Stroud)
VHDL ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Sequential Statements Module F3.2. Sequential Statements Statements executed sequentially within a process If Statements Case Statements Loop Statements.
Discussed in class and on Fridays n FSMs (only synchronous, with asynchronous reset) –Moore –Mealy –Rabin-Scott n Generalized register: –With D FFs, –With.
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A Register.
Week 6.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 6 VHDL Programming [Adapted from Dave Patterson’s UCB CS152.
ECE C03 Lecture 18ECE C03 Lecture 61 Lecture 18 VHDL Modeling of Sequential Machines Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
ECE C03 Lecture 141 Lecture 14 VHDL Modeling of Sequential Machines Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
© Dr. Alaaeldin Amin 1 Behavioral Modeling in VHDL Dr. Alaaeldin Amin.
VHDL Asutosh Kar Asst. Prof. in IIIT, Bhubaneswar.
Introduction to VHDL (part 2)
CONCORDIA 1 In this mode such as process clause, the assignments are carried out sequentially. This means that the assignments are executed in order of.
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
1 H ardware D escription L anguages Modeling Complex Systems.
Fall 09, Aug 19 ELEC / Lecture 2 (from Prof. Nelson's and Prof. Stroud's course material) 1 ELEC / Computer Architecture.
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 5: Modeling Structure.
7/10/2007DSD,USIT,GGSIPU1 Basic concept of Sequential Design.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
L16 – VHDL for State Machines with binary encoding.
1/26 VHDL VHDL Structural Modeling Digital Logic.
2-Jun-16EE5141 Chapter 3 ä The concept of the signal ä Process concurrency ä Delta time ä Concurrent and sequential statements ä Process activation by.
Copyright(c) 1996 W. B. Ligon III1 Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
Design Methodology Based on VHDL Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Discussed in class and on Fridays n FSMs (only synchronous, with asynchronous reset) –Moore –Mealy –Rabin-Scott n Generalized register: –With D FFs, –With.
Generate Statement A generate statement provides a mechanism for iterative or conditional elaboration of a portion of description. The iterative elaboration.
M. Balakrishnan Dept of Computer Science & Engg. I.I.T. Delhi
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
Advanced topics Lecture 7. Outline 7.1. Resolution functions 7.2. Guarded signals. Disconnection 7.3. GENERATE statement.
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
Relational Operators Result is boolean: greater than (>) less than (=) less than or equal to (
55:032 - Intro. to Digital DesignPage 1 VHDL and Processes Defining Sequential Circuit Behavior.
VHDL Tutorial.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Dataflow modelling Lecture 4. Dataflow modelling Specifies the functioning of a circuit without explicitly refer to its structure Functioning is described.
Joal 2006 HT:1 Em3 Digital Electronics Design 1 Lecture 3-4 Sequential VHDLChap 4.
Data Flow and Behavioral Modeling in VHDL 1 MS EMBEDDED SYSTEMS.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Sequential statements (1) process
Combinational logic circuit
Introduction To VHDL 홍 원 의.
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Part IV: VHDL CODING.
Some VHDL Details 10/8/08 ECE Lecture 8.
Chapter 2. Introduction To VHDL
Sequential Design.
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
VHDL VHSIC Hardware Description Language VHSIC
Sequential Statements
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
ELEC 5200/6200 Computer Architecture and Design Review of VHDL
The continuation of a grand tour of the language.
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
VHDL Programming (08 Marks)
Modeling Complex Behavior
The continuation of a grand tour of the language.
Sequntial-Circuit Building Blocks
Digital Design with VHDL
EEL4712 Digital Design (Midterm 1 Review).
Presentation transcript:

Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi

Concurrent Statements Concurrent Signal Assignment Component Instantiation Statement Generate Statement Process Statement Block Statement Concurrent Procedure Call Statement Concurrent Assert Statement

Generate Statement Useful for Modeling Iterative Hardware label: generation_scheme GENERATE BEGIN concurrent statements END GENERATE ; generation_scheme ::= FOR identifier IN range | IF condition

4 bit Ripple Carry Adder (Entity) ENTITY RCA4 IS PORT(a, b: IN BIT_VECTOR(3 DOWNTO 0); cin: IN BIT; z: OUT BIT_VECTOR(3 DOWNTO 0); cout: OUT BIT); END RCA4;

4 bit Ripple Carry Adder (Arch.) ARCHITECTURE iterative OF RCA4 IS SIGNAL cm: BIT_VECTOR(0 TO 3); BEGIN g_main: FOR k IN 0 TO 3 GENERATE g_first: IF k = 0 GENERATE c0: FA PORT MAP (a(k),b(k), cin, z(k), cm(k)); END GENERATE; g_other: IF k > 0 GENERATE co: FA PORT MAP (a(k), b(k), cm(k-1), z(k), cm(k)); END GENERATE; cout <= cm(3); END iterative;

4 bit Ripple Carry Adder (Another) ARCHITECTURE regular OF RCA4 IS SIGNAL cm: BIT_VECTOR(0 TO 4); BEGIN cm(0) <= cin; g_main: FOR k IN 0 TO 3 GENERATE co: FA PORT MAP (a(k), b(k), cm(k), z(k), cm(k+1)); END GENERATE; cout <= cm(4); END regular;

Process Statement PROCESS [ (sensitivity_list) ] [ process_declarative_part ] BEGIN sequential statements END PROCESS ;

Sequential Statements Signal Assignment Statement Variable Assignment Statement IF Statement Case Statement Loop Statement Wait Statement Procedure Call Statement

Sequential Statements (cont.) Next Statement Exit Statement Return Statement Assertion Statement Report Statement Null Statement

Process Example 1 -- an infinite process PROCESS BEGIN x <= ‘ 0 ’, a AFTER 10 ns, b AFTER 35 ns; y <= a AND b AFTER 15 ns; END PROCESS;

Process Example 2 PROCESS (a, b) BEGIN x <= ‘ 0 ’, a AFTER 10 ns, b AFTER 35 ns; y <= a AND b AFTER 15 ns; END PROCESS; -- x <= ‘ 0 ’, a AFTER 10 ns, b AFTER 35 ns; -- y <= a AND b AFTER 15 ns;

Assignment Statements Signal Assignment Statement: target <= waveform ; Variable Assignment Statement: target := expression ;

Process Example 3 PROCESS (a, b) VARIABLE v : INTEGER := 10; BEGIN v := v + a * b; v := 2 * v; c <= v; END PROCESS;

Positive Edge Triggered D-FF PROCESS (clk) BEGIN IF (clk ’ EVENT AND clk = ‘ 1 ’ ) q <= d; END IF; END PROCESS; q_bar <= NOT q;

IF Statement IF condition THEN sequential statements { ELSIF condition THEN sequential statements } [ ELSE sequential statements ] END IF ;

D-FF w/ Asynchronous Set & Reset PROCESS (clk, set, reset) BEGIN IF reset = ‘ 1 ’ THEN d <= ‘ 0 ’ ; ELSIF set = ‘ 1 ’ THEN d <= ‘ 1 ’ ; ELSIF clk ’ EVENT AND clk = ‘ 1 ’ THEN q <= d; END IF; END PROCESS; q_bar <= NOT q;

VHDL Signal Attributes Signal Attributes –‘ EVENT:valueboolean –‘ STABLE [ (time) ]signalboolean –‘ TRANSACTIONsignalbit –‘ LAST_EVENTvaluetime –‘ LAST_VALUEvaluesame type –‘ DELAYED [ (time) ]signalsame type – …

VHDL Array Attributes Array Attributes: –‘ LEFT:left bound –‘ RIGHT:right bound –‘ LENGTH:length –‘ RANGE:range –‘ REVERSE_RANGE:reverse range – …

Register (Entity) ENTITY Reg IS PORT (d: IN BIT_VECTOR; clk, reset: IN BIT; q: OUT BIT_VECTOR); END Reg;

Register (Architecture) ARCHITECTURE general OF Reg IS BEGIN PROCESS(clk, reset) VARIABLE state : BIT_VECTOR(d'RANGE); BEGIN IF (reset = '1') THENstate := (OTHERS => '0'); ELSIF (clk'EVENT AND clk = '0') THEN state := d; END IF; q <= state; END PROCESS; END general;

Aggregate & Concatenation SIGNAL a, b : BIT_VECTOR(3 DOWNTO 0) a <= (b(0), '1', '0', '1'); a '0', 3 => b(0), OTHERS=>'1'); a <= b(0) & b(3 DOWNTO 1);

Case Statement CASE expression IS case_statement_alternative { case_statement_alternative } END CASE ; case_statement_alternative ::= WHEN choices => sequential statements

Mux 4:1 ARCHITECTURE behavioral OF Mux4x1 IS BEGIN PROCESS (a, sel) BEGIN CASE sel IS WHEN “ 00 ” => z <= a(0); WHEN “ 10 ” => z <= a(1); WHEN “ 01 ” => z <= a(2); WHEN “ 11 ” => z <= a(3); -- WHEN OTHERS => z <= a(3); END CASE; END PROCESS; END behavioral;

Loop Statement Iteration_scheme LOOP sequential statements END LOOP; iteration_scheme ::= WHILE condition | FOR identifier IN range

Binary to Integer PROCESS (bin_sig) VARIABLE k: INTEGER := 0; BEGIN k := 0; FOR cnt IN bin_sig ’ RANGE LOOP k := 2*k; IF bin_sig(cnt) = ‘ 1 ’ THEN k := k + 1; END IF; END LOOP; int_sig <= k; END PROCESS;

Integer to Binary PROCESS (int_sig) VARIABLE bin: BIT_VECTOR(bin_sig ’ RANGE); VARIABLE int, k: INTEGER; BEGIN bin := (OTHERS => ‘ 0 ’ ); int := int_sig; k := 0; WHILE int /= 0 LOOP IF int REM 2 = 1 THEN bin(k) := ‘ 1 ’ ; END IF; int := int MOD 2; k := k + 1; END LOOP; bin_sig <= bin; END PROCESS;

Wait Statement WAIT [sensitivity_clause] [condition_clause] [timeout_clause] ; sensitivity_clause ::= ON sensitivity_list condition_clause ::= UNTIL condition timeout_clause ::= FOR time_expression

Wait Examples WAIT;-- wait forever WAIT FOR 0 ns;-- wait a delat time WAIT FOR 10 us; WAIT ON a, b, c; WAIT UNTIL a_sig AND b_var = ‘ 1 ’ ; WAIT ON a_sig UNTIL a_sig AND b_var = ‘ 1 ’ ;