Vous êtes sur la page 1sur 7

RSS Email Follow us Become a fan Home About Us On Demand Projects Project Request Contact Us Privacy Policy Site-Map

Home Quiz Programming Data Structure Projects Mini Project Education Notes IGNOU

Search this site...

You are here: Home VHDL Behavioral Modeling in VHDL January 10, 2014 10:52 am

Behavioral Modeling in VHDL

Posted by Coding Talks on January 25, 2012

Behavioral Modeling :

The signal assignment statement is the most basic form of behavioral modeling in VHDL. Following is an example:

1 a <= b;

This statement is read as follows:

a gets the value of b. The effect of this statement is that the current value of signal b is assigned to signal a. This statement is executed whenever signal b changes value. Signal b is in the sensitivity list of this statement. Whenever a signal in the sensitivity list of a signal assignment statement changes value, the signal assignment statement is executed. If the result of the execution is a new value that is different from the current value of the signal, then an event is scheduled for the target signal. If the result of the execution is the same value, then no event is scheduled but a transaction is still generated. A transaction is always generated when a model is evaluated, but only signal value changes cause events to be scheduled. The next example shows how to introduce a nonzero delay value for the assignment:

1 a <= b after 10 ns; This statement is read as follows: a gets the value of b when 10 nanoseconds of time have elapsed. Both of the preceding statements are concurrent signal assignment statements. Both statements are sensitive to changes in the value of signal b. Whenever b changes value, these statements execute and new values are assigned to signal a. Using a concurrent signal assignment statement, a simple AND gate can be modeled, as follows:

1 2 3 4 5 6 7

