1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.

Slides:



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

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.
Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
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 CSCE 496/896: Embedded Systems Witawas Srisa-an.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
FPGAs and VHDL Lecture L13.1 Sections 13.1 – 13.3.
Introduction to VHDL (part 2)
Advanced FPGA Based System Design Lecture-9 & 10 VHDL Sequential Code By: Dr Imtiaz Hussain 1.
ECE 2372 Modern Digital System Design
1 Part I: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
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.
ECE 332 Digital Electronics and Logic Design Lab Lab 6 Concurrent Statements & Adders.
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
16/11/2006DSD,USIT,GGSIPU1 Packages The primary purpose of a package is to encapsulate elements that can be shared (globally) among two or more design.
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)
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
Lecture 8 Review Combinational Devices –Decoder –Multiplexor (Bhasker p-81) –Shifter –Barrel Shifter (Bhasker p-303)
EGRE 6311 LHO 04 - Subprograms, Packages, and Libraries EGRE 631 1/26/09.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
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.
1 Computer Architecture & Assembly Language Spring 2009 Dr. Richard Spillman Lecture 11 – ALU Design.
Combinational logic circuit
Basic Language Concepts
Describing Combinational Logic Using Processes
Behavioral Style Combinational Design with VHDL
ENG2410 Digital Design “Combinational Logic Design”
ECE 4110–5110 Digital System Design
Part II A workshop by Dr. Junaid Ahmed Zubairi
Module Goals Introduce structural VHDL constructs Use of components
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Part IV: VHDL CODING.
Behavioral Style Combinational Design with VHDL
Advanced Digital design
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
CPE 528: Session #7 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
ECE 434 Advanced Digital System L08
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
IAS 0600 Digital Systems Design
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Data Flow Modeling of Combinational Logic
VHDL (VHSIC Hardware Description Language)
VHDL Discussion Subprograms
Concurrent vs Sequential
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
VHDL Discussion Subprograms
IAS 0600 Digital Systems Design
UNIT 6: Mixed-Type Description
4-Input Gates VHDL for Loops
(Sequential-Circuit Building Blocks)
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3

2 Review Introduction to VHDL Using Xilinx Software

3 Review - VHDL Structure Package Entity Structural Architecture Data Flow Architecture Behavioral Architecture GenericsPortProcess

4 Outline VHDL Statements VHDL Functions Examples

5 VHDL Functions

6 VHDL Statements The body of a process block could contain any of the data flow/behavioral constructs case statement signal assignment statement In addition, it could use other features which are common in HLL: if then else loop structure

7 IF-THEN-ELSE The standard format: if boolean-expression then else end if;

8 Example Consider a comparator circuit It accepts two inputs A and B It produces a “1” output on C if A = B architecture behave of compare is begin process (A,B); begin if (A = B) then C <= ‘1’; else C <= ‘0’; end if; end process; end behave;

9 Loops in VHDL There are 3 types of loops in VHDL for in loop end loop; while loop end loop; loop end loop;

10 Exit Statement exit An exit statement is used to end a loop FORMAT: exit; exit when ; exit ; exit when ;

11 VHDL Functions

12 Functions Functions are used as a short-cut when specifying behavior - therefore, all statements in a function are executed sequentially function A_O_I (constant A1, B1, C1, D1 : in BIT) return BIT is variable the_result : BIT; begin -- any number of sequential statements needed to produce result the_result := (A1 and B1) nor (C1 and D1); return (the_result); end A_O_I; Z <= A_O_I ( A, B,C, D) after 10 ns;

13 General Form The general form of a function is: function func_name ( parameters) return return_type is -- declarations, variables begin -- sequential statements return return_value; end func_name;

14 Example Write a function to convert a bit-vector to a positive integer value. i.e. Binary to Decimal conversion To do this requires three VHDL attributes: Given a variable BV of type BIT_VECTOR( 2 downto 0) BV ’ RANGE is the range of valid indices (2 downto 0) BIT ’ POS (’0’) returns the integer 0 BIT ’ POS (’1’) returns the integer 1

