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

Discussion in 'VHDL' started by Kelvin, Sep 13, 2003.

  1. Kelvin

    Kelvin Guest

    u had better put something in the else{}, otherwise you get a latch.
     
    Kelvin, Sep 13, 2003
    #1
    1. Advertisements

  2. Kelvin

    Kelvin Guest

    In the first if statement, "if rst = '1' then count <= 0; elsif clk'event
    and clk = '1' then", you don't need an "else" if I remember the syntax
    correctly.
    In second if statement, you may replace the null with assignments, just to
    make the statement complete. for example,

    if rst = '1' then
    count <= 0;
    elsif clk'event and clk = '1' then
    if (INPUTEND = '1') then
    ...
    A <= B+C;
    else
    -- null;
    A <= A;
    end if;
    -- else
    -- null;
    end if;
     
    Kelvin, Sep 13, 2003
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.