1
$\begingroup$

What is the 1's and 2's complement of 0.01101? I'm unable to find any details on this from google.

Basically how do we represent the floating points in 1's and 2's complement forms?

Even wikipedia only says that 1's complement is the inverted bits of binary representation. The examples only contain integer values. I couldn't find anything clear about what is the exact significance of this system. Hence, unable to deduce if the inverting bits applies to floating points also.

$\endgroup$
3
  • $\begingroup$ @Raphael Even wikipedia only says that 1's complement is the inverted bits of binary representation. The examples only contain integer values. I couldn't find anything clear about what is the exact significance of this system. Hence, unable to deduce if the inverting bits applies to floating points also. $\endgroup$
    – aste123
    Commented Jan 7, 2016 at 13:56
  • 1
    $\begingroup$ AFAIK, 1s' and 2's complement only apply to integer and fixed points, not to floating point (but could apply to floating point sub-fields, it is quite common to have different systems of sign representation for exponent and significant BTW) $\endgroup$ Commented Jan 7, 2016 at 14:24
  • $\begingroup$ If this question was given to you by another person, did you check that the decimal was there on purpose? Some tools like excel remove leading zeros if a decimal is not inserted. $\endgroup$
    – Elmer
    Commented Jan 8, 2016 at 17:57

3 Answers 3

3
$\begingroup$

One's and two's complement apply to (fixed-point) encodings of integers. They don't apply to floating-point numbers. Floating point is different.

$\endgroup$
1
$\begingroup$

Other answers have noted that the two's complement and one's complement operations are only defined on integers or bundles of bits.

Having said that, these are common operations applied to the mantissa of a floating-point number (e.g. in Goldschmidt's division algorithm). However what you're really doing here is applying it to a fixed-point number, where the binary point is fixed after the first digit.

So, for example, if x=0.01101 is a mantissa, its one's complement is 1.10010 and its two's complement is 1.10011 (i.e. 2-x).

$\endgroup$
-1
$\begingroup$

If u want to find 1's complement of binary float numbers Use formula (r^n-r^-m-N) Eg 0.0110 Here r =2 base of binary no.

n is the number of digits in integer part but in this there is no digit in integer part so n=0 m is digit in fractional part N is our original Number

Now (r^n-r^-m-N) (2^0)-(2-4)-0.0110 (1)-(1/16)-0.0110 (1-1/16)-0.0110 (16-1/16)-0.0110 (15/16)-0.0110 (0.9375)-0.0110 Now we have convert. 0.9375 into binary which is =0.111 (0.1111)-(0.0110) 0.1001

$\endgroup$
2
  • $\begingroup$ Could you please format your answer, as it is a bit hard to read for now. Note you can use MathJax in this site. $\endgroup$
    – xskxzr
    Commented Apr 25, 2019 at 9:03
  • $\begingroup$ Could you add a generally-available reference to your formula and procedure? The accepted answer says one's complement does not apply to floating-point numbers. $\endgroup$
    – John L.
    Commented Apr 25, 2019 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.