Re: Can I do this?

Discussion in 'VHDL' started by Mike Treseler, Aug 29, 2008.

  1. 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, Aug 29, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob
    Replies:
    1
    Views:
    375
    Shawn B.
    Jan 12, 2004
  2. Richard Dixson
    Replies:
    1
    Views:
    498
    Joe Fallon
    May 18, 2004
  3. Rutger Smit
    Replies:
    1
    Views:
    538
    =?Utf-8?B?THVrZWI=?=
    Sep 6, 2004
  4. duncan
    Replies:
    2
    Views:
    6,070
  5. Casey Hawthorne
    Replies:
    1
    Views:
    700
    Arne Vajhøj
    Mar 18, 2009
Loading...

Share This Page