Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can I do this?

0 views
Skip to first unread message

logitech

unread,
Aug 29, 2008, 1:13:21 PM8/29/08
to
Hi!
Can I do this:

if (flag = '1') then
flag <= '0';
....

Thanks!


Mike Treseler

unread,
Aug 29, 2008, 1:48:38 PM8/29/08
to
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

0 new messages