Case statement syntax

F

Fred

Guest
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,
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 mailto:Jim@SynthWorks.com
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
"Jim Lewis" <Jim@SynthWorks.com> wrote in message
news:11rl6t34ck8t4d3@corp.supernews.com...
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.
 

Welcome to EDABoard.com

Sponsor

Back
Top