how to convert signed decimal to unsigned decimal?

Status
Not open for further replies.

quer

Junior Member level 1
Joined
Nov 17, 2007
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,365
signed decimal

please give me an example on how to do it..:|
 

unsigned decimal

The question isn't clear. Only positive numbers can be converted - without changing anything, just copy respectively typecast it. The bit pattern is identical.
 

convert signed to unsigned

sorry i mean how to convert numbers like -.023 (decimal) to unsigned decimal (ranging from 0 t 255).. actually i don't know if there is such process...
 

convert unsigned to signed

i need it also but in matlab
 

converting signed to unsigned

Aya2002 said:
i need it also but in matlab

yeah we are having the same problem
 

unsigned to signed converter

Two comments.
1. If an 8-bit integer (0..255) is representing a negative number like -0.023, it's not unsigned. It's e.g. a fixed point or fractional signed number. Of course you can display it as an unsigned, but it still contains a sign information.

2. You have to know the scaling of your target number format respectively the numeric range represented by it, than a conversion is easy. 0..255 may e.g. represent -1..+1. You can read it then as 2's complement signed value with a power of 2 scaling factor. (-128..127 *1/128). In this case, -0.023 converts to -3 respectively 253 or 0xfd when displayed as unsigned.
 

decimal to unsigned

explain more please with another example
 

signed to unsigned convert

I tried to give a sense to an unclear question by suggesting a number format and defining a range. I'd rather like to hear a complete question first.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…