Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Process Statements in VHDL

Reply
Thread Tools

Process Statements in VHDL

 
 
samsky electronique
Guest
Posts: n/a
 
      05-21-2005
Hi I have a question

Here is an example

process(sig1,sig2,A,B,C)
begin
if (A > "001" and B > "010") then
sig1 <= '1';
else
sig1 <= '0';
end if;

if (C > "011" and sig1 = '0') then
sig2 <= '1';
else
sig2 <= '0';
end if;

end process;

It this advisable to write code like this, or should sig1 be in a
different process. What generally happens when a signal is assigned to
and also read to in the same process. What would happen if i have the
sig1 if-then-else statement, below the sig2 if-then-else statement, how
would the simulator behave ?

appreciate all the detail that I can get.

 
Reply With Quote
 
 
 
 
Ralf Hildebrandt
Guest
Posts: n/a
 
      05-22-2005
samsky electronique wrote:

> process(sig1,sig2,A,B,C)
> begin
> if (A > "001" and B > "010") then
> sig1 <= '1';
> else
> sig1 <= '0';
> end if;
>
> if (C > "011" and sig1 = '0') then
> sig2 <= '1';
> else
> sig2 <= '0';
> end if;
>
> end process;
>
> It this advisable to write code like this, or should sig1 be in a
> different process.


I would suggest to use a 2nd process for sig2, because to avoid
unnessecary computation for the simulator.

If signal A changes, the simulator has to evaluate the if-condition for
sig2 too, but this is a waste of computation.

The test for sig1 = '0' tests always the /old/ value of sig1. If sig1
has changed, sig2 will not be updated in the same simulator step. But
this does not lead to problems, because the sensitivity list is complete
and therefore the process is trigered again after sig1 has changed und
then the if-condition for sig2 ist evaluated using the new correct value
for sig1.

-> It is not wrong to code it so, but may be misleading if you read the
code later and leads to unnessecary computation of the simulator.


Ralf
 
Reply With Quote
 
 
 
 
aaaaaa
Guest
Posts: n/a
 
      05-26-2005
Hi,
Yes, u can assign the two signals in a process but the difference will be
like as---
value of sig1 will be updated when the process is ended and so the last
sig1 value will be checked on the same process.
rgds
Anupam Garg


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if statements and case statements questions John Crichton Ruby 6 07-12-2010 06:17 PM
Prepare Statements VS Statements Vince Java 12 01-21-2008 01:18 PM
VHDL-2002 vs VHDL-93 vs VHDL-87? afd VHDL 1 03-23-2007 09:33 AM
component statements within architecture statements Neil Zanella VHDL 8 10-20-2006 09:05 AM
if statements with or w/o else statements Harry George Python 6 02-23-2004 06:48 PM



Advertisments