VHDL1 INTRODUCTION TO VHDL (VERY-HIGH-SPEED-INTEGRATED-CIRCUITS HARDWARE DESCRIPTION LANGUAGE) KH WONG (Some pictures are obtained from FPGA Express VHDL.

Slides:



Advertisements
Similar presentations
06/10/071 Security System Using VHDL. 06/10/072 Project Members Amal Shanavas Aneez I Ijas Rahim Renjith S Menon Sajid S Chavady.
Advertisements

Digital System Design Subject Name : Digital System Design Course Code : IT-314.
VHDL 5 FINITE STATE MACHINES (FSM) Some pictures are obtained from FPGA Express VHDL Reference Manual, it is accessible from the machines in the lab at.
©2004 Brooks/Cole FIGURES FOR CHAPTER 20 VHDL FOR DIGITAL SYSTEM DESIGN Click the mouse to move to the next page. Use the ESC key to exit this chapter.
VHDL in digital circuit synthesis (tutorial) dr inż. Miron Kłosowski EA 309
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
OBJECTIVES Learn the history of HDL Development. Learn how the HDL module is structured. Learn the use of operators in HDL module. Learn the different.
VHDL Refresher ECE 437 April 13, 2015 Motivation ECE 337 is a prerequisite But… –You may have taken 337 a few semesters previous –Breaks causes memory.
Introduction To VHDL for Combinational Logic
INTRO TO VHDL Appendix A: page page VHDL is an IEEE and ANSI standard. VHDL stands for Very High Speed IC hardware description language.
Multiplexers Section 3-7 Mano & Kime. Multiplexers & Demultiplexers Multiplexers (Selectors) Lab 1 – Behavioral VHDL -- Multiplexers MUX as a Universal.
Digital Logic with VHDL EE 230 Digital Systems Fall 2006 (10/17/2006)
Introduction to VHDL CLASS MATERIALS EECE 255. Very High Speed Integrated Circuit Hardware Description Language Industry standard language to describe.
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
VHDL Structural Architecture ENG241 Week #5 1. Fall 2012ENG241/Digital Design2 VHDL Design Styles Components and interconnects structural VHDL Design.
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.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
FPGA chips and DSP Algorithms By Emily Fabes. 2 Agenda FPGA Background Reasons to use FPGA’s Advantages and disadvantages of using FPGA’s Sample VHDL.
02/02/20091 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
1/31/20081 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
ECE 331 – Digital System Design Course Introduction and VHDL Fundamentals (Lecture #1)
VLSI Design Lab Introduction
EENG 2910 – Digital Systems Design Fall Course Introduction Class Time: M9:30am-12:20pm Location: B239, B236 and B227 Instructor: Yomi Adamo
Chapter 4 Programmable Logic Devices: CPLDs with VHDL Design Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
An Introduction to VHDL Using Altera’s Quartus II IDE Dr. William M. Jones Coastal Carolina University Numbers and Bytes Meeting 20 OCT 2008.
1 Digital System Design Subject Name : Digital System Design Course Code : IT- 308 Instructor : Amit Prakash Singh Home page :
System Arch 2008 (Fire Tom Wada) /10/9 Field Programmable Gate Array.
Comments on Lab #4 Annotating Timing Diagrams Draw viewer’s attention to the points you are trying to show / verify –Important output states glitch or.
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
TO THE COURSE ON DIGITAL DESIGN FOR INSTRUMENTATION TO THE COURSE ON DIGITAL DESIGN FOR INSTRUMENTATION.
VHDL Project I: Introduction to Testbench Design Matthew Murach Slides Available at:
Basic Overview of VHDL Matthew Murach Slides Available at:
L12 – VHDL Overview. VHDL Overview  HDL history and background  HDL CAD systems  HDL view of design  Low level HDL examples  Ref: text Unit 10, 17,
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
George Mason University ECE 449 – Computer Design Lab Welcome to the ECE 449 Computer Design Lab Spring 2004.
EKT303/4 PRINCIPLES OF PRINCIPLES OF COMPUTER ARCHITECTURE (PoCA)
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Introduction to FPGA Tools
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
1/8/ L2 VHDL Introcution© Copyright Joanne DeGroat, ECE, OSU1 Introduction to VHDL.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
L19 – Resolved Signals. Resolved Signals  What are resolved signals In systems In VHDL Resolution – Isn’t that for resolving conflicts?  Ref: text Unit.
11 EENG 1920 Introduction to VHDL. 22 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
Digital Design Using VHDL and PLDs ECOM 4311 Digital System Design Chapter 1.
Introduction to VHDL Coding Wenchao Cao, Teaching Assistant Department of EECS University of Tennessee.
Apr. 3, 2000Systems Architecture I1 Introduction to VHDL (CS 570) Jeremy R. Johnson Wed. Nov. 8, 2000.
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
May 9, 2001Systems Architecture I1 Systems Architecture I (CS ) Lab 5: Introduction to VHDL Jeremy R. Johnson May 9, 2001.
VHDL From Ch. 5 Hardware Description Languages. History 1980’s Schematics 1990’s Hardware Description Languages –Increased due to the use of Programming.
ECE 332 Digital Electronics and Logic Design Lab Lab 3 Introduction to Starter Kit ECE 332 George Mason University.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
SUBJECT : DIGITAL ELECTRONICS CLASS : SEM 3(B) TOPIC : INTRODUCTION OF VHDL.
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.
Systems Architecture Lab: Introduction to VHDL
LAB #4 Xilinix ISE Foundation Tools VHDL Design Entry “A Tutorial”
Design Entry: Schematic Capture and VHDL
Introduction to Programmable Logic
Programmable Logic Devices: CPLDs and FPGAs with VHDL Design
Field Programmable Gate Array
Field Programmable Gate Array
Field Programmable Gate Array
VHDL 1. ver.7a VHDL1 INTRODUCTION TO VHDL (VERY-HIGH-SPEED-INTEGRATED-CIRCUITS HARDWARE DESCRIPTION LANGUAGE) KH WONG (w2 begins) (Some pictures are.
VHDL Structural Architecture
VHDL Introduction.
Hardware Modeling & Synthesis Using VHDL
© Copyright Joanne DeGroat, ECE, OSU
Digital Designs – What does it take
Presentation transcript:

VHDL1 INTRODUCTION TO VHDL (VERY-HIGH-SPEED-INTEGRATED-CIRCUITS HARDWARE DESCRIPTION LANGUAGE) KH WONG (Some pictures are obtained from FPGA Express VHDL Reference Manual, it is accessible from the machines in the lab at /programs/Xilinx foundation series/VDHL reference manual) VHDL 1. ver.5b 1

You will learn Basic structure: the Entity contains two parts Entity declaration : Define the signals to be seen outside externally E.g. Connecting pins of a CPU, memory Architecture: define the internal operations of the device VHDL 1. ver.5b 2

Resource & references Book Digital Design: Principles and Practices, 4/E John F. Wakerly, Prentice Hall. High-Speed Digital Design: A Handbook of Black Magic by Howard W. Johnson and Martin Graham Prentice Hall. BOOKBOON (Free text books) BOOKBOON Online resource, software in the lab. VHDL 1. ver.5b 3

Web resource on VHDL (plenty) *Courses and tools VHDL Quick Reference VHDL 1. ver.5b 4

What is an entity? Overall structure of a VHDL file VHDL 1. ver.5b 5 Entity Library declaration Entity declaration Architecture body

What are they? VHDL 1. ver.5b 6 Entity declaration Architecture body A VHDL file Library declaration, e.g. IEEE library Entity Architecture Body: defines the processing

An example a comparator in VHDL VHDL 1. ver.5b 7 The comparator chip: eqcomp4 a3 a2 a1 a0 Equals (Equals=1 when a=b) b3 b2 b1 b0 equals VHDL for programmable logic, Skahill, Addison Wesley a=[a3,a2,a1,a0] b=[b3,b2,b1,b0]

Exclusive nor (XNOR) When a=b, Output Y = 0 Otherwise Y =1 abOutput : Y VHDL 1. ver.5b 8 abab

An example of a comparator 1) --the code starts here, “a comment” 2) library IEEE; 3) use IEEE.std_logic_1164.all; 4) entity eqcomp4 is 5) port (a, b: in std_logic_vector(3 downto 0 ); 6) equals:out std_logic); 7) end eqcomp4; 8) architecture dataflow1 of eqcomp4 is 9) begin 10) equals <= '1' when (a = b) else '0’; 11) -- “comment” equals is active high 12) end dataflow1; VHDL 1. ver.5b 9 Entity declaration Architecture body Architecture Body: defines the processing Entity declaration: defines IOs Library declaration

