VHDL Objects. Lecture 8: VHDL (2) Variables. VHDL Objects - Constant. Files. EE3109 Gopi K. Manne Fall 2007

Similar documents
Embedded Systems CS - ES

Hardware Description Language VHDL (1) Introduction

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

A bird s eye view on VHDL!

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

Review of Digital Design with VHDL

Generatore di parità. LIBRARY ieee; USE ieee.std_logic_1164.all ; ENTITY xor2 IS PORT( A, B : in std_logic ; Y : out std_logic ) ; END xor2 ;

CSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\

ELCT 501: Digital System Design

EECE-4740/5740 Advanced VHDL and FPGA Design. Lecture 3 Concurrent and sequential statements

VHDL Part 2. What is on the agenda? Basic VHDL Constructs. Examples. Data types Objects Packages and libraries Attributes Predefined operators

Outline. CPE/EE 422/522 Advanced Logic Design L07. Review: JK Flip-Flop Model. Review: VHDL Program Structure. Review: VHDL Models for a MUX

UNIT I Introduction to VHDL VHDL: - V -VHSIC, H - Hardware, D - Description, L Language Fundamental section of a basic VHDL code Library :

Contents. Appendix D VHDL Summary Page 1 of 23

EEL 4783: Hardware/Software Co-design with FPGAs

IT T35 Digital system desigm y - ii /s - iii

VHDL BASIC ELEMENTS INTRODUCTION

Logic and Computer Design Fundamentals VHDL. Part 1 Chapter 4 Basics and Constructs

VHDL. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning

COE 405, Term 062. Design & Modeling of Digital Systems. HW# 1 Solution. Due date: Wednesday, March. 14

VHDL Structural Modeling II

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 4 Introduction to VHDL

VHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit

Digital Systems Design

Performance Engineering of Real-Time and Embedded Systems. Introduction to VHDL

Outline CPE 626. Advanced VLSI Design. Lecture 4: VHDL Recapitulation (Part 2) Signals. Variables. Constants. Variables vs.

Synthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden

BASIC VHDL LANGUAGE ELEMENTS AND SEMANTICS. Lecture 7 & 8 Dr. Tayab Din Memon

Review. LIBRARY list of library names; USE library.package.object; ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type;

Computer-Aided Digital System Design VHDL

C-Based Hardware Design

What Is VHDL? VHSIC (Very High Speed Integrated Circuit) Hardware Description Language IEEE 1076 standard (1987, 1993)

ECE4401 / CSE3350 ECE280 / CSE280 Digital Design Laboratory

2/14/2016. Hardware Synthesis. Midia Reshadi. CE Department. Entities, Architectures, and Coding.

Concurrent Signal Assignment Statements (CSAs)

Declarations of Components and Entities are similar Components are virtual design entities entity OR_3 is

VHDL 3 BASIC OPERATORS AND ARCHITECTURE BODY. Design descriptions & design constructions examples are taken from foundation series examples

Outline CPE 626. Advanced VLSI Design. Lecture 3: VHDL Recapitulation. Intro to VHDL. Intro to VHDL. Entity-Architecture Pair

COE 405 Design Methodology Based on VHDL

! Initially developed under DOD auspices, later standardized as IEEE standards , , & (standard logic data type)

Modeling Complex Behavior

CET ECET CET 486. C. Sisterna Spring 2003

ECE 545 Lecture 5. Data Flow Modeling in VHDL. George Mason University

VHDL. Chapter 7. Behavioral Modeling. Outline. Behavioral Modeling. Process Statement

Hardware Modeling. VHDL Syntax. Vienna University of Technology Department of Computer Engineering ECS Group

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26)

SRI SUKHMANI INSTITUTE OF ENGINEERING AND TECHNOLOGY, DERA BASSI (MOHALI)

Hardware Description Languages. Modeling Complex Systems

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

ECOM4311 Digital Systems Design

JUNE, JULY 2013 Fundamentals of HDL (10EC45) PART A

!"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

Mridula Allani Fall Fall

Basic Language Concepts

5. 0 VHDL OPERATORS. The above classes are arranged in increasing priority when parentheses are not used.

ECE 3401 Lecture 10. More on VHDL

Design units can NOT be split across different files

Department of Technical Education DIPLOMA COURSE IN ELECTRONICS AND COMMUNICATION ENGINEERING. Fifth Semester. Subject: VHDL Programming

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: The MIPS ISA (P&H ) Consulting hours. Milestone #1 (due 1/26)

CPE/EE 422/522. Chapter 8 - Additional Topics in VHDL. Dr. Rhonda Kay Gaede UAH. 8.1 Attributes - Signal Attributes that return a value

Getting Started with VHDL

IE1204 Digital Design L7: Combinational circuits, Introduction to VHDL

ENGIN 241 Digital Systems with Lab

Lecture 38 VHDL Description: Addition of Two [5 5] Matrices

Hardware Modeling. VHDL Basics. ECS Group, TU Wien

