hex rep. in VHDL

hi, I have a small query in VHDL language. Like we write in Verilog fifo_data

Reply to
anupam
Loading thread data ...

Reply to
Mark McDougall

anupam schrieb:

AFAIK this works only if the bus width is a integer multiple of four.

Regards Falk

Reply to
Falk Brunner

Anupam, X"AA4F" should work, which simulator do you use? I believe this is a VHDL-93 feature and it is amazing that even in 2005 end (almost 13 years!!) some tools require a Mode-93 kind of switch to their compilers.

Your compiler may need a -V93 or some thing similar.

HTH Ajeetha

formatting link

Reply to
ajeetha

I always use this(fifo_data

Reply to
gkirilov

Yes, it does, which is *really* annoying!!!

Why they dont allow something like... foo(4 downto 0)

Reply to
Mark McDougall

A dog barking all night or an IRS audit is *really* annoying.

I can tolerate foo(4 downto 0)

Reply to
Mike Treseler

Warning #1034: X"1F" width 8 truncated to width 5 in assignment.

Regards, Mark

Reply to
Mark McDougall

Here's the deal: The hex notation X"1F" etc was a hack introduced in VHDL-93 to answer users' concerns that they wanted a simple way to write hex literals of vector type.

The "right" way to do it, of course, is...

... use ieee.numeric_std.all; ... signal vec: std_logic_vector(4 downto 0); ... vec

Reply to
Jonathan Bromley

Yes. Your example has a width mismatch. Those above do not. Try it and see.

-- Mike Treseler

Reply to
Mike Treseler

Not quite sure what point you're making here Mike?!?

Anyway, to kill the thread, let's agree to disagree. I come from a software background, which might explain why I'm lazy and spoilt with feature-rich languages and powerful pre-processors. ;)

Regards, Mark

Reply to
Mark McDougall

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.