conv_std_logic_vector

T

trescot

Hello

I am new to VHDL.

I have something like

CONV_STD_LOGIC_VECTOR(16#6800#,16);

what does it mean?


Thanks
Trescot
 
R

Ralf Hildebrandt

CONV_STD_LOGIC_VECTOR(16#6800#,16);

16#6800# is an integer to the base 16 (hexadecimal) and would be written
in C as 0x6800.

conv_std_logic_vector is a conversion function from a
non-standard-package and is NOT recommended to use! It converts an
integer to a std_logic_vector.
The function has two arguments: the integer value to be converted and an
integer number of bits. You can assign the result to a signal / variable
of type e.g. std_logic_vector(15 downto 0).

Ralf
 
Joined
Apr 21, 2010
Messages
1
Reaction score
0
Ralf so, could you write another way to do this conversion?
I use this function to assign a decimal value to std_logic_vector, because I don't like to recount my value every time to hexadecimal or binary. I have a variable length vector (the length was defined in generic section) and want to change it's value in VHDL test bench to do a simulation.
 
Joined
Jan 29, 2009
Messages
152
Reaction score
0
using only standard functions, this does the same conversion:

std_logic_vector(to_unsigned(16#6800#,16))
 
Joined
Dec 27, 2018
Messages
1
Reaction score
0
hello ,


LVL1 <= conv_std_logic_vector(A1+D1,6);
how can i convert this into verilog ?
can any one help me?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top