Declarations. Lexical elements. Type declaration Subtype declaration Constant declaration Signal declaration Variable declaration.

Building Blocks. Entity Declaration. Entity Declaration with Generics. Architecture Body. entity entity_name is. entity register8 is

VHDL Lexical Elements

Introduction to VHDL #1

Digital Design Using VHDL Using Xilinx s Tool for Synthesis and ModelSim for Verification

Introduction to VHDL #3

VHDL kod yerleşimi. kütüphaneler. Dış görünüş (entity: varlık) İşleyişi, yapısı (architecture: mimari)

Introduction to the VHDL language. VLSI Digital Design

Lecture 12 VHDL Synthesis

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University

Lecture 3 Introduction to VHDL

VLSI DESIGN (ELECTIVE-I) Question Bank Unit I

CprE 583 Reconfigurable Computing

SECTION 1 FAMILIARIZATION WITH VHDL

Tutorial 4 HDL. Outline VHDL PROCESS. Modeling Combinational Logic. Structural Description Instantiation and Interconnection Hierarchy

Sequential VHDL. Katarzyna Radecka. DSD COEN 313

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

FPGA BASED SYSTEM DESIGN. Dr. Tayab Din Memon Lecture 9 & 10 : Combinational and Sequential Logic

Department of Electronics & Communication Engineering Lab Manual E-CAD Lab

VHDL: A Crash Course

ECE U530 Digital Hardware Synthesis. Course Accounts and Tools

Design Using Verilog

Lecture 5: State Machines, Arrays, Loops. EE 3610 Digital Systems

EE 595. Part II Design Units in VHDL. EE 595 EDA / ASIC Design Lab

VHDL: skaitmeninių įtaisų projektavimo kalba. 2 paskaita Pradmenys

Lattice VHDL Training

Lab # 2. Sequential Statements

Very High Speed Integrated Circuit Har dware Description Language

Q.1. Attempt any TEN of the following: (a) Define the term Noise Margins. Ans: [Define: 2 M]

ECE 545 Lecture 12. FPGA Resources. George Mason University

Digital Design with SystemVerilog

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

Transcription:

Lecture 8: VHDL (2) VHDL Objects Four types of objects in VHDL Constants Variables Computer Aided Digital Design EE3109 Gopi K. Manne Fall 2007 Signals Files The scope of an object is as follows : Objects declared in a package are available to all VHDL descriptions that use that package Objects declared in an entity are available to all architectures associated with that entity Objects declared in an architecture are available to all statements in that architecture Objects declared in a process are available only within that process VHDL Objects - Constant Variables Name assigned to a specific value of a type Allow for easy update and readability Declaration of constant may omit value so that the value assignment may be deferred Declaration syntax : CONSTANT constant_name : type_name [:= value]; Declaration examples : CONSTANT PI : REAL := 3.14; CONSTANT SPEED : INTEGER; Convenient for local storage value can be changed & no time dimension associated operations on variables are instantaneous VARIABLE variable_name : type_name [:= value]; Declaration Examples: VARIABLE code : BIT_VECTOR(3 DOWNTO 0) := "0000"; VARIABLE freq : INTEGER; Signals Files Communication between VHDL components Value can be changed Time dimension associated Signal is driven by one or more drivers SIGNAL signal_name : type_name [:= value]; Declaration Examples: SIGNAL brdy : BIT; brdy <= '0' AFTER 5ns, '1' AFTER 10ns; Difference between variables and signals is the assignment delay Note that files are defined a fourth data type initially, but were reclassified as objects in VHDL in1993 Files provide a way for a VHDL design to communicate with the host environment File declarations make a file available for use to a design Files can be opened for reading and writing The package STANDARD defines basic file I/O routines for VHDL types The package TEXTIO defines more powerful routines handling I/O of text files 1

User defined data types VHDL Operators User can define their own data type TYPE data_type is type_name; Declaration Examples TYPE state_type IS (S0, S1, S2, S3,S4); signal state_name: state_type:= S1; Logical - not, and, or, nand, nor, xor Relational - =, /=, <, <=, >, >= Shift - sll, srl, sla, sra,rol, ror Adding - +, -, & Multiplying - *, /, mod, rem Miscellaneous- **, abs Signing - +, - VHDL Control Statements If End If Similar to C or PASCAL. All are sequential If end if case loop wait exit next return evaluated from top to bottom If conditional_expression then -- sequential statements [elseif conditional_expression then] -- sequential statements [else] -- sequential statements end if; example if a<0 then level:=1; elseif a>1000 then level:=3; else level:=2; end if; Case Mutually exclusive sets of choices others is used to cover all remaining values case expression is when choise1 => sequential statements; when choise2 => sequential statements; [when others => sequential statements;] example case x(0 to 1) is when 00 => z <= 0 ; when 01 => z <= 1 ; when others => z <= Z ; Modeling Styles Structural Describe the circuit in terms of its interconnected components Very low level (transistor) or a very high level description (block diagram) Behavioral Define the operation of a circuit over time Sequential statements inside a process Examples include state diagrams, timing diagrams etc Dataflow Define how data flows in the system Mixed Combination of other styles. 2

