Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Can I group certain conditions using CASE statements?

Status
Not open for further replies.

aeneas81

Junior Member level 1
Joined
Jun 14, 2004
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
198
Beginner's Questions

Hi all, is there anyway I can group certain condition together when using CASE statements?
such as

CASE input_vector IS
WHEN "001" AND "010" => blah blah..

The above command doesn't work, coz the compiler ANDed the 001 and 010 together, instead of treating them as seperate conditions.

Thanks for help!
 

Re: Beginner's Questions

try this style:

process
variable Code_of_Operation : INTEGER range 0 to 2;
constant Variable_1 : INTEGER := 0;

begin
case Code_of_Operation is
when Variable_1 | Variable_1 + 1 =>
Operation := 0;
when Variable_1 + 2 =>
Operation := 1;
end case;
end process;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top