How it works
Binary uses only 0 and 1, with each position representing a power of 2. Decimal 45 = 32+8+4+1 = 101101₂. Hex (base 16) uses digits 0–9 and A–F; each hex digit represents exactly 4 binary bits, so binary-to-hex conversion groups bits in fours from the right: 1010 1111₂ = AF₁₆. Octal groups bits in threes: 101 011₂ = 53₈. For negative binary numbers, 1's complement flips all bits; 2's complement adds 1 to the 1's complement result. Subtraction using 2's complement: to compute 9 − 5 in 8-bit binary, form 2's complement of 5 = 11111011₂, add to 00001001₂, and the carry-out is discarded, leaving 00000100₂ = 4. BCD (Binary Coded Decimal) encodes each decimal digit separately in 4 bits: 97 in BCD = 1001 0111.
Key points to remember
Decimal to binary: repeatedly divide by 2 and collect remainders from bottom up. Hex to decimal: multiply each digit by its power of 16 and sum. BCD is not the same as binary — 99 in binary is 1100011₂ (7 bits), but in BCD it is 1001 1001 (8 bits), a crucial distinction. 2's complement of an n-bit number: flip all bits and add 1, OR subtract the number from 2ⁿ. In an 8-bit system, the range of signed 2's complement is −128 to +127; for unsigned, 0 to 255. Overflow in 2's complement addition occurs when the carry into the MSB differs from the carry out of the MSB — this flag is checked by ALUs automatically.
Exam tip
The examiner always asks you to convert between decimal, binary, octal, and hex — practice converting 75₁₀ to all three forms and finding the 2's complement of a given binary number, as these appear as short-answer questions in every paper.