Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Case statement syntax

 
Thread Tools Search this Thread
Old 01-03-2006, 03:33 PM   #1
Default Case statement syntax


Not sure the best way to do this. Using Xilinx ISE 7.1. This is all in a
"clocked" if statement.

I was intending to use a case statement where there might be some "don't
care" bits in the "when" range.

case expression(2 downto 0)
when "0xx"
perform this
when "100"
perform that
etc

How can I concatenate a number of when expressions.

case expression(2 downto 0)
when "000"
perform this
when "001"
perform that
when "010"
perform this
when "011"
perform that

etc

Where "perform this" may be a long series of expressions.

Is there a better way of doing it?




Fred
  Reply With Quote
Old 01-03-2006, 03:43 PM   #2
Jim Lewis
 
Posts: n/a
Default Re: Case statement syntax
Fred,
Use a '|' to separate case choices.
For your first example:

case expr(2 downto 0) is
when "000" | "001" | "010" | "011" =>
> perform this
> when "100" =>
> perform that


In VHDL-2006 there is a _proposal_ for a case statement
with a don't care, however, that will not do you any good
on the short term.

Cheers,
Jim


> I was intending to use a case statement where there might be some "don't
> care" bits in the "when" range.
>
> case expression(2 downto 0)
> when "0xx"
> perform this
> when "100"
> perform that
> etc
>


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
Jim Lewis
Director of Training private.php?do=newpm&u=
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~


Jim Lewis
  Reply With Quote
Old 01-09-2006, 09:06 AM   #3
Fred
 
Posts: n/a
Default Re: Case statement syntax

"Jim Lewis" <> wrote in message
news:...
> Fred,
> Use a '|' to separate case choices.
> For your first example:
>
> case expr(2 downto 0) is
> when "000" | "001" | "010" | "011" =>
> > perform this
> > when "100" =>
> > perform that

>
> In VHDL-2006 there is a _proposal_ for a case statement
> with a don't care, however, that will not do you any good
> on the short term.
>
> Cheers,
> Jim
>
>
>> I was intending to use a case statement where there might be some "don't
>> care" bits in the "when" range.
>>
>> case expression(2 downto 0)
>> when "0xx"
>> perform this
>> when "100"
>> perform that
>> etc
>>

>


Bit late I know but - many thanks.




Fred
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cooler Master Gladiator 600 Case Admin Front Page News 0 07-10-2009 10:52 AM
ThermalTake DH 102 Home Theater Case Admin Front Page News 0 06-12-2009 08:22 AM
Lian Li Tyr PC-X500 Case Review Admin Front Page News 0 07-11-2008 09:02 PM
Judge: File-swapping tools are legal Citizen Bob DVD Video 140 11-08-2006 06:42 PM
Enermax Phoenix Case @ ThinkComputers.org Silverstrand Front Page News 0 10-20-2006 12:28 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46