Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > VHDL Beginner help

Reply
Thread Tools

VHDL Beginner help

 
 
tulio21z tulio21z is offline
Junior Member
Join Date: Nov 2010
Posts: 1
 
      11-14-2010
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.
 
Reply With Quote
 
 
 
 
jeppe jeppe is offline
Senior Member
Join Date: Mar 2008
Location: Denmark
Posts: 348
 
      11-14-2010
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL automate help, beginner Kleric VHDL 14 03-23-2012 07:33 PM
VHDL Beginner Help Alterah VHDL 1 11-06-2009 11:21 AM
VHDL-2002 vs VHDL-93 vs VHDL-87? afd VHDL 1 03-23-2007 09:33 AM
No Class at ALL!!! beginner/beginner question =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?= ASP .Net 7 02-03-2005 02:47 PM
Tutorial for beginner/ Tutorial voor beginner Rensjuh C++ 7 09-02-2004 12:41 AM



Advertisments