![]() |
|
|
|||||||
![]() |
VHDL - How do I fix this conversion problem? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 "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** 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 |
|
|
|
|
#2 |
|
Posts: n/a
|
Hi,
Simply : rx_data_out <= Std_Logic_Vector(tmp_us); Best regards. Alain |
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |