Introduction to VHDL (part 2)

Slides:



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

Synchronous Sequential Logic
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.
History TTL-logic PAL (Programmable Array Logic)
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Simple Sequential Circuits in VHDL. Contents Sequential circuit examples: - SR latch in dataflow style - D flip-flop in behavioral style - shift register.
ECE C03 Lecture 18ECE C03 Lecture 61 Lecture 18 VHDL Modeling of Sequential Machines Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
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.
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.
Simple Testbenches Behavioral Modeling of Combinational Logic
Introduction to Counter in VHDL
Advanced FPGA Based System Design Lecture-9 & 10 VHDL Sequential Code By: Dr Imtiaz Hussain 1.
VHDL Training ©1995 Cypress Semiconductor 1 Introduction  VHDL is used to:  document circuits  simulate circuits  synthesize design descriptions 
Data Flow Modeling of Combinational Logic Simple Testbenches
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
1 H ardware D escription L anguages Modeling Complex Systems.
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 IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
7/10/2007DSD,USIT,GGSIPU1 Basic concept of Sequential Design.
Copyright © 1997 Altera Corporation & 提供 What is VHDL Very high speed integrated Hardware Description Language (VHDL) –is.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
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.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
CEC 220 Digital Circuit Design More VHDL Fri, February 27 CEC 220 Digital Circuit Design Slide 1 of 15.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
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 Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
Relational Operators Result is boolean: greater than (>) less than (=) less than or equal to (
VHDL 7: use of signals v.5a1 VHDL 7 Use of signals In processes and concurrent statements.
55:032 - Intro. to Digital DesignPage 1 VHDL and Processes Defining Sequential Circuit Behavior.
ECE DIGITAL LOGIC LECTURE 21: FINITE STATE MACHINE Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/24/2015.
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.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Sequential statements (1) process
Combinational logic circuit
Introduction To VHDL 홍 원 의.
B e h a v i o r a l to R T L Coding
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Module Goals Introduce structural VHDL constructs Use of components
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Some VHDL Details 10/8/08 ECE Lecture 8.
Sequential Design.
VHDL 5 FINITE STATE MACHINES (FSM)
Sequential-Circuit Building Blocks
ECE 434 Advanced Digital System L08
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
VHDL VHSIC Hardware Description Language VHSIC
ELEC 5200/6200 Computer Architecture and Design Review of VHDL
VHDL Discussion Subprograms
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
VHDL Discussion Subprograms
Modeling Complex Behavior
Sequntial-Circuit Building Blocks
(Sequential-Circuit Building Blocks)
Presentation transcript:

Introduction to VHDL (part 2) EE 162 Digital Circuit Design Vojin Oklobdzija by Vishal Nawathe

Quick Review of last lecture… What is VHDL? Why VHDL? Essential components for VHDL Types of circuit descriptions in VHDL All statements in VHDL are _________ Concept of ∆ delay Usage of ‘after’ keyword Signal types discussed earlier Questions till now???

VHDL Code for V.1 library ieee; use ieee.std_logic_1164.all; entity latch is port (A,B,C: in bit; J: out bit); end latch; architecture dataflow of latch is signal D, E, G : bit; begin G <= not A and not B and C; E <= B and D; D <= A and not C; J <= G and E; end dataflow;

Behavioral Description Unlike the other two methods for describing the architecture, behavioral description is like a black box approach to modeling a circuit It is designed to do a specific task, how it does it - is irrelevant It is used to model complex components which are hard to model using basic design elements Behavioral descriptions are often more powerful and allow for easy implementation of the design

Behavioral Description (contd.) They are supported inside a ‘process’ statement A ‘process’ is used to describe complex behaviors of the circuit The contents of a process can include sequential statements These sequential statements are similar to commands in conventional programming languages (it, for, etc) which can only be used in the body of a process statement Although, inside a process is sequential, the process itself is concurrent, all processes in an architecture begin execution at the same time The process statement is declared in the body of the architecture similar to signal assignments in data flow

Elements of a Process Processes can have a list of signals that they depend on, a sensitivity list, or they can use wait signals to make the process wait for a event to occur (not both) They are only to execute if the signals in the sensitivity list change This makes it critical to ensure that the signals on which a process depends-on are in the sensitivity list Can we generate a clock signal with this knowledge??? Process label (optional) Process is dependent only on variable “x” count: process (x) variable count : integer := -1; begin count:=count + 1; end process Similar to equals ‘=‘ Increments the variable “cnt” every time the signal of “x” changes

Variables Variables in VHDL behave similar to those in conventional programming languages For e.g. in C, we define integer variable as: int x = -1; They are used to represent the state of a process and are local to that process As in C, variables are local to the function they are declared in They are declared in a similar way to that of a signal in data flow or structural descriptions variable count : integer := -1; As shown in the example in previous slide, variables are declared before the begin keyword of a process

Variables and signals signal x, y, z : bit; process (y) begin x<=y; z<=not x; end process process (y) variable x,z : bit; begin x:= y; z:= not x; end process; It should be realized that signals and variables are different. On the left both commands in the process are concurrent, they occur at the same time. This results in ‘z’ not being inverse of ‘y’ but the inverse value of ‘x’ when the process begins For the example to the right, variables are used, which are sequential, hence the value of ‘z’ is the complement of ‘y’. Signal assignment statements do not take effect immediately Variable assignments take effect immediately

Behavioral vs. Structural vs. Data flow How components are put together nq q s r Data Flow Describes how data flows from input to output process (r,s) begin if (r nor nq) then q <= ‘1’; else q <= ‘0’; endif . . . end process Behavioral Describes the behavior of the circuit within a process

‘Wait’ statement Causes execution of sequential statements to wait Should be ‘inside’ a process statement [ label: ] wait [ sensitivity clause ] [ condition clause ] ; wait for 10 ns; -- timeout clause, specific time delay. wait until clk='1'; -- condition clause, Boolean condition wait until A>B and S1 or S2; -- condition clause, Boolean condition wait on sig1, sig2; -- sensitivity clause, any event on any signal terminates wait

Conditional statements : ‘if’ Syntax : [ label: ] if condition1 then sequence-of-statements elsif condition2 then optional sequence-of-statements elsif condition3 then else end if [ label ] ; Example : if a=b then c:=a; elsif b<c then d:=b; b:=c; else c:=a; end if;

Conditional statements : ‘switch - case’ Execute one specific case of an expression equal to a choice The choices must be constants and of the same data type as the expression Syntax : [ label: ] case expression is when choice1 => sequence-of-statements when choice2 => optional sequence-of-statements when others => optional if all choices covered sequence-of- statements end case [ label ] ; Example : case my_val is when 1 => a:=b; when 3 => c:=d; do_it; when others => null; end case;

Loops : ‘for’ Syntax : Example : Optional_label : for parameter in range loop sequential statements end loop Optional_label; Example : begin for I in 1 to 10 loop if (REPEAT = '1') then I := I-1; -- Incorrect logic end if; end loop;

Loops : ‘while’ Syntax : Example : Optional_label : while condition loop sequential statements end loop Optional_label; Example : begin while NOW < MAX_SIM_TIME loop CLK <= not CLK ; wait for PERIOD/2; end loop; wait; end process;

Example : V.2 Generate a 4-bit right shift register with synchronous reset. The bits shift to the right – one at a time at rising edge of the ‘clk’ signal. What will be the change if the reset is made ‘asynchronous’?

VHDL code for V.2 entity rsr is end rsr; Port (clk, clr, ld, rs, lin: in bit; d: in bit_vector(3 downto 0); q: out bit_vector(3 downto 0)); end rsr; architecture behavioral of rsr is signal qint: bit_vector(3 downto 0); begin q <= qint; process (clk) if clk’event and clk ’1’ then if clr = ’1’ then qint <= “0000”; elsif ld = ’1’ then qint <= d; elsif rs = ’1’ then qint <= lin & qint(3 downto 1); end if; end process; end behavioral;

Thank You