|
Number | Divided by | Result | Remainder |
19 9 4 2 1 |
2 2 2 2 2 |
9 4 2 1 0 |
1 1 0 0 1 |
1910 | 100112 |
Number | Divided by | Result | Remainder |
453 28 1 |
16 16 16 |
28 1 0 |
5 C 1 |
45310 | 1C516 |
Multiply the 1s in a binary number by their positional values, then sum the products.
256 |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
||||
Segment the binary number into groups of four digits each.
Refer to an equivalence table.
0=0000, 1=0001, 2=0010, 3=0011, 4=0100, 5=0101, 6=0110, 7=0111, 8=1000, 9=1001, A=1010, B=1011, C=1100, D=1101, E=1110, F=1111
Assign each group of four binary digits its hexadecimal equivalent.
110001012 = 1100 0101 = C516
Hexadecimal to Binary
Reverse the "Binary to Hexadecimal" process.
Refer to an equivalence table.
0=0000, 1=0001, 2=0010, 3=0011, 4=0100, 5=0101, 6=0110, 7=0111, 8=1000, 9=1001, A=1010, B=1011, C=1100, D=1101, E=1110, F=1111
Assign each hexadecimal digit its group of four binary digits.
3E716 = 0011 1110 0111 = 0011111001112
Hexadecimal to Decimal
Multiply the digits in a hexadecimal number by their positional values.
4294967296 |
268435456 |
16777216 |
1048576 |
65536 |
4096 |
256 |
16 |
1 |
||
768 |
14*16 224 |
|||||||||
16384 |
13*256 3328 |
96 |
11*1 |
Binary Arithmetic
Patrick J. Kidd -
The individual bits of a binary number are numbered as shown below (computers always count form zero instead of one!)
Bit number: 7 6 5 4 3 2 1 0
Binary code: 1 0 0 1 1 0 1 1
Bit 0 is sometimes called the least significant bit (lsb).
Bit 7 is sometimes called the most significant bit (msb).
Complementation
The rules for converting a negative decimal number to binary can be stated as follows:
True form: | 0000 1001 | +910 |
One's Complement: Add 00000001 |
1111 0110 0000 0001 |
XOR Add 1 |
Two's Complement: | 1111 0111 | -910 |
The easiest way of performing binary subtraction is to first convert the number to be subtracted to a negative number, and then add it. To subtract 12 from 15, using 1 byte for each number:
True form One's Complement Two's Complement |
0000 1100 1111 0011 0000 0001 1111 0100 |
+1210 XOR Add 1 -1210 |
0000 1111 1111 0100 0000 0011 |
15 +(-12) 3 |
For example, to add the binary equivalents of 3 and -3, add the two’s complement to 3.
True form One's Complement Two's Complement |
0000 0011 1111 1100 0000 0001 1111 1101 |
+310 XOR Add 1 -310 |
0000 0011 1111 1101 0000 0000 |
3 +(-3) 0 |
Note: The ‘carry’ of 1 is ignored.