ENTITY and2 IS PORT ( a, b : IN BIT; PORT ( c : OUT BIT ); END and2; ARCHITECTURE and2_behav OF and2 IS BEGIN c <= a AND b AFTER 5 ns;

The AND gate has two inputs a, b and one output c, as shown in Figure. The value of signal c may be assigned a new value whenever either a or b changes value. With an AND gate, if a is a 0 and b changes from a 1 to a 0, output c does not change. If the output does change value, then a transaction occurs which causes an event to be scheduled on signal c; otherwise, a transaction occurs on signal c. The entity design unit describes the ports of the and2 gate. There are two inputs a and b, as well as one output c. The architecture and2_behav for entity and2 contains one concurrent signal assignment statement. This statement is sensitive to both signal a and signal b by the fact that the expression to calculate the value of c includes both a and b signal values. The value of the expression a and b is calculated first, and the resulting value from the calculation is scheduled on output c, 5 nanoseconds from the time the calculation is completed. In another example the symbol for a four-input multiplexer is shown.

This is the behavioral model for the mux:

1 2 3 4 5 6 7 8 9 10 11 12 13 14

LIBRARY IEEE; USE IEEE.std_logic_1164.ALL; ENTITY mux4 IS PORT ( i0, i1, i2, i3, a, b : IN std_logic; q : OUT std_logic); END mux4; ARCHITECTURE mux4 OF mux4 IS SIGNAL sel: INTEGER; BEGIN WITH sel SELECT q <= i0 AFTER 10 ns WHEN 0, q <= i1 AFTER 10 ns WHEN 1, i2 AFTER 10 ns WHEN 2,

15 16 17 18 19 20 21 22

q <= i3 AFTER 10 ns WHEN 3, q <= X AFTER 10 ns WHEN OTHERS; sel <= 0 WHEN a = 0 AND b = 0 ELSE 1 WHEN a = 1 AND b = 0 ELSE 2 WHEN a = 0 AND b = 1 ELSE 3 WHEN a = 1 AND b = 1 ELSE 4; END mux4;

The entity for this model has six input ports and one output port. Four of the input ports (I0, I1, I2, I3) represent signals that will be assigned to the output signal q. Only one of the signals will be assigned to the output signal q based on the value of the other two input signals a and b. The truth table for the multiplexer is shown.

To implement the functionality described in the preceding, we use a conditional signal assignment statement and a selected signal assignment.The second statement type in this example is called a conditional signal assignment statement. This statement assigns a value to the target signal based on conditions that are evaluated for each statement. The statement WHEN conditions are executed one at a time in sequential order until the conditions of a statement are met. The first statement that matches the conditions required assigns the value to the target signal. The target signal for this example is the local signal sel. Depending on the values of signals a and b, the values 0 through 4 are assigned to sel. If more than one statements conditions match, the first statement that matches does the assign, and the other matching statements values are ignored. The first statement is called a selected signal assignment and selects among a number of options to assign the correct value to the target signal. The target signal in this example is the signal q. The expression (the value of signal sel in this example) is evaluated, and the statement that matches the value of the expression assigns the value to the target signal. All of the possible values of the expression must have a matching choice in the selected signal assignment . Each of the input signals can be assigned to output q, depending on the values of the two select inputs, a and b. If the values of a or b are unknown values, then the last value, X (unknown), is assigned to output q. In this example, when one of the select inputs is at an unknown value, the output is set to unknown. The second statement is sensitive to signals a and b. Whenever either a or b changes value, the second statement is executed, and signal sel is updated. The first statement is sensitive to signal sel. Whenever signal sel changes value, the first signal assignment is executed.

Make money blogging Notebook Computer Email Marketing Basics Skills Baby modeling agencies More than one Porting If you are

You Need "Behavioral Modeling in VHDL" ???

"Behavioral Modeling in VHDL" (Source Code / Report / PPT) Totally belong to CodingTalks Team and We always ready to Share our Stuff with our users. If you are Very Much Interested on This Topic Then you must Leave a Comment what Exactly you Looking For Or Send us Email to get Full Information. Coding Talks Team

Filed in: VHDL Tags: Behavioral Modeling, by example, programming, projects, tutorial, vhdl

About Coding Talks

CodingTalks is basically started to help students in their computer projects, learners to learn programming languages and other technological material. Meet the Authors: Vivek is doing B.Tech and MCA from BKBIET Pilani. He is good at his programming skills especially PHP , C++ and Java. He is blogging since 2007 on different blogs. Google + View all posts by Coding Talks

Get Updates
Subscribe to our e-mail newsletter to receive updates.

Share This Post Related Posts


VHDL Program for 4 to 1 MUX Priority Encoder VHDL Code Projects VLSI using Matlab for Final Year Matlab Tutorial : Face Detection VHDL Code to Check Whether Given Number is Prime or not

Leave a Reply
Name (Required) Mail (will not be published) (Required) Website

Submit Comment

+ 3 = six


o o o o o o o o o o o o o o o o o o o o

Education (8) Embedded & Microcontroller (1) How To (5) IGNOU (5) Matlab (5) Programming (242) ASP/ASP.NET (30) C# (2) C/C ++ (92) CSS (1) Data Structure (3) Array (2) HTML (3) Java (36) JavaScript (5) PHP (22) VB.NET (13) VHDL (38) Visual Basic (4) Project Reports (2) Projects (154) 12th Class (6) BCA / MCA (110) Computer Science (122) Electrical Projects (5) Electronics (22) Mechanical / Civil BTech (2) Mini Project (10) Quiz (1) C++ Quiz (1) Robotics (2) VLSI (4)

Latest Talks

Online Shopping Cart System Project in PHP and Mysql Medical Store Inventory System Project in C++ Payroll Management System Project in Java Online Advertising System Project in Java Online Air Ticket Booking System Project in ASP.NET

Recent Comments
Ravi on Attendance Management System Project in PHP with Report hnoo on VHDL BCD to 7 Segment Decoder Project lalit on Job Portal Project in ASP.NET with C# Download Anshul on Library Management System Project in VB with Report Narender on Download Ebook Shopping Project in JSP With Report

CodingTalks Tweets


12th class 2012 2013 Array

ASP.NET Based bca by


C++ C/C++ code codingcodingtalks download FinalFinal

Year Find Function ideas IGNOUin


java JavaScript LISTmanagement Matlab NumberOnline PHP print programpro

code Store String

project projectsreport


system tutorial VB vb.netvhdl with Report Year

2014 CodingTalks. All rights reserved. Google+ | Privacy Policy | Contact Us .