FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-21-2010, 02:53 AM
rickman
Guest
 
Posts: n/a
Default Legal syntax for VHDL expression

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
  #2 (permalink)  
Old 02-21-2010, 02:57 AM
Alan Fitch
Guest
 
Posts: n/a
Default Re: Legal syntax for VHDL expression

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
Reply With Quote
  #3 (permalink)  
Old 02-21-2010, 03:07 AM
rickman
Guest
 
Posts: n/a
Default Re: Legal syntax for VHDL expression

On Feb 20, 8:57*pm, Alan Fitch <[email protected]> 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

Bookmarks

Thread Tools
Display Modes

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: VHDL syntax Andy VHDL 0 04-24-2007 03:32 PM
VHDL syntax Grumps VHDL 9 04-23-2007 11:36 PM
Expression sizing: VHDL vs. Verilog Martin Vass VHDL 3 03-15-2007 02:10 PM
Expression sizing: VHDL vs. Verilog Martin Vass Verilog 3 03-15-2007 02:10 PM
A question about syntax of VHDL Jim Huang VHDL 6 04-24-2005 05:28 PM


All times are GMT +1. The time now is 12:07 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved