Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > HEX to STD_LOGIC_VECTOR

Reply
Thread Tools

HEX to STD_LOGIC_VECTOR

 
 
ALuPin@web.de
Guest
Posts: n/a
 
      05-09-2005
Hi,

I am trying to simulate the following in Modelsim:


use ieee.std_logic_arith.all;
use ieee.std_logic_1164.all;

signal t_wraddress : std_logic_vector(14 downto 0);

begin
....

-- Instead of writing t_wraddress <= ("00010" & "0000100010");
-- or t_wraddress <= "000100000100010";
-- I want
-- some shorter expressions like

t_wraddress(14 downto 10) <= to_stdlogicvector(x"02");
t_wraddress(9 downto 0) <= to_stdlogicvector(x"22");


But I get the warning:
# Ambiguous parameter type to function 'to_stdlogicvector'.
# Expression is illegal VHDL-1993 but legal VHDL-1987.

So how can I change that ?

I tried to find some answers in different posts but...

Thank you for your help.

Rgds
André

 
Reply With Quote
 
 
 
 
Niv
Guest
Posts: n/a
 
      05-09-2005
-- Instead of writing t_wraddress <= ("00010" & "0000100010");
-- or t_wraddress <= "000100000100010";
-- I want
-- some shorter expressions like

t_wraddress(14 downto 10) <= to_stdlogicvector(x"02");
t_wraddress(9 downto 0) <= to_stdlogicvector(x"22");

X"AB03" is a legal 16 bit std_logic_vector.
You're trying to assign X"22", an 8 bit vector to a 10 bit vector.
You shouldn't need the conversion function.

Try something like t_wradress(9 downto 0) <= "00" & X"22"; -- If you want
10 bit assignment

Regards, Niv.


 
Reply With Quote
 
 
 
 
Son Tran
Guest
Posts: n/a
 
      06-06-2005
Try this. It should work.
Split your address into two parts: 3-bit part + 12-bit part
In 12-bit part you can easily assign a hex number, keep binary the rest.

Then
t_wraddress <= "000100000100010";

is the same as

t_wraddress <= "000" & x"822";

Good luck
stt


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
Hi,

I am trying to simulate the following in Modelsim:


use ieee.std_logic_arith.all;
use ieee.std_logic_1164.all;

signal t_wraddress : std_logic_vector(14 downto 0);

begin
....

-- Instead of writing t_wraddress <= ("00010" & "0000100010");
-- or t_wraddress <= "000100000100010";
-- I want
-- some shorter expressions like

t_wraddress(14 downto 10) <= to_stdlogicvector(x"02");
t_wraddress(9 downto 0) <= to_stdlogicvector(x"22");


But I get the warning:
# Ambiguous parameter type to function 'to_stdlogicvector'.
# Expression is illegal VHDL-1993 but legal VHDL-1987.

So how can I change that ?

I tried to find some answers in different posts but...

Thank you for your help.

Rgds
André


 
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 assign a hex or decimal value to a std_logic_vector of length19 bits? gabor VHDL 6 12-30-2013 11:56 AM
inout std_logic_vector to array of std_logic_vector of generic length conversion... Thomas Rouam VHDL 6 11-09-2007 11:49 AM
How to print std_logic_vector variable into hex string in VHDL Carson VHDL 4 09-01-2005 02:59 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



Advertisments