(unsigned) weights (powers of two)
4096 2048 1024 512 256 128 64 32 16 8 4 2 1
To convert to binary, find out which powers of two are needed.
Start by subtracting the largest power of two that fits and repeat
for subsequent powers of two that fit:
365(d) = 256 + 109
= 256 + 64 + 45
= 256 + 64 + 32 + 13
= 256 + 64 + 32 + 8 + 5
= 256 + 64 + 32 + 8 + 4 + 1
= 0000 0001 0110 1101 (b)
-----
-52(d) = ? binary
This is a negative number. Pretend it is positive, convert it, then make
it negative by flipping all the bits and adding one (or by subtracting it
from zero):
Step 1: pretend it's positive and convert it to binary:
+52(d) = 32 + 20
= 32 + 16 + 4
= 0000 0000 0011 0100 (b)
Step 2: make it negative by subtracting from zero
(or use alternate method of reversing bits and adding 1):
0000 0000 0000 0000 (b)
- 0000 0000 0011 0100 (b)
______________________
= 1111 1111 1100 1100 (b)
Hit the "Back" button.