Structural Focus is on how components are interconnected rather than the operation of each component Ability to define a list of components Defining signals to interconnect these components Distinguish between multiple copies of same component using labels architecture HA_structure of Half_ is component XOR2 port (X, Y: in Bit; Z: out Bit); component AND2 port (L, M: in Bit; N: out Bit); X1: XOR2 port map (A,B,SUM); A1: AND2 port map (A,B,CARRY); end HA_structure; Behavioral Uses the process construct in VHDL architecture HA_algorithmic of Half_ is process (a,b) variable s:bit_vector(1 to 2); variable num: integer range 0 to 2:=0; s:=a&b; for i in 1 to 2 loop if s(i) = 1 then num:=num+1; end if; end loop; case num is when 0 => (carry, sum) <= bit_vector( 00 ); when 1 => (carry, sum) <= bit_vector( 01 ); when 2 => (carry, sum) <= bit_vector( 10 ); end process end HA_algorthmic; Dataflow Convenient for illustrating asynchronous and concurrent events, where delays represent actual hardware component delays Realistic way of modeling hardware dependencies and concurrencies architecture HA_dataflow of Half_ is sum <= a xor b after 8 ns; carry <= a and b after 4ns; end HA_dataflow; Mixed Combination of other styles Uses structural, concurrent and sequential statements architecture FA_mixed of _ is component XOR2 port (p1, p2:in bit; pz:out bit); signal s1 : bit; X1:XOR2 port map (a, b, s1); --- structural process (a, b, cin) --- behavioral variable t1, t2, t3 : bit; t1:=a and b; t2:=b and cin; t3:=a and cin; cout <= t1 or t2 or t3; end process; sum <= s1 or cin after 4 ns; -- dataflow end FA_mixed; Sequential Statements Concurrent Statements Execute serially inside a process Process statement Wait statement Variable assignment Assertion statement If statement Case statement Loop statement Null statement Next statement Exit statement Function call Procedure call Report statement Execute in simultaneous fashion - parallel Block Concurrent signal assignment Concurrent procedure call Concurrent assertion Generate 3

Structural Modeling Example 2-bit Ability to define a list of components Defining signals to interconnect these components Distinguish between multiple copies of same component using labels 2-bit adder from adder entity 2 is port (A, B: in bit_vector(1 downto 0); Cin: in bit; S: out bit_vector(1 downto 0); Cout: out bit); end 2; Cout B1 A1 C0 B0 A0 Cin adder entity design entity is port(a, b, cin: in bit; cout, sum: out bit); end ; a b cin sum cout For first adder A0 -> a B0 -> b Cin -> cin S0 -> sum C0 -> cout For second adder A1 -> a B1 -> b C0 -> cin S1 -> sum Cout -> cout S1 a b cin S0 sum cout 2-bit (Contd..) B1 A1 B0 A0 Cout architecture addertest of 2 is component port (a, b, cin: in bit; cout, sum: out bit); signal C0: bit; T1: port map ( A(0), B(0), Cin, S(0), C0 ); T2: port map ( A(1), B(1), C0, S(1), Cout); end addertest; Adde r S1 C0 Adde r S0 Ci n A2 A1 2 to 4 decoder Encoder Decoder O1 O2 O3 O4 Input (A2A1) O1 O2 O3 O4 A2 A1 00 1 0 0 0 01 0 1 0 0 10 0 0 1 0 11 0 0 0 1 Decoder a a b b a b a b a b a b Enable 3 to 8 decode B3B2B1 O1 O2 O3 O4 O5 O6 O7 O8 000 1 0 0 0 0 0 0 0 001 0 1 0 0 0 0 0 0 010 0 0 1 0 0 0 0 0 011 0 0 0 1 0 0 0 0 100 0 0 0 0 1 0 0 0 101 0 0 0 0 0 1 0 0 110 0 0 0 0 0 0 1 0 111 0 0 0 0 0 0 0 1 4

Decoder Hierarchical Design a a b b c c Decoders used in memories to select row to read or write used to select one of 2N blocks to activate a b c a b c a b c a b c a b c a b c a b c a b c 3-8 Decoder using 2-4 Decoders Design a 2-4 Decoder Circuit design and Output waveform Create a symbol Design a 3-8 decoder Circuit Design and Output Waveforms 3 to 8 decoder B3B2B1 O1 O2 O3 O4 O5 O6 O7 O8 0 00 1 0 0 0 0 0 0 0 0 01 0 1 0 0 0 0 0 0 0 10 0 0 1 0 0 0 0 0 0 11 0 0 0 1 0 0 0 0 1 00 0 0 0 0 1 0 0 0 1 01 0 0 0 0 0 1 0 0 1 10 0 0 0 0 0 0 1 0 1 11 0 0 0 0 0 0 0 1 5