Re: When do I always put a "else NULL" statement in my VHDL code?

Discussion in 'VHDL' started by Mike Treseler, Sep 12, 2003.

  1. walala wrote:

    >
    > I learned from books that I should exhaust all branches of "if"
    > statement, so I write in the following way:
    >
    > if rst = '1' then
    > count <= 0;
    > elsif clk'event and clk = '1' then
    > if (INPUTEND = '1') then
    > ...
    > else
    > null;
    > end if;
    > else
    > null;
    > end if;
    >
    >
    > But I also saw on the Internet sometimes people don't write code in my
    > cubersome way...


    First time I've seen it.

    >
    > Can anybody clarify a little for me? When I need to write this "else
    > null", and when I don't need it?



    It's just style.
    It will compile the same either way.
    Consider leaving out the
    else clause if you're not using it.

    -- Mike Treseler
    Mike Treseler, Sep 12, 2003
    #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. Kelvin
    Replies:
    1
    Views:
    3,113
    Kelvin
    Sep 13, 2003
  2. walala
    Replies:
    2
    Views:
    651
    Ken Smith
    Oct 11, 2003
  3. Jim Lewis
    Replies:
    1
    Views:
    511
    walala
    Sep 16, 2003
  4. Deryck
    Replies:
    4
    Views:
    502
    derek giroulle
    Jun 22, 2004
  5. afd
    Replies:
    1
    Views:
    8,238
    Colin Paul Gloster
    Mar 23, 2007
Loading...

Share This Page