Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > how to convert real to std_logic

Reply
Thread Tools

how to convert real to std_logic

 
 
sajjadesrari sajjadesrari is offline
Junior Member
Join Date: Oct 2009
Posts: 2
 
      10-26-2009
hello
i'm new in vhdl
i want to convert real to std_logic
(in fact i want to put the real value to the output so first i should convert
it to std_logic right?)
how can i do it?
thanks.
 
Reply With Quote
 
 
 
 
jeppe jeppe is offline
Senior Member
Join Date: Mar 2008
Location: Denmark
Posts: 348
 
      10-26-2009
Try this:

vector_with_8bit <= conv_std_logic_vector( integer( r), 8 );
 
Reply With Quote
 
 
 
 
sajjadesrari sajjadesrari is offline
Junior Member
Join Date: Oct 2009
Posts: 2
 
      10-31-2009
thanks but i couldnt check it because
i have problem in converting std_logic to real!!!!
i did this:
real variable := to_real(to_integer(signed(std_logic value)));

but with this error:
Error (10305): VHDL Type Conversion error at xorgate.vhd(54): cannot convert type "std_logic" to type "SIGNED"

what's this????
thanks...
 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
convert boolean to std_logic manolis kaliorakis VHDL 2 12-17-2011 05:58 PM
Conversion from Real to Std_logic?? kwaj VHDL 1 02-11-2004 08:58 AM
SystemC std_logic resolved type zoro VHDL 2 07-05-2003 07:16 PM
Synthesis of STD_LOGIC Christopher Bunk VHDL 2 07-04-2003 07:08 AM



Advertisments