signed to unsigned

P

Patrick

hello,

I have to convert a signed signal to an unsigned one... I tried this code ?
What do you think about ? I just invert the sign bit (bit 13)...

But i forgot a part of resolution...


-- Conversion signed -> unsigned
CONV_US : process (clk_smp,reset)
begin
if reset = '1' then I_filter_14_US <= (others => '0');
Q_filter_14_US <= (others => '0');
elsif (clk_smp'event and clk_smp='1') then
I_filter_14_US(13 downto 13) <= not I_filter_14(13 downto 13);
I_filter_14_US(12 downto 0) <= I_filter_14(12 downto 0);
Q_filter_14_US(13 downto 13) <= not Q_filter_14(13 downto 13);
Q_filter_14_US(12 downto 0) <= Q_filter_14(12 downto 0);
end if;
end process CONV_US;
 
R

Ralf Hildebrandt

Patrick said:
I have to convert a signed signal to an unsigned one...

For conversions look into the packages, that are provided by your EDA
tool vendor.
If you use IEEE.numeric_stad.all, take the following piece of code:

A_us<=unsigned(B_s);


Ralf
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top