Copyright © 1997 Altera Corporation www.FPGA.com.cn & www.PLD.com.cn 提供 What is VHDL Very high speed integrated Hardware Description Language (VHDL) –is.

Slides:



Advertisements
Similar presentations
1 Lecture 13 VHDL 3/16/09. 2 VHDL VHDL is a hardware description language. The behavior of a digital system can be described (specified) by writing a.
Advertisements

History TTL-logic PAL (Programmable Array Logic)
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
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.
Introduction to VHDL Multiplexers. Introduction to VHDL VHDL is an acronym for VHSIC (Very High Speed Integrated Circuit) Hardware Description Language.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
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.
VHDL And Synthesis Review. VHDL In Detail Things that we will look at: –Port and Types –Arithmetic Operators –Design styles for Synthesis.
Simple Testbenches Behavioral Modeling of Combinational Logic
Introduction to VHDL (part 2)
An Introduction to VHDL Using Altera’s Quartus II IDE Dr. William M. Jones Coastal Carolina University Numbers and Bytes Meeting 20 OCT 2008.
Synthesis Presented by: Ms. Sangeeta L. Mahaddalkar ME(Microelectronics) Sem II Subject: Subject:ASIC Design and FPGA.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
ENG2410 Digital Design LAB #6 LAB #6 Sequential Logic Design (Flip Flops)
ENG241 Digital Design Week #8 Registers and Counters.
Basic Overview of VHDL Matthew Murach Slides Available at:
Copyright © 1997 Altera Corporation 6/5/2016 P.1 AHDL Training Class Danny Mok Altera HK FAE
Copyright © 1997 Altera Corporation 11/20/2015 P.1 Beginner VHDL Training Class Danny Mok Altera HK FAE
Copyright © 1997 Altera Corporation & 提供 Beginner VHDL Training Class Danny Mok Altera HK FAE
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
Lecture 7 Chap 9: Registers Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Digital System Projects
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
CS/EE 3700 : Fundamentals of Digital System Design
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
5-1 Logic System Design I VHDL Design Principles ECGR2181 Reading: Chapter 5.0, 5.1, 5.3 port ( I: in STD_LOGIC_VECTOR (1 to 9); EVEN, ODD: out STD_LOGIC.
EE121 John Wakerly Lecture #17
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
1 ASIC 120: Digital Systems and Standard-Cell ASIC Design Tutorial 2: Introduction to VHDL February 1, 2006.
VHDL 7: use of signals v.5a1 VHDL 7 Use of signals In processes and concurrent statements.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Data Flow and Behavioral Modeling in VHDL 1 MS EMBEDDED SYSTEMS.
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
An Introduction to V.H.D.L.. Need of a Compiler… main( ) { int x=10,y=20,z; z = x + y ; printf ( “ %d “, z ); getch( ) ; } What’s That ? Give me only.
Sequential statements (1) process
Combinational logic circuit
LAB #6 Sequential Logic Design (Flip Flops, Shift Registers)
Describing Combinational Logic Using Processes
B e h a v i o r a l to R T L Coding
Part II A workshop by Dr. Junaid Ahmed Zubairi
Introduction to Programmable Logic
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Part IV: VHDL CODING.
In processes and concurrent statements
Sequential-Circuit Building Blocks
Field Programmable Gate Array
Field Programmable Gate Array
Field Programmable Gate Array
ECE 434 Advanced Digital System L08
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
Hardware Description Languages
Instructions to get MAX PLUS running
VHDL (VHSIC Hardware Description Language)
VHDL Introduction.
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL code ECE 448 – FPGA and ASIC Design.
Sequntial-Circuit Building Blocks
(Sequential-Circuit Building Blocks)
EEL4712 Digital Design (Midterm 1 Review).
Presentation transcript:

Copyright © 1997 Altera Corporation & 提供 What is VHDL Very high speed integrated Hardware Description Language (VHDL) –is an industry standard hardware description language –description the hardware in language instead of graphic easy to modify easy to maintain –very good for complex combinational logic –BCD to 7 Segment converter –address decoding state machine more than you want……..

Copyright © 1997 Altera Corporation & 提供 How to use the VHDL use any text editor to create the file –Altera Software Max+Plus II provides text editor click at this icon

Copyright © 1997 Altera Corporation & 提供 VHDL Template I forgot ……. If-then-else case-end case loop-end loop ??…??? Modify the code as user want

Copyright © 1997 Altera Corporation & 提供 General VHDL Format ENTITY test IS PORT ( input_pin_name : IN bit; output_pin_name : OUT bit); END test; ARCHITECTURE test_body OF test IS BEGIN output_pin_name <= input_pin_name; END test_body; Key WordVHDL Format Logic This two must be the same I/O port define section Logic Behaviour define section Must be the same as the save TEST.VHD file

Copyright © 1997 Altera Corporation & 提供 Your First VHDL design -- 2 input AND gate Entity simand is Port ( a, b : in bit; c : out bit); end simand; architecture simand_body of simand is begin c <= a and b; end simand_body;

Copyright © 1997 Altera Corporation & 提供 Learning VHDL must learn What is Combinatorial Logic What is Sequential Logic What is Concurrent Statement What is Process Statement

Copyright © 1997 Altera Corporation & 提供 Concurrent Statement All the Concurrent Statement is executed in parallel Concurrent Statement does not care the position within the coding Concurrent Statement is : OUTPUT depends on INPUT only Entity test1 Is Port ( a, b : in bit; c, d : out bit); end test1; architecture test1_body of test1 is begin c <= a and b; d <= a or b; end test1_body; Entity test1 Is Port ( a, b : in bit; c, d : out bit); end test1; architecture test1_body of test1 is begin d <= a or b; c <= a and b; end test1_body; This two excute in parallel Does not care the position within the coding Output depends on Input only without any conditional constraint

Copyright © 1997 Altera Corporation & 提供 THE SAME C = A and B D = A OR B c <= a and b; d <= a or b; c <= a and b;

Copyright © 1997 Altera Corporation & 提供 Process Statement All the Process Statement is executed in parallel Within the Process Statement, the coding is execute in sequential Process Statement is : OUTPUT depends on INPUT with Sensitivity List to control the event happen

Copyright © 1997 Altera Corporation & 提供 Entity test1 is Port ( clk, d1, d2 : in bit; q1, q2 : out bit); end test1; architecture test1_body of test1 is begin Process (clk, d1) begin if (clk’event and clk = ‘1’) then q1 <= d1; end if; end process; Process (clk, d2) begin if (clk’event and clk= ‘1’) then q2 <= d2; end if; end process; end test1_body; Entity test1 is Port ( clk, d1, d2 : in bit; q1, q2 : out bit); end test1; architecture test1_body of test1 is begin Process (clk, d2) begin if (clk’event and clk = ‘1’) then q2 <= d2; end if; end process; Process (clk, d1) begin if (clk’event and clk= ‘1’) then q1 <= d1; end if; end process; end test1_body; This two processes execute in parallel The coding is execute in sequential within the process The output depends on input with conditional constraint

Copyright © 1997 Altera Corporation & 提供 The two process statement execute in parallel

Copyright © 1997 Altera Corporation & 提供 How to... ? Now I know what is Combinational Logic but Q : How to implement of Combinational Logic in VHDL? Combinational Logic can be implemented by –Concurrent Signal Assigment Statements –Process Statement that describe purely combinational behaviour i.e. behaviour that does not depends on any CLOCK EDGE

Copyright © 1997 Altera Corporation & 提供 Concurrent Statements for Combinational Logic

Copyright © 1997 Altera Corporation & 提供 Concurrent Statements There are several different kinds of Concurrent Statements –(1) Simple Signal Assigments –(2) Conditional Signal Assigments –(3) Selected Signal Assigments

Copyright © 1997 Altera Corporation & 提供 (1) Simple Signal Assigment These kind of statements are executed in Parallel Entity test1 is port ( a, b, e : in bit; c, d : out bit); end test1; architecture test1_body of test1 is begin c <= a and b; d <= e; end test1_body;

Copyright © 1997 Altera Corporation & 提供 (2) Conditional Signal Assigments The output get the value when the condition is true –e.g. 2 to 1 multiplexer Entity test1 is port (in1, in2, sel : in bit; d : out bit); end test1; architecture test1_body of test1 is begin d <= in1 when sel = ‘0’ else in2; end test1_body;

Copyright © 1997 Altera Corporation & 提供 (3) Select Signal Assignments The output get value when matching with the selected item Entity test1 is port (a, b: in bit; sel : in bit; c : out bit); end test1; architecture test1_body of test1 is begin with sel select c <= a when ‘1’, b when ‘0’; end test1_body;

Copyright © 1997 Altera Corporation & 提供 Process Statement for Combinational Logic

Copyright © 1997 Altera Corporation & 提供 Process Statement There are some rules for the Process Statement usage –any kind of Process Statement must have SENITIVITY LIST sensitivity list contains the signals that cause the process statement to execute if their values change –the statement within the Process Statement will be execute STEP-BY-STEP Q : What does it all means ? A : Follow me

Copyright © 1997 Altera Corporation & 提供 Template for Process Statement SENSITIVITY LIST Using the “SENSITIVITY LIST” name : PROCESS (sensitivity_list) begin sequential statement #1 sequential statement # sequential statement # N END PROCESS name; General format for a Process Statemtent Process ( ) begin.. end process Sensitivity List Sequential Statement The sequential statement execute one by one and follow the order, ie. finish the #1 then #2 then #3 name is optional

Copyright © 1997 Altera Corporation & 提供 Example will be more clear Entity test1 is port (a, b, sel1, sel2 : in bit; result : out bit); end test1; architecture test1_body of test1 is begin process (sel1, sel2,a, b) begin if (sel1 = ‘1’) then result <= a; elsif (sel2 = ‘1’) then result <= b; else result <= ‘0’; end if; end process; end test1_body; Result change if sel1, sel2, a or b change the value Wait : I can do the same join with Concurrent Statement

Copyright © 1997 Altera Corporation & 提供 Entity test1 is port (a, b, sel1, sel2 : in bit; result : out bit); end test1; architecture test1_body of test1 is begin result <= a when sel1 = ‘1’ else b when sel2 = ‘1’ else ‘0’; end test1_body; Entity test1 is port (a, b, sel1, sel2 : in bit; result : out bit); end test1; architecture test1_body of test1 is begin process (sel1, sel2,a, b) begin if (sel1 = ‘1’) then result <= a; elsif (sel2 = ‘1’) then result <= b; else result <= ‘0’; end if; end process; end test1_body; Same function but different way to do the coding Concurrent StatementProcess Statement

Copyright © 1997 Altera Corporation & 提供 Q : What is the different between Concurrent and Process Statement A : For this simple example, both Concurrent and Process can do the same job. But some function must use Process Statement to do

Copyright © 1997 Altera Corporation & 提供 How to... ? Now I know what is Sequential Logic but Q : How to implement of Sequential Logic in VHDL? Sequential Logic can be implemented by –Process Statement describe the logic with some CLOCK signal

Copyright © 1997 Altera Corporation & 提供 Process Statement for Sequential Logic

Copyright © 1997 Altera Corporation & 提供 How to do the Latch Entity test1 is port (clk, d, reset : in bit; q : out bit); end test1; architecture test1_body of test1 is begin process (clk, d, reset) begin if (reset = ‘1’) then q <= ‘0’; elsif (clk = ‘1’) then q <= d; end if; end process; end test1_body; Reset take over the control first Clk take the control second Within the process excute in step-by-step

Copyright © 1997 Altera Corporation & 提供 If I modify the code to... Entity test1 is port (clk, d, reset : in bit; q : out bit); end test1; architecture test1_body of test1 is begin process (clk) begin if (reset = ‘1’) then q <= ‘0’; elsif (clk = ‘1’) then q <= d; end if; end process; end test1_body; Note : the result is totally different What is it ?

Copyright © 1997 Altera Corporation & 提供 I get a Flip-Flop not a LATCH

Copyright © 1997 Altera Corporation & 提供 Why I have a Flip-Flop not a Latch Latch with a Sensitivity list process (clk, d, reset) Flip-Flop with a Sensitivity list process(clk) Q : What is the Sensitivity list use for ? A : The OUTPUT change when the Sensitivity list change

Copyright © 1997 Altera Corporation & 提供 More Detail process (clk, d, reset) –this say that the OUTPUT change when either clk, d or reset change, if clk, d or reset not change, then maintain the output –what kind of device will provide this function ? LATCH

Copyright © 1997 Altera Corporation & 提供 process (clk) –this say that OUTPUT change when CLK change, if clk does not change, maintain the output –what kind of device will provide this function ? Flip-Flop

Copyright © 1997 Altera Corporation & 提供 The other way of coding LIBRARY IEEE; USE IEEE.std_logic_1164.all; ENTITY tdff IS PORT(clk, d: in std_logic; q : out std_logic); END tdff; ARCHITECTURE behaviour OF tdff IS BEGIN PROCESS BEGIN wait until clk = '1'; q <= d; END PROCESS; END behaviour;

Copyright © 1997 Altera Corporation & 提供 Compare IF-THEN-ELSE vs WATI UNTIL LIBRARY IEEE; USE IEEE.std_logic_1164.all; ENTITY tdff IS PORT(clk, d: in std_logic; q : out std_logic); END tdff; architecture behaviour OF tdff IS BEGIN PROCESS BEGIN wait until clk = '1'; q <= d; END PROCESS; END behaviour; Entity test1 is port (clk, d : in bit; q : out bit); end test1; architecture test1_body of test1 is begin process (clk) begin if (clk = ‘1’) then q <= d; end if; end process; end test1_body; Entity test1 is port (clk, d : in bit; q : out bit); end test1; architecture test1_body of test1 is begin process (clk,d) begin if (clk = ‘1’ and clk’event) then q <= d; end if; end process; end test1_body;

Copyright © 1997 Altera Corporation & 提供 Review Concurrent Statement for –combinational logic (without Flip-flop circuit) eg. decoder, multiplixer, multiplier, adder Process Statement for –combinational logic (without Flip-Flop circuit) –Sequential logic (with Flip-Flop circuit) e.g. State machine, counters, controller

Copyright © 1997 Altera Corporation & 提供 Seat down an think of your design YN YN

Copyright © 1997 Altera Corporation & 提供 Conclusion of learning Learned what is Combinational Logic/Circuits Learned what is Sequential Logic/Circuits Understand the different between Concurrent Statement and Process Statement

Copyright © 1997 Altera Corporation & 提供 Understand the usage of the –Concurrent Statement for Combinational Logic –simple signal assignment statement –conditional signal assignment statement –selected signal assignement statement –Process Statement for Combinational Logic for Sequential Logic –if-then-else structure for Latch –if-then-else structure for Flip-Flop –wait until structure for Flip-Flop

Copyright © 1997 Altera Corporation & 提供 All you learn is the basic concept of the VHDL language This is the Beginner VHDL Training Class The detail of the Circuit design will be covered at the Intermediate VHDL Training Class Advance VHDL language will be covered at the Expert VHDL Training Class

Copyright © 1997 Altera Corporation & 提供 The most important thing of VHDL Language “ Tell me how your circuit should behave and the VHDL compiler will give you the hardware circuit that does the job” e.g. Latch and Flip-Flop is a good example

Copyright © 1997 Altera Corporation & 提供 See you at the Intermediate VHDL training class