VHDL Beginner help

Joined
Nov 14, 2010
Messages
1
Reaction score
0
Hello friends
I'm new to vhdl and i'm having a lot of trouble.
If there is any soul kind enough to help me out i would be very gratefull.
I'm having dificulties in using nested if's. It should work since i based it on a code i found in a reference book...only that it isn't :s

The code is:

Library IEEE;
Use ieee.std_logic_1164.all;

entity TMR8BITS is
port
(
a,b,c: in std_logic_vector(7 downto 0);
s: out std_logic_vector(7 downto 0)
);
end TMR8BITS;

architecture corpo of TMR8BITS is
begin
A: PROCESS(a,b,c)
BEGIN
if ( a = b ) then
s <= a;
else if ( a = c ) then
s <= a;
else if ( b = c ) then
s <= b;
end if;
end process a;

end corpo;

--The error msg is:

Error (10500): VHDL syntax error at TMR8BITS.vhd(23) near text "process"; expecting "if"
Error (10500): VHDL syntax error at TMR8BITS.vhd(25) near text "corpo"; expecting "if"
Error: Quartus II Analysis & Synthesis was unsuccessful. 2 errors, 0 warnings
Error: Peak virtual memory: 258 megabytes
Error: Processing ended: Sat Nov 13 22:42:23 2010
Error: Elapsed time: 00:00:03
Error: Total CPU time (on all processors): 00:00:02
Error: Quartus II Full Compilation was unsuccessful. 4 errors, 0 warnings


Thanks is advance.
 
Joined
Mar 10, 2008
Messages
348
Reaction score
0
Ok - a quick answer.

1) For each IF must there be an END IF
or
2) In your example could ELSE IF be ELSIF and this will solve the errors

Your welcome
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top