Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Converted signed 16 Bit to unsigned?

Reply
Thread Tools

Converted signed 16 Bit to unsigned?

 
 
Steffen Koepf
Guest
Posts: n/a
 
      12-14-2011

Hello,

I have a AD Converter that delivers a 16 Bit signed value 8000 - 0 - 7FFF

I want to convert this to unsigned 16 Bit from 0 - 8000 - FFFF

by

signal RecRegA : std_logic_vector (15 downto 0);

signal RecRegA1 : std_logic_vector (15 downto 0);


RecRegA1 <= std_logic_vector(unsigned(RecRegA) + 3276;


This works in the lower 3/4 range. But as soon as the result exceeds 7FFF
the result is unpredictable. Why?

Thanks in advance,

Steffen


 
Reply With Quote
 
 
 
 
Gabor
Guest
Posts: n/a
 
      12-14-2011
Steffen Koepf wrote:
> Hello,
>
> I have a AD Converter that delivers a 16 Bit signed value 8000 - 0 - 7FFF
>
> I want to convert this to unsigned 16 Bit from 0 - 8000 - FFFF
>
> by
>
> signal RecRegA : std_logic_vector (15 downto 0);
>
> signal RecRegA1 : std_logic_vector (15 downto 0);
>
>
> RecRegA1 <= std_logic_vector(unsigned(RecRegA) + 3276;
>
>
> This works in the lower 3/4 range. But as soon as the result exceeds 7FFF
> the result is unpredictable. Why?
>
> Thanks in advance,
>
> Steffen
>
>

That's a lot of conversions. All you really need to do is invert the
MSB of the first vector. What libraries are you using?

-- Gabor
 
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
What is the point of having 16 bit colour if a computer monitor can only display 8 bit colour? How do you edit 16 bit colour when you can only see 8 bit? Scotius Digital Photography 6 07-13-2010 03:33 AM
Convert 32 bit unsigned int to 16 bit signed int. Fore C++ 29 09-21-2008 05:55 AM
signed(12 downto 0) to signed (8 downto 0) kyrpa83 VHDL 1 10-17-2007 06:58 PM
64 bit - Windows Liberty 64bit, Windows Limited Edition 64 Bit, Microsoft SQL Server 2000 Developer Edition 64 Bit, IBM DB2 64 bit - new ! vvcd Computer Support 0 09-17-2004 08:15 PM
64 bit - Windows Liberty 64bit, Windows Limited Edition 64 Bit,Microsoft SQL Server 2000 Developer Edition 64 Bit, IBM DB2 64 bit - new! Ionizer Computer Support 1 01-01-2004 07:27 PM



Advertisments