Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > hex notation

Reply
Thread Tools

hex notation

 
 
Andreas H?lscher
Guest
Posts: n/a
 
      12-10-2003
Hi,
I have code like this:

cs_reg <= '1' when Adr = conv_std_logic_vector(21, else '0';

To get my code more readable I want to use hexadecimal numbers for the
address. I tried to replace the 21 with 0x15, 15h, x"15" but nothing
works.

Any hint?

Thanks,
Andreas
 
Reply With Quote
 
 
 
 
Matt North
Guest
Posts: n/a
 
      12-10-2003
"Andreas H?lscher" <> wrote in message
news: om...
> Hi,
> I have code like this:
>
> cs_reg <= '1' when Adr = conv_std_logic_vector(21, else '0';
>
> To get my code more readable I want to use hexadecimal numbers for the
> address. I tried to replace the 21 with 0x15, 15h, x"15" but nothing
> works.
>
> Any hint?
>
> Thanks,
> Andreas


X"15" does work but the target type has to be of bit_vector.

------------------------------------
signal Adr: bit_vector(7 downto 0);

cs_reg<='1' when Adr=X"15" else '0';
------------------------------------

The conversion function to_bitvector is found in the package std_logic_1164
and converts type std_logic_vector and std_ulogic_vector.

Matt


 
Reply With Quote
 
 
 
 
Egbert Molenkamp
Guest
Posts: n/a
 
      12-10-2003

> X"15" does work but the target type has to be of bit_vector.
>
> ------------------------------------
> signal Adr: bit_vector(7 downto 0);
>
> cs_reg<='1' when Adr=X"15" else '0';
> ------------------------------------

In VHDL'87 "Adr" should be a bit_vector.
Since VHDL-1993 this is replaced such that it is only required that an
element of the vector at least contains the character literals '0' and '1'.
So bit_vector is still valid, but also std_logic_vector, std_ulogic_vector,
unsigned,...

Egbert Molenkamp


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert Infix notation to postfix notation Tameem C Programming 441 11-30-2009 08:07 AM
Hungarian Notation Vs. Pascal Notation? Grey Squirrel ASP .Net 6 03-21-2007 09:42 AM
Hex Color Codes - Hex 6 <=> Hex 3 lucanos@gmail.com HTML 10 08-18-2005 11:21 PM
hex(-5) => Futurewarning: ugh, can't we have a better hex than '-'[:n<0]+hex(abs(n)) ?? Bengt Richter Python 6 08-19-2003 07:33 AM
Dot notation V Bracket notation Robert Mark Bram Javascript 3 07-05-2003 03:59 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57