[SOLVED] -.5 representation in binary

Status
Not open for further replies.

dipin

Full Member level 4
Joined
Jul 16, 2014
Messages
223
Helped
14
Reputation
28
Reaction score
14
Trophy points
18
Activity points
1,731
hi ..

in division that includes fraction , i am using fixed point the division includes negative numbers too..but i have a problem . For negative numbers i am using 2's complement methode and i dont know how to represent (-.5) using 2's complement.
is it possible to represent numbres like -.25 ,-.125 in 2's complement form. In signed magnitude form it can implement, because there is -ve and +ve zeros . what about 2's complement form .if any body know this plz help

thanks & regards
 

To change sign, invert all bits and add '1' to the LSB.

0.5 = 0000.1000
-0.5 = 1111.0111 + 0000.0001 = 1111.1000
 
Reactions: dipin

    dipin

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…