Two Complement Calculator
Result in the target base
-101010
Number Base Converter and Binary Calculator
Decimal value
-42
Binary
-101010
Octal
-52
Hexadecimal
-2a
Decimal value (numeric)
-42
Bits needed (magnitude)
6
Two's complement pattern
11010110
One's complement pattern
11010101
Unsigned value of that pattern
214
Binary in nibbles
0010 1010
Worked out from Donald E. Knuth, The Art of Computer Programming, Volume 2: Seminumerical Algorithms, section 4.1 (Positional Number Systems) and 2 other sources.
How this is worked out
2 steps
- "-42" read in base 10 is -42 in decimal.
- -42 in base 2 is -101010.
Results are general information, not financial, tax, legal, medical or engineering advice.