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

Reply

VHDL - How do I fix this conversion problem?

 
Thread Tools Search this Thread
Old 09-08-2007, 09:04 AM   #1
Default How do I fix this conversion problem?


I am studying VHDL with this simple module, and the conversion between
std_logic_vector and
unsigned/signed is really troublesome!

I need all IOs to be in std_logic/vector, but inside some computations can
take on other
standards.

Thank you in advance!



# ** Error: ../RTL/channel_awgn.vhd(3: No feasible entries for subprogram
"to_bitvector".
# ** Error: ../RTL/channel_awgn.vhd(53): VHDL Compiler exiting
# C:/Programs/Modeltech_xe_starter/win32xoem/vcom failed.





library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use IEEE.math_real.uniform;

entity channel_awgn is
port (
clk_in : in std_logic;
rstn_in : in std_logic;

conv_in : in std_logic_vector(1 downto 0);
conv_en_in : in std_logic;
snr_in : in std_logic_vector(7 downto 0);

rx_data_out : out std_logic_vector(7 downto 0);
rx_en_out : out std_logic
);
end channel_awgn;

architecture channel of channel_awgn is

begin

process(clk_in, rstn_in)
variable seed1, seed2 : positive := 1;
variable a_real : real;
variable noise : integer;
variable tmp_us: unsigned(7 downto 0);
begin
if rstn_in = '0' then
rx_data_out <= (others=>'0');
elsif rising_edge(clk_in) then
uniform(seed1, seed2, a_real);
noise := natural(a_real * real(2** - 0.5);
if (conv_en_in = '1') then
tmp_us := unsigned('0' & conv_in & b"01000") + to_unsigned(noise, ;
rx_data_out <= to_StdLogicVector(to_bitvector(tmp_us)); <========
Here is line 38.
end if;
end if;
end process;

end channel;






G Iveco
  Reply With Quote
Old 09-08-2007, 10:13 AM   #2
Alain
 
Posts: n/a
Default Re: How do I fix this conversion problem?
Hi,

Simply :

rx_data_out <= Std_Logic_Vector(tmp_us);

Best regards.




Alain
  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
Error: expected constructor, destructor or type conversion before '(' token suse Software 0 03-09-2009 03:25 AM
Dial Up Problem smackedass A+ Certification 3 02-02-2007 11:59 PM
Re: Virus Problem ** Help!** David BlandIII A+ Certification 1 03-02-2004 06:00 PM
Re: Serious Computer Problem hootnholler A+ Certification 1 11-24-2003 12:18 PM
Re: Serious Computer Problem Bret A+ Certification 0 11-19-2003 12:51 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