R: decoder

M

Max

Guest
On Tue, 09 Sep 2003 16:52:11 +0200
"Amontec Team, Laurent Gauch" <laurent.gauch@amontecDELETEALLCAPS.com>
wrote:

Max wrote:
I write the following decoder:

ce <= "0001" when addr = "0--" else
"0010" when addr = "10-" else
"0100" when addr = "110" else
"1000";

it doesn't work.

Then I tried this one:

ce <= "0001" when addr(2) = '0' else
"0010" when addr(2 downto 1) = "10" else
"0100" when addr = "110" else
"1000";

this work.

why the first version doesn't work?
the symbol '-' means "don't care", isn't it? So why it is wrong?
I prefer something like the first version since is less cryptic.

thanks
I am interested by this issue. Which compiler are you using?
I use Xilinx Web Pack 5.2.
both versions compile fine without errors or warning but when I run the
first model in ModelSim 5.6 I don't obtain what I'm expecting: ce is
always "1000" except when addr is "110".


thanks
 
I already explained it in more detail. But ModelSim has the
switch -explicit.
try
vcom -explicit <filename>

and I guess the behavior is as you expect.

Egbert Molenkamp

"Max" <cialdi@firenze.net> schreef in bericht
news:8e077568.0309090659.3b16580b@posting.google.com...
On Tue, 09 Sep 2003 16:52:11 +0200
"Amontec Team, Laurent Gauch" <laurent.gauch@amontecDELETEALLCAPS.com
wrote:

Max wrote:
I write the following decoder:

ce <= "0001" when addr = "0--" else
"0010" when addr = "10-" else
"0100" when addr = "110" else
"1000";

it doesn't work.

Then I tried this one:

ce <= "0001" when addr(2) = '0' else
"0010" when addr(2 downto 1) = "10" else
"0100" when addr = "110" else
"1000";

this work.

why the first version doesn't work?
the symbol '-' means "don't care", isn't it? So why it is wrong?
I prefer something like the first version since is less cryptic.

thanks
I am interested by this issue. Which compiler are you using?
I use Xilinx Web Pack 5.2.
both versions compile fine without errors or warning but when I run the
first model in ModelSim 5.6 I don't obtain what I'm expecting: ce is
always "1000" except when addr is "110".


thanks
 

Welcome to EDABoard.com

Sponsor

Back
Top