Don't care states in decoders 
Author Message
 Don't care states in decoders

How do you specify "don't care" states in address decoders for producing an
enable for a range of addresses?

Thanks.



Sat, 26 Mar 2005 16:13:46 GMT  
 Don't care states in decoders
The "when others" clause of a case statement should handle this situation quite well.
Quote:

> How do you specify "don't care" states in address decoders for producing an
> enable for a range of addresses?

> Thanks.



Sat, 26 Mar 2005 20:39:50 GMT  
 Don't care states in decoders
Sorry, this was probably worded badly.

How do you decode  a block of memory locations without explicitly stating
each one

e.g. I want to decode between addresses 0x0000 to 0x3FFF. (zero's on the top
two bits, the lower bits I don't care about)

I managed to do this by 'ripping' only the bits that I was interested in but
ideally it would be nice to write the full address using 'don't care'
symbols for the lower bits - as this is much more readable.

What is the syntax for this?


Quote:
> The "when others" clause of a case statement should handle this situation
quite well.


> > How do you specify "don't care" states in address decoders for producing
an
> > enable for a range of addresses?

> > Thanks.



Sat, 26 Mar 2005 23:15:58 GMT  
 Don't care states in decoders
Hi!

Richard Francis schrieb:

Quote:
> How do you specify "don't care" states in address decoders for producing an
> enable for a range of addresses?

Maybe converting to an std_logic_vector and using an case statement on
the MSB helps. If you need to specify the address range intoo more
detail in some blocks, you might cascade the case statements.

e.g.

case address(7 downto 6) is
        when "00" =>
        ...
        when "01" =>
        ...
        when "11" =>
                case address (5 downto 0) is
                        when "000000" => ...
                        when others => ...

Regards,
Patrick



Sun, 27 Mar 2005 00:28:41 GMT  
 Don't care states in decoders


Quote:
>You can specify don't care in case..when blocks thus:
>   case...

>   when "10------" => ...

Ummm.. no.

casex/casez in Verilog works like this, but VHDL does not.

std_logic comparisons are literal.  '-' matches neither '0' nor '1'.

The only don't care inference in VHDL is that an assignment of the form

   X <= '-';

represents a don't care, and can be optimized.  But the don't care cannot
be used as a comparison argument.



Sun, 27 Mar 2005 10:07:11 GMT  
 Don't care states in decoders
As stated you can't use the "0x0----", so just use the bits you are
interested in and then comment the lines anyway you want. That is what I
call readable. And that's why the comment lines are there, to comment...

regards,
juza

: How do you decode  a block of memory locations without explicitly stating
: each one

: e.g. I want to decode between addresses 0x0000 to 0x3FFF. (zero's on the top
: two bits, the lower bits I don't care about)

: I managed to do this by 'ripping' only the bits that I was interested in but
: ideally it would be nice to write the full address using 'don't care'
: symbols for the lower bits - as this is much more readable.

: What is the syntax for this?



:> The "when others" clause of a case statement should handle this situation
: quite well.
:>
:> > How do you specify "don't care" states in address decoders for producing
: an
:> > enable for a range of addresses?
:> >
:> > Thanks.
:> >
:> >
:>

--
Juza



Sun, 27 Mar 2005 15:33:39 GMT  
 Don't care states in decoders
Hi,

Quote:

> How do you specify "don't care" states in address decoders for producing an
> enable for a range of addresses?

As already posted by others, '-' does not represent
"don't cares" in case statements. For a solution
to the problem check out the FAQ:

        http://www.vhdl.org/comp.lang.vhdl/FAQ1.html#dont_cares

Another solution to your problem would be to convert
your address into an integer and then use it to
control the case statement. For integers the choices
may include ranges. E.g.,

signal adr : unsigned (0 to ??);
...

case to_integer (adr) is
when 0 to 100 => ...
when 101 to 1000 => ...
...
end case;

However, make sure that your address vector fits
into an integer (or natural in case of unsigned).

--
Edwin



Sun, 27 Mar 2005 17:03:19 GMT  
 Don't care states in decoders
If you use ieee.numeric_std, there is a function in there called std_match that
will take care of this for you.

std_match(addr, "-1001--"), for example returns a boolean that is true if addr
matches the 1 or 0 bits in the string.

Quote:

> How do you specify "don't care" states in address decoders for producing an
> enable for a range of addresses?

> Thanks.

--
--Ray Andraka, P.E.
President, the Andraka Consulting Group, Inc.
401/884-7930     Fax 401/884-7950

http://www.andraka.com

 "They that give up essential liberty to obtain a little
  temporary safety deserve neither liberty nor safety."
                                          -Benjamin Franklin, 1759



Mon, 28 Mar 2005 05:05:01 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. don't care the dryers strongly, mould them partly

2. don't care the dryers strongly, mould them partly

3. don't care the dryers strongly, mould them partly

4. Testing for unknowns or don't cares

5. Don't Care in a with...select?

6. Don't cares in expressions

7. Don't care in VHDL ???

8. How to deal with Don't cares

9. don't care in vhdl..

10. UnInit, Weak Unknown, Don't Care Signals

11. Don't cares in std_logic_vector

12. Don't care for integer?

 

 
Powered by phpBB® Forum Software