Numbering Systems
Familiarisation with the binary, octal and hexadecimal numbering systems and how each relates to decimal.
Numbering systems, summary notes
- A positional system gives each digit a weight of baseᵏ, counting k from 0 at the least-significant digit. Binary (base 2) weights are …16, 8, 4, 2, 1; octal is base 8; hexadecimal is base 16.
- Hexadecimal digits A, B, C, D, E, F represent decimal 10, 11, 12, 13, 14, 15, not 11-16.
- Binary converts to octal by grouping bits in THREES from the right, and to hexadecimal by grouping in FOURS from the right, padding the left-hand group with zeros.
- BCD (binary coded decimal) encodes each decimal digit as its own 4-bit group: 29 → 0010 1001. It is not the same as the plain binary value of 29 (1 1101). BCD wastes the codes 1010-1111 but makes decimal display driving trivial.
- Signed binary uses two's complement: invert every bit and add 1. The MSB is then the sign bit (1 = negative), and ordinary binary addition works for signed values with no special case.
- Octal is the natural shorthand for ARINC 429 labels; hexadecimal is the natural shorthand for memory addresses and byte data.
- ⚠ Exam trap: mis-grouping is the commonest error, octal groups in 3s, hexadecimal in 4s. Reading a hex answer as if it were BCD (or vice versa) is the second commonest.
- Positional value (base b)
- value = Σ (dₖ · bᵏ), k = 0 at the LSD
- Binary place values
- … 128 · 64 · 32 · 16 · 8 · 4 · 2 · 1
- Binary → octal
- group bits in 3s from the right
- Binary → hexadecimal
- group bits in 4s from the right
- Two's complement (n-bit)
- invert all bits, then add 1; MSB = sign
- Largest value in n bits
- 2ⁿ − 1 (unsigned)
Convert 1011 0110₂ to hexadecimal and to decimal.
Group in 4s: 1011 = B and 0110 = 6, so the value is B6₁₆. In decimal, add the place values where a 1 appears: 128 + 32 + 16 + 4 + 2 = 182₁₀.
Encode 45 in BCD, then represent −45 in 8-bit two's complement.
BCD takes each decimal digit separately: 4 → 0100 and 5 → 0101, giving 0100 0101. For two's complement, +45 = 0010 1101; invert to 1101 0010; add 1 to get 1101 0011. The leading 1 confirms a negative value.
Number-system converter
Numbering systems concept map
Numbering Systems
Numbering systems quiz
Numbering Systems, quiz (Level 1)
1. The binary numbering system uses which digits?
0 and 1 only0 to 70 to 92. Hexadecimal F represents which decimal value?
1514163. The octal numbering system has a base of:
81624. The hexadecimal numbering system has a base of:
168105. The binary number 101 equals which decimal value?
5376. Digital computers work internally in:
BinaryDecimalOctal7. BCD stands for:
Binary coded decimalBasic computer dataBit count divider8. Hexadecimal and octal are used mainly because they:
Express long binary numbers in a shorter formAre faster for the computer to processAvoid the need for binary altogether