How to read it? 1) --the code starts here 2) library IEEE; 3) use IEEE.std_logic_1164.all; 4) entity eqcomp4 is 5) port (a, b: in std_logic_vector(3 downto 0 ); 6) equals:out std_logic); 7) end eqcomp4; 8) architecture dataflow1 of eqcomp4 is 9) begin 10) equals <= '1' when (a = b) else '0’; 11) -- “comment” equals is active high 12) end dataflow1; VHDL 1. ver.5b 10 A bus, use downto to define it. E.g. in std_logic_vector(3 downto 0); Entity enclosed by the entity name – eqcomp4 (entered by the user) Port defines the I/O pins. Entity declaration Architecture body

Exercise 1.1 In the eqcomp4 VHDL code: How many Input / Output pins? Answer: _______ What are their names and their types? Answer: ___________ ___________________ What is the difference between std_logic and std_logic_vector? Answer: __________ __________________ 1 entity eqcomp4 is 2 port (a, b: in std_logic_vector(3 downto 0 ); 3equals:out std_logic); 4 end eqcomp4; 5 6 architecture dataflow1 of eqcomp4 is 7 begin 8equals <= '1' when (a = b) else '0’; 9-- “comment” equals is active high 10 end dataflow1; VHDL 1. ver.5b 11 Student ID: __________________ Name: ______________________ Date:_______________ (Submit this at the end of the lecture.)

