Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Re: Can I do this?

 
Thread Tools Search this Thread
Old 08-29-2008, 06:48 PM   #1
Default Re: Can I do this?


logitech wrote:

> Can I do this:
> if (flag = '1') then
> flag <= '0';


You can do it, but it may not do
what you expect, because the
value of flag is still '1'
until the end of the process.
(which often means the next clock cycle)

If I use a process variable instead of a signal
I would get an immediate update:
if flag_v = '1' then
flag_v := '0';
end if
-- flag value is '0' below here
....

But for internal nodes, this
is the same as just saying:

flag_v := '0';

I use boolean variable handshakes like this frequently
in single process entities.
Note that when I update such a flag,
the code below will see it on the the
same clock tick, but code above won't
see it until next tick.

-- Mike Treseler


Mike Treseler
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46