Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Legal syntax for VHDL expression

Reply
Thread Tools

Legal syntax for VHDL expression

 
 
rickman
Guest
Posts: n/a
 
      02-21-2010
I am writing a case statement and it doesn't seem to like an attribute
as a selection expression. Is an attribute not a legal item in an
expression?

It flags an error at the "of" on the first line saying 'keyword "is"
expected'
and at the beginning of the last line shown here saying 'keyword "end"
expected'

case LFSRReg'high of
when 2 =>
Feedback := Feedback xor LFSRReg(2);
Feedback := Feedback xor LFSRReg(1);
when 3 =>

I seem to get rusty on VHDL between projects, but I thought I knew how
to construct a case statement. Am I just getting old?

Rick
 
Reply With Quote
 
 
 
 
rickman
Guest
Posts: n/a
 
      02-21-2010
On Feb 20, 8:57*pm, Alan Fitch <(E-Mail Removed)> wrote:
> On 21/02/10 01:53, rickman wrote:
>
>
>
> > I am writing a case statement and it doesn't seem to like an attribute
> > as a selection expression. *Is an attribute not a legal item in an
> > expression?

>
> > It flags an error at the "of" on the first line saying 'keyword "is"
> > expected'
> > and at the beginning of the last line shown here saying 'keyword "end"
> > expected'

>
> > * * *case LFSRReg'high of
> > * * * * * *when 2 =>
> > * * * * * * *Feedback := Feedback xor LFSRReg(2);
> > * * * * * * *Feedback := Feedback xor LFSRReg(1);
> > * * * * * *when 3 =>

>
> > I seem to get rusty on VHDL between projects, but I thought I knew how
> > to construct a case statement. *Am I just getting old?

>
> > Rick

>
> The syntax is
> * case expression is
>
> so replace "of" by "is",
>
> regards
> Alan
>
> --
> Alan Fitch


Maybe I am working to hard. I even looked at a reference guide
several times and kept reading "of" instead of "is"... If I'm not
getting old, I guess I'm at least getting tired!

Thanks a lot for the *really* fast reply!

Rick
 
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
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" Adem C++ 42 11-04-2008 12:39 PM
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" Adem C Programming 45 11-04-2008 12:39 PM
VHDL-2002 vs VHDL-93 vs VHDL-87? afd VHDL 1 03-23-2007 09:33 AM
Legal syntax, bug or what? Jonathan Maasland Ruby 1 09-01-2006 10:35 AM
Syntax highligth with textile: Syntax+RedCloth ? gabriele renzi Ruby 2 12-31-2005 02:44 AM



Advertisments