M
Max
Guest
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
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