Operators Assignment Operators Logical Operators Relational Operators

Slides:



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

VHDL ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Introduction to VHDL (Lecture #5) ECE 331 – Digital System Design The slides included herein were taken from the materials accompanying Fundamentals of.
VHDL Data Types Module F3.1. VHDL Data Types Scalar Integer Enumerated Real (floating point)* Physical* Composite Array Record Access (pointers)* * Not.
Data Types. Composite Date Types n Arrays –Single and multi-dimensional –Arrays are single Type n Records –Records are mixed types.
CS 3850 Lecture 5 Operators. 5.1 Binary Arithmetic Operators Binary arithmetic operators operate on two operands. Register and net (wire) operands are.
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
1 Part II: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
Package with 4-valued logic Signal Attributes Assertion Data Flow description.
Introduction to VHDL (part 2)
VHDL Training ©1995 Cypress Semiconductor 1 Introduction  VHDL is used to:  document circuits  simulate circuits  synthesize design descriptions 
Chapter 6. Dataflow Modeling. Continuous Assignments The left hand side always be a scalar or vector net or a concatenation of scalar and vector nets.
IAY 0600 Digital Systems Design
Lecture 3 Chap 4 Types Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
2-Jun-16EE5141 Chapter 3 ä The concept of the signal ä Process concurrency ä Delta time ä Concurrent and sequential statements ä Process activation by.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
Lecture 4 Chap 5 Types Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Lecture #8 Page 1 Lecture #8 Agenda 1.VHDL : Operators 2.VHDL : Signal Assignments Announcements 1.HW #4 assigned ECE 4110– Digital Logic Design.
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.
Design Methodology Based on VHDL Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Introduction to VHDL. VHDL DARPA, VHSIC (Very High Speed Integrated Circuits) program Different manufacturers Standard language to describe –Structure.
CEC 220 Digital Circuit Design More VHDL Fri, February 27 CEC 220 Digital Circuit Design Slide 1 of 15.
CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19.
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.
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
Scalar Data Types and Operations 大同大學 資訊工程系 副教授 鄭福炯
CEC 220 Digital Circuit Design Introduction to VHDL Friday, February 21 CEC 220 Digital Circuit Design Slide 1 of 10.
Lecture #8 Page 1 Lecture #8 Agenda 1.VHDL : Operators 2.VHDL : Signal Assignments Announcements 1.HW #4 assigned ECE 4110– Sequential Logic Design.
IAY 0600 Digital Systems Design VHDL discussion Verification: Testbenches Alexander Sudnitson Tallinn University of Technology.
1/8/ L10 AttributesCopyright Joanne DeGroat, ECE, OSU1 Language Attributes and Package Standard A very useful aspect of the language.
CEC 220 Digital Circuit Design Introduction to VHDL Wed, Oct 14 CEC 220 Digital Circuit Design Slide 1 of 19.
Composite Data Types and Operations Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Introduction To VHDL 홍 원 의.
VBScript Session 3.
VHDL Basics.
Timing Model Start Simulation Delay Update Signals Execute Processes
Chapter 2. Introduction To VHDL
Behavioral Modeling in Verilog
ECE 434 Advanced Digital System L17
CHAPTER 10 Introduction to VHDL
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
OPERATORS and CONCURRENT STATEMENTS
ECE 434 Advanced Digital System L9
VHDL DATA TYPES.
CPE 528: Lecture #4 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
Coding Concepts (Sub- Programs)
CPE/EE 422/522 Advanced Logic Design L08
All the Operators 4-Dec-18.
CPE/EE 422/522 Advanced Logic Design L11
Advanced FPGA Based System Design
ECE 434 Advanced Digital System L10
COE 202 Introduction to Verilog
Logical Operations Boy who sow wild oats better hope for crop failure.
Modeling of Circuits with a Regular Structure
VHDL Tutorial.
Spreadsheets 2 Explain advanced spreadsheet concepts and functions
All the Operators 6-Apr-19.
All the Operators 13-Apr-19.
Spreadsheets Objective 6.02
Modeling Complex Behavior
Variables variable variable_name: variable_type
VHDL Data Types Module F3.1.
Language Attributes and Package Standard
Spreadsheets Objective 6.02
COE 202 Introduction to Verilog
Logical Operations Boy who sow wild oats better hope for crop failure.
Presentation transcript:

Operators Assignment Operators Logical Operators Relational Operators Shift Operators Adding Operators Multiplying Operators Miscellaneous Operators 9/23/2006 DSD,USIT,GGSIPU

Assignment Operators Used to assign values to signals, variables and constants. <= Used to assign a value to a Signal := Used to assign a value to a variable, constant, or Generic Must be the same size and type => Used to assign values to individual vector elements or with OTHERS. 9/23/2006 DSD,USIT,GGSIPU

Logical Operators The seven Logical Operators AND OR NAND are not associative NOR are not associative XOR XNOR NOT ; highest precedence over the others 9/23/2006 DSD,USIT,GGSIPU

Relational Operator = Equality /= inequality < <= > >= Must be one-dimensional discrete array of the same type. 9/23/2006 DSD,USIT,GGSIPU

Shift Operators Sll Shift left logical Srl Shift right logical Sla Shift left arithmetic Sra Shift right arithmetic Rol Rotate left Ror Rotate Right 9/23/2006 DSD,USIT,GGSIPU

RLC : Rotate Left with carry RRC : Rotate Right with carry Carry : 1 B <= rol a, -2; B = 10110011 B <= 00111011 B <= sla a, 3 b <= 01100000 B<= sra a, 2 b <= 11101011 RLC : Rotate Left with carry RRC : Rotate Right with carry Carry : 1 B <= Rlc a, 2 B <= 10110011 carry : 0 9/23/2006 DSD,USIT,GGSIPU

Adding Operators + addition - subtraction & Concatenation Example: C <= a & b; c = 10101000 C <= b & a; c := 10001010 9/23/2006 DSD,USIT,GGSIPU

Multiplying Operators * Multiplication / Division Mod modulus Rem Remainder 9/23/2006 DSD,USIT,GGSIPU

Miscellaneous Operators Abs Absolute ** Exponentiation Not negation 9/23/2006 DSD,USIT,GGSIPU

Attributes An attributes is a value, function, type, range, signal or a constant that may be associated with one or more names within a VHDL description. Two types of attributes User defined attributes Predefined attributes 9/23/2006 DSD,USIT,GGSIPU

Classes of attributes Value attributes : Return a constant value Function attributes : Call a function that return a value Signal Attributes : Creates a new implicit signal Type Attributes : Return a type Range attributes : Returns a range To use a attribute the “’” (apostrophe) construct must be employed 9/23/2006 DSD,USIT,GGSIPU

Type Attributes T’Base Returns the base type of datatype it is attached to example: Natural’base returns integer T’Left Returns left value specified in type declaration Example: Integer’Left is –2147483647 Bit’left is ‘0’ 9/23/2006 DSD,USIT,GGSIPU

T’right Returns right value specified in type declaration Example: Integer’right is 2147483647 bit’right is ‘1’ T’high Returns largest value specified in declaration Type bit8 is 255 downto 0 bit8’high is 255 9/23/2006 DSD,USIT,GGSIPU

T’low Returns smallest value specified in declaration Example: Type bit8 is 255 downto 0; bit8’low is 0; T’pos(x) Returns position number of argument in type (first position is 0) Type color is (red,green, blue, orange); color’pos(green) is 1; 9/23/2006 DSD,USIT,GGSIPU

T’val(x) Returns value in type at specified position number Example: Type color is (red,green, blue, orange); color’val(3) is orange; T’succ(x) Returns the successor to the value passed in color’succ(green) is blue; 9/23/2006 DSD,USIT,GGSIPU

T’pred(x) Returns the predecessor to the value passed in Example: Type color is (red,green, blue, orange); color’pred(blue) is green; T’leftof(x) Returns the value to the left of the value passed in color’leftof(blue) is green 9/23/2006 DSD,USIT,GGSIPU

T’rightof(x) Returns the value to the right of the value passed in Example: Type color is (red,green,blue,orange); color’rightof(blue) is orange; Type s is (1,0,0,1,0,1) S’rightof(1) 9/23/2006 DSD,USIT,GGSIPU

Type a_type is array(0 to 3, 7 downto 0) of bit; A’left(n) Returns left array bound of selected index range Example: a_type’left(1) is 0 a_type’left(2) is 7 A’right(n) Returns right array bound of selected index range a_type’right(1) is 3 a_type’right(2) is 0 9/23/2006 DSD,USIT,GGSIPU

Type a_type is array(0 to 3, 7 downto 0) of bit; A’high(n) Returns largest array bound value of selected index range Example: a_type’high(1) is 3 a_type’high(2) is 7 A’low(n) Returns smallest array bound value of selected index range a_type’low(1) is 0 a_type’low(2) is 0 9/23/2006 DSD,USIT,GGSIPU

Type a_type is array(0 to 3, 7 downto 0) of bit; A’range Returns selected index range Example: a_type’range(1) is 0 to 3 a_type’range(2) is 7 downto 0 A’reverse_range(n) Returns selected index range reversed a_type’reverse_range(1) 3 downto 0 a_type’reverse_range(2) 0 to 7; 9/23/2006 DSD,USIT,GGSIPU

Type a_type is array(0 to 3, 7 downto 0) of bit; A’length(n) Returns size of selected index range Example: a_type’length(1) is 4 a_type’length(2) is 8. 9/23/2006 DSD,USIT,GGSIPU

Signal attributes S’event Function returning a boolean that identifies if signal S has a new value assigned onto this signal (I.e. value is different that last value) Returns TRUE when an event occurs on s. If clk’event then …….– if clk just changed in value than… Wait until clk’event and clk=‘1’ ;-- rising edge of clock 9/23/2006 DSD,USIT,GGSIPU

Signal attribute (cont..) S’stable Implicit signal of Boolean type. This implicit signal has the value TRUE when an event (change in value) has not occurred on signal S for T time units and the value FALSE otherwise. If time is omitted, it defaults to 0ns. Returns TRUE if no event has occurred on s If s’stable(40ns) then – met set up time 9/23/2006 DSD,USIT,GGSIPU

S’active S’active Function returning a boolean that identifies if signal S had a new assignment made onto it (whether the value of the assignment is the SAME or DIFFERENT). Returns TRUE if s = ‘1’ If s’active then…….– New assignment of S Wait on s’active; Wait until s’active; 9/23/2006 DSD,USIT,GGSIPU

Signal attribute (cont..) S’quiet <time> This implicit signal has the value TRUE when the signal has been quiet (I.e. no activity or signal assignment) for T time units, and the value FALSE otherwise. If time is omitted, it defaults to 0ns. Returns TRUE if no event has occurred during the time specified If s’quiet(40ns) then – Really quiet, not even an assignment of the same value during the last T time units. 9/23/2006 DSD,USIT,GGSIPU

Signal attributes (cont..) S’Last_event Function returning the amount of time that has elapsed since the last event (change in value) occurred on signal S. If there was no previous event, it returns Time’high (The maximum value for time) Returns the time elapsed since last event Variable : TsinceLastEvent:time; …. TsinceLastEvent :s’last_event; 9/23/2006 DSD,USIT,GGSIPU

S’Last_active Returns the time elapsed since last s=‘1’ 9/23/2006 DSD,USIT,GGSIPU

Signal attribute (cont.) S’last_value Returns the value of s before the last event S’transaction Signal of type bit that changes for every transaction on s S’delayed<time> Signal same as s delayed by specified time 9/23/2006 DSD,USIT,GGSIPU

User-defined Attributes Syntax Attribute Declaration: ATTRIBUTE attribute_name: attribute_type; Attribute specification: ATTRIBUTE attribute_name of target_name : class is value; Where: Attribute_type : any data type (bit,std_logic etc) Class : type, signal,function etc. Value : ‘0’, 27, “000101110” , etc 9/23/2006 DSD,USIT,GGSIPU

Generic Generic is a way of specifying a generic parameter A static parameter that can be easily modified and adapted to different applications. A generic statement, when employed must be declared in the entity. Syntax: Generic (parameter_name : parameter_type:= parameter_value); 9/23/2006 DSD,USIT,GGSIPU