Entity declaration: define the IO pins of the chip entity eqcomp4 is port (a, b: in std_logic_vector(3 downto 0 ); equals:out std_logic); end eqcomp4; VHDL 1. ver.5b 12 The comparator chip: eqcomp4 a3 a2 a1 a0 equals b3 b2 b1 b0 Two input buses (a3,a2,a1,a0) (b3,b2,b1,b0) and one output ‘equals’

Concept of signals A signal is used to carry logic information. In hardware it is a wire. A signal can be “in” or “out”..etc. There are many logic types of signals (wires) Bit (can only have logic 1 or 0) Std_logic can be 1, 0, Z..etc. ( Z=float.) Std_logic_vector is a group of wires (called bus). a, b: in std_logic_vector(3 downto 0); in VHDL means a(0), a(1), a(2), a(3) are std_logic signals Same for b. VHDL 1. ver.5b 13 (meaning Standard logic, an IEEE standard)

Exercise entity test1 is 2 port (in1,in2: in std_logic; 3 out1: out std_logic ; 4 end test1; 5 6 architecture test1arch of test1 is 7 begin 8out1<= in1 or in2; 9 end test1_arch; Give line numbers of (i) entity declaration, and (ii) architecture? Also find an error in the code. _____________________________________________ What are the functions of (i) entity declaration and (ii) architecture? _____________________________________________ Draw the chip and names the pins. (Don’t forget the two most important pins) __________________________________________________ Underline (or list) the words that are user defined in the above VHDL code. _________________________________________________ VHDL 1. ver.5b 14

Exercise 1.3 Rewrite code in example 1.2, with Entity name is not test1 but test1x Inputs are not in1 and in2 but a,b, resp. Output is not out1 but out1x Logic type is not std_logic but bit Architecture name is not test1arch but x_arch. VHDL 1. ver.5b 15 Answer:

ENTITY DECLARATION Define Input/Output (IO) pins VHDL 1. ver.5b 16 Entity Library declaration Entity declaration IN port declaration declare modes( In out, inout, buffer) Architecture body

More on Entity Declaration entity do_care is port( s : in std_logic_vector(1 downto 0); y : buffer std_logic); end do_care; 4 modes of IO pins in port in, out, inout (bidirectional) buffer (can be read back by the entity) VHDL 1. ver.5b 17 **User defined variables are in Italic.

Four modes of IO signals Declared in port declaration VHDL 1. ver.5b 18 IO Signal Modes in port Mode: IN Mode: out Mode: inout Mode: buffer Example: entity do_care is port( s : in std_logic_vector(1 downto 0); y : buffer std_logic); end do_care; 4 modes of IO pins in port

IN, OUT, INOUT, BUFFER modes IN: data flows in, like an input pin OUT: data flows out, just like an output. The output cannot be read back by the entity INOUT: bi-directional, used for data lines of a CPU etc. BUFFER: similar to OUT but it can be read back by the entity. Used for control/address pins of a CPU etc. VHDL 1. ver.5b 19

Exercise 1.4 : On IO signal modes: IN, OUT, INOUT, BUFFER State the difference between out and buffer. Answer:_______________________________________ ___ Based on the following schematic, identify the modes of the IO pins. VHDL 1. ver.5b 20 From VHDL for programmable logic, Skahill, Addison Wesley

THE ARCHITECTURE BODY Define the internal architecture/operation VHDL 1. ver.5b 21 Entity Library declaration Entity declaration Architecture Body

Architecture body: defines the operation of the chip Begin …tells you the internal operation….. …….. end 6 architecture dataflow1 of eqcomp4 is 7 begin 8equals <= '1' when (a = b) else '0’; 9 -- “comment” equals is active high 10 end dataflow1; VHDL 1. ver.5b 22 Architecture body

How to read it? Architecture name -- dataflow1(entered by the user) equals, a,b are I/O signal pins designed by the user in the entity declaration. The operation: equals <= '1' when (a = b) else '0’; “--” means comment VHDL 1. ver.5b 23 6 architecture dataflow1 of eqcomp4 is 7 begin 8equals <= '1' when (a = b) else '0’; 9-- “comment” equals is active high 10 end dataflow1;

Exercise 1.5: Draw the schematic circuit 1) library IEEE; 2) use IEEE.STD_LOGIC_1164.ALL; 3) entity test2v is 4) port (in1 : in std_logic_vector (2 downto 0); 5) out1 : out std_logic_vector (3 downto 0)); 6) end test2v; 7) architecture test_arch of test2v is 8) begin 9) out1(0)<=in1(1); 10) out1(1)<=in1(2); 11) out1(2)<=not (in1(0) and in1(1)); 12) out1(3)<='1'; 13) end test_arch ; VHDL 1. ver.5b 24

Exercise 1.6: Multiple choice question: What is this circuit? (a) encoder,(b) decoder,(c)multiplexer or (d) adder. Answer:____ Fill in the truth table of this circuit Fill in the blanks of the program listed below for this circuit. In1in2out00out10out11out VHDL 1. ver.5b 25 1 entity test16 is 2 port (in1, in2: in std_logic; 3 out00,out01,out10,out11 : out std_logic); 4 end test16; 5 architecture test16_arch of test16 is 6 begin 7 out00<=not (_______________________); 8 out10<=not (_______________________); 9 out11<=not (_______________________); 10 out01<=not (_______________________); 11 end test16_arch ;

Exercise 1.7: Write a VHDL program that implement the formula F= (/a+b)./c VHDL 1. ver.5b 26

Summary learned Entity Entity declaration Use of port() Modes of IO signals Structure of the Architecture body of a simple VHDL program VHDL 1. ver.5b 27