Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Data conversion: complex, real, std_logic_vector...

 
Thread Tools Search this Thread
Old 10-19-2004, 02:54 PM   #1
Default Data conversion: complex, real, std_logic_vector...


Hello, I´m new in this forum and first of all hello and thanks other
members.
I have to implement a VHDL program which uses complex numbers and I use
math_complex library which have a function called cmplx whitch can convert
a real number in a complex one.
The problem is that I need to use an std_logic_vector input, and I can´t
convert this input in real.
Can anyone help me?

Thanks for all!



eneko
  Reply With Quote
Old 10-19-2004, 06:25 PM   #2
mike_treseler
 
Posts: n/a
Default Re: Data conversion: complex, real, std_logic_vector...
You can cast integer to real something like:
real_v := real(to_integer(unsigned(std_c)));
See the details below.

-- Mike Treseler

--__________________________________
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.math_real.all;

entity std2real is
end std2real;

architecture sim of std2real is begin
-- Tue Oct 19 10:11:39 2004 Mike Treseler

what : process is
constant std_c : std_logic_vector := x"81";
variable real_v : real;
begin
real_v := real(to_integer(unsigned(std_c)));
assert real_v = real(16#81#)
report "conversion error";
wait;
end process what;
end sim;




mike_treseler
  Reply With Quote
Old 10-20-2004, 03:39 PM   #3
eneko
 
Posts: n/a
Default Re: Data conversion: complex, real, std_logic_vector...
Thanks a lot mike, I`m very pleased.



eneko
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wonderful data input with web reporting tool freezea Software 0 09-09-2009 05:30 AM
Address Bus and External Data Bus Confusion LoXodonte A+ Certification 1 04-18-2006 10:09 PM
New Releases: Troy, Ultimate Matrix & status changes: Updated complete downloadable R1 DVD DB & info lists Doug MacLean DVD Video 1 08-31-2004 01:02 PM
Re: Backing up data to reinstall or replace a Operating system? Barry Watzman A+ Certification 0 08-21-2003 06:59 PM
Re: 7. The truth about our creator. .7 john smith DVD Video 2 07-25-2003 03:54 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

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