15 Complete Function The conversion function is: function BV_to_NATURAL (BV: in BIT_VECTOR) return INTEGER is variable RESULT : INTEGER := 0; begin for INDEX in BV’RANGE loop result := result * 2 + BIT’POS (BV(INDEX)); end loop; return RESULT; end function BV_to_NATURAL; if BV = "10110", then the integer rep = 2 4 * * * * * 0 = 2 * (2 * ( 2 * ( 2 * ( 1) + 0 ) + 1 ) + 1) + 0

16 Other VHDL Features VHDL is a rich programming language we have covered only the surface some features will be introduced later as they become relevant a few features will be highlighted now VHDL Features attributes generic assignments

17 Attributes An attribute is also a specific property of a signal For example, given a signal S the following attributes can be defined:

18 VHDL Generics Generics allow models to be parameterized that is, general models can be constructed and values passed into them when they are called Generics are defined in the entity: Default value

19 Examples

20 Examples Several examples of VHDL code Multiplexer Decoder Register Adder Clock Signals

21 Multiplexer (MUX) A multiplexer is a digital circuit with several inputs and one output it is designed to pass one selected input on to the output Signal set - only one is passed on Used to determine “switch position” Sample data on input Address input 0 Address input 1 Address input 2 Address input 3 Data Address Output

22 MUX Application A MUX is designed to be used as a “data router” for example, a single computer with multiple terminals Computer Mux address data

23 MUX in VHDL A MUX could be described using VHDL in several ways (same entity, different architectures) EXAMPLE: 4-to-1 Mux library ieee; use ieee.std_logic_1164.all; entity MUX4_1 is port (Sel:in std_logic_vector(1 downto 0); A,B,C,D: in std_logic; Y: out std_logic); end MUX4_1; MUX A B C B Sel Y architecture Cond_Data of MUX4_1 is begin Y <= A when Sel = “00” else B when Sel = “01” else C when Sel = “10” else D; end Cond_Data;

24 Decoder A decoder is another digital device which is useful in computer design v it has n inputs and 2 n outputs one and only one output is asserted for each input combination

25 Decoder Function A decoder will change a binary input into a single asserted output data routing combinational logic design EXAMPLE: four terminals all connected to one computer - the computer wants to send a message to only one terminal Computer T1T1 Decoder T2T2 T3T3 T4T4 address

26 Decoder in VHDL library ieee; use ieee.std_logic_1164.all; entity decode is port ( X, Y : in std_logic; O1, O2, O3, O4 : out std_logic); end decode; architecture func of decode is begin O1 <= (not X) and (not Y); O2 <= (not X) and Y; O3 <= X and (not Y); O4 <= X and Y; end;

27 Register A register is a device that stores a data word clk A B C D QAQA QBQB QCQC QDQD A four bit data register:

28 Register in VHDL The same four bit register in VHDL looks like: library ieee; use ieee.std_logic_1164.all; entity Reg4 is port (DataIn: in std_logic_vector(3 downto 0); DataOut : in std_logic_vector(3 downto 0); C: in std_logic); end Reg4; architecture Behav of Reg4 is begin process (C) begin if (C = '1') then DataOut <= DataIn; end if; end process; end Behav;

29 Using Xilinx ISE

30 Constructing a Reg in VHDL Create a new source and assign the inputs and outputs:

31 VHDL Form ISE will create this form:

32 Final Code Enter the complete code:

33 Simulating the code Create a new project – reg_tbw and set up the test inputs

34 Run the Simulation Select execute

35 Possible Quiz Remember that even though each quiz is worth only 5 to 10 points, the points do add up to a significant contribution to your overall grade If there is a quiz it might cover these issues: What is a MUX? What is a decoder? What is the purpose of an exit statement?