1

I am trying to work on inserting if else to loop but it is still expecting some syntax. I cant figure out why this if/else statement wont compile. I am new to VHDL, please help. This is one of the steps along the way and i am stuck.


variable i : integer := 0;
    begin
        
        while i < 10 loop
            report "i=" & integer'image(i);
            i := i + 1;

    if i = 6 then
    report "okay good job";
    else i = 5 then
    report " okay nice work";
    else 
    report " not equal to 5 and 6";

        end loop;
        wait;
    end process;
end architecture;
1
  • IEEE Std 1076-1993 8. Sequential Statements, 8.7 If statement. in the BNF square brackets indicate optional items. sequence_of_statements ::= { sequential_statement }, where curly brackets indicate zero or more repetitions. Boldface denotes reserved words. Commented Mar 10, 2021 at 19:00

1 Answer 1

2

In VHDL, the keywords are if, elsif and else

if condition_1 then
  -- do something
elsif condition_2 then
  -- do something else
else
  -- do something when all other conditions are false
end if;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.