with-select construct question

N

nick.kigs

Hi all.

Is it possible/allowed to use more than one condition in the when
clause of a with-select construct? In other words, can I say something
like

with S select
Y <= I(0) when "00" and something else is true

It doesnt even have to be a with-select..it could be a when -else
construct too. What would be the syntax for that part? Im new to VHDL
and im using notepad so I cant test it out. Any help is appreciated.

Nick./
 
B

backhus

Hi all.

Is it possible/allowed to use more than one condition in the when
clause of a with-select construct? In other words, can I say something
like

with S select
Y <= I(0) when "00" and something else is true

It doesnt even have to be a with-select..it could be a when -else
construct too. What would be the syntax for that part? Im new to VHDL
and im using notepad so I cant test it out. Any help is appreciated.

Nick./


Hi Nick,
Not really sure what u want to do, because you just present one line of
code, but maybe this is of some use for you:

Y<= I(to_integer(S)) when condition else Y_default;

Otherwise why don't you use processes, where you can nest nearly
everything like this:

process(S, other sigs)
begin
case S is
when "00" <= if condition then
Y<= I(0);
else
Y<= Y_default;
end if;
when others <= other stuff;
end case;
end process;
 
T

Thomas Stanka

HI,

Is it possible/allowed to use more than one condition in the when
clause of a with-select construct? In other words, can I say something
like

with S select
Y <= I(0) when "00" and something else is true

It doesnt even have to be a with-select..it could be a when -else
construct too. What would be the syntax for that part? Im new to VHDL
and im using notepad so I cant test it out. Any help is appreciated.

The with-select allows only one signal to select the condition. You
should use

Y <= I(0) when S="00" else
I(1) when T='0' else
I(2) when ((int_sig=3 and bool_sig=True) or (counter>100)) else
I(3);

bye Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top