MODULE 5 · SYLLABUS 5.2 · LEVEL 1

Chapter 2: Numbering Systems

Decimal, binary, octal and hexadecimal: place values, bits and bytes, and every conversion the syllabus asks for — plus the codes built on them that you meet on aircraft: BCD, Gray code, signed numbers and octal transponder codes.

8
Explainer slides
~30
Minutes reading
24
Flashcards
23
Quiz questions
Home › Courses › Module 5 › Chapter 2
🎬 Explainer video

Watch the 8-slide walkthrough

Narrated by your browser's text-to-speech voice — pick a voice and speed in the player bar. Press space to play/pause, arrow keys to change slide. No sound? It still plays with captions.

Read the full transcript
🎯 What you'll learn
  • Base (radix) and place value — decimal, binary, octal and hexadecimal
  • Bits, LSB and MSB, nibbles and bytes
  • Converting binary, octal and hexadecimal to decimal
  • Converting decimal to binary, octal and hexadecimal by repeated division
  • Short-cuts between binary, octal and hexadecimal by grouping bits
  • Codes used on aircraft: BCD, Gray code, two's complement, octal squawk codes
📖 The lesson

Why digital systems count in binary

A numbering system writes quantities with a set of symbols. The number of different symbols is the system's base or radix. We count in decimal (base 10) because we have ten fingers; digital electronics count in binary (base 2) because a transistor switch, a relay, a magnetic domain or a pulse of light has two reliable states — on or off, high or low, 1 or 0. Two states are easy to make, easy to tell apart even with noise, and easy to store.

Long strings of 1s and 0s are hard for people to read, so engineers write them more compactly in octal (base 8) or hexadecimal (base 16). Both convert to and from binary almost instantly. In maintenance you will see hexadecimal in fault codes, memory addresses and data-bus analyser readouts, and octal in ARINC 429 labels and ATC transponder codes.

To avoid confusion, the base is written as a subscript or with a prefix or suffix: 10112, 1011b or 0b1011 for binary; 178 for octal; 2AF16, 2AFh or 0x2AF for hexadecimal. "10" means ten in decimal, eight in octal, sixteen in hexadecimal and two in binary.

Place value

All four systems are positional: a digit's value depends on its place. The right-hand place is worth 1 (the base to the power 0), and each place to the left is worth the base times the place before it.

each place is worth the base × the place to its right Decimal base 10 · digits 0–9 10⁴ 10 000 10³ 1 000 10² 100 10¹ 10 10⁰ 1 Binary base 2 · digits 0, 1 2⁷ 128 2⁶ 64 2⁵ 32 2⁴ 16 2³ 8 2² 4 2¹ 2 2⁰ 1 Octal base 8 · digits 0–7 8⁴ 4 096 8³ 512 8² 64 8¹ 8 8⁰ 1 Hexadecimal base 16 · 0–9, A–F 16³ 4 096 16² 256 16¹ 16 16⁰ 1 the right-hand place is always worth 1 (base⁰) — in binary it holds the LSB
Place value. Every positional number system works the same way: each place is worth the base raised to a power, counting from 0 at the right. Decimal places go 1, 10, 100…; binary places go 1, 2, 4, 8, 16…; octal 1, 8, 64, 512…; hexadecimal 1, 16, 256, 4096…
  • Decimal: ten digits 0–9. 4 096 = 4×1 000 + 0×100 + 9×10 + 6×1.
  • Binary: two digits, 0 and 1, called bits (binary digits). Place values 1, 2, 4, 8, 16, 32, 64, 128… The right-hand bit is the least significant bit (LSB), the left-hand one the most significant bit (MSB).
  • Octal: eight digits 0–7. Place values 1, 8, 64, 512, 4 096. After 7 comes 108.
  • Hexadecimal: sixteen digits — 0–9 then A=10, B=11, C=12, D=13, E=14, F=15. Place values 1, 16, 256, 4 096. After F comes 1016.
  • Groups of bits: 4 bits = a nibble (one hex digit), 8 bits = a byte; a word is the size a computer handles at once, typically 16, 32 or 64 bits (Chapter 6).
  • With n bits you can make 2n different codes, from 0 up to 2n − 1. Eight bits give 256 codes (0–255); twelve bits 4 096 (0–4 095); sixteen bits 65 536.
DecimalBinaryOctalHexDecimalBinaryOctalHex
000000081000108
100011191001119
200102210101012A
300113311101113B
401004412110014C
501015513110115D
601106614111016E
701117715111117F

Learn this table — every other conversion is built on it. Note that 1610 = 100002 = 208 = 1016.

Converting to decimal

Multiply each digit by its place value and add the results.

  • Binary: 1011 01102 = 128 + 32 + 16 + 4 + 2 = 182. Only the places holding a 1 count.
  • Octal: 2668 = 2×64 + 6×8 + 6×1 = 128 + 48 + 6 = 182.
  • Hexadecimal: B616 = 11×16 + 6×1 = 176 + 6 = 182. Another example: 2AF16 = 2×256 + 10×16 + 15 = 687.

Converting from decimal

Divide the decimal number by the new base again and again, writing down each remainder, until the quotient is 0. The first remainder is the least significant digit, so the answer is the remainders read from the last to the first.

Decimal → binary: divide by 2, keep the remainders 156 ÷ 2 = 78 remainder 0 LSB 78 ÷ 2 = 39 remainder 0 39 ÷ 2 = 19 remainder 1 19 ÷ 2 = 9 remainder 1 9 ÷ 2 = 4 remainder 1 4 ÷ 2 = 2 remainder 0 2 ÷ 2 = 1 remainder 0 1 ÷ 2 = 0 remainder 1 MSB read the remainders upwards 156₁₀ = 1001 1100₂ Binary → decimal: add the weights of the 1s 128 1 64 0 32 0 16 1 8 1 4 1 2 0 1 0 128 + 16 + 8 + 4 = 156 Decimal → octal or hex: the same method, dividing by 8 or by 16 500 ÷ 16 = 31 r 4 · 31 ÷ 16 = 1 r 15 (F) · 1 ÷ 16 = 0 r 1 500₁₀ = 1F4₁₆
The two basic conversions. To go from decimal, divide repeatedly by the new base and write down the remainders; the first remainder is the least significant digit, so read them from the bottom up. To go to decimal, multiply each digit by its place value and add.
  • To binary: 156 → remainders 0, 0, 1, 1, 1, 0, 0, 1 → read upwards: 1001 11002. Check: 128 + 16 + 8 + 4 = 156.
  • An alternative for binary is subtraction of weights: take the largest place value that fits (128), put a 1 there and subtract (156 − 128 = 28); the next that fits is 16 (28 − 16 = 12), then 8 (12 − 8 = 4), then 4 (0). Every other place gets a 0.
  • To octal: 500 ÷ 8 = 62 r 4; 62 ÷ 8 = 7 r 6; 7 ÷ 8 = 0 r 7 → 7648.
  • To hexadecimal: 500 ÷ 16 = 31 r 4; 31 ÷ 16 = 1 r 15 (F); 1 ÷ 16 = 0 r 1 → 1F416. Remainders of 10–15 are written A–F.

Binary, octal and hexadecimal short-cuts

Because 8 = 2³ and 16 = 2⁴, each octal digit stands for exactly three bits and each hexadecimal digit for exactly four. No arithmetic is needed — just group the bits.

Binary ↔ octal ↔ hexadecimal — group the bits from the right hex: groups of 4 2 0010 A 1010 F 1111 0 0 1 0 1 0 1 0 1 1 1 1 octal: groups of 3 1 001 2 010 5 101 7 111 0 0 1 0 1 0 1 0 1 1 1 1 0010 1010 1111₂ = 2AF₁₆ = 1257₈ = 687₁₀ add leading zeros to fill the left-hand group · convert octal ↔ hex by going through binary
The short-cut. One hexadecimal digit is exactly 4 bits and one octal digit exactly 3 bits, because 16 = 2⁴ and 8 = 2³. Split the binary number into groups starting from the right and replace each group with its digit — or do the reverse, writing each hex or octal digit as 4 or 3 bits.
  • Binary → hex: split into groups of four from the right (add leading zeros if needed): 1101 0110 1011 → D 6 B → D6B16.
  • Binary → octal: groups of three from the right: 110 101 101 011 → 6 5 5 3 → 65538. (Both equal 3 43510.)
  • Hex or octal → binary: write each digit as 4 or 3 bits: F316 = 1111 0011; 758 = 111 101.
  • Octal ↔ hex: go through binary. 12578 = 001 010 101 111 = 0010 1010 1111 = 2AF16.
Quick checks

An even binary number ends in 0; an odd one ends in 1. The largest number in n bits is 2n − 1, so FF16 = 1111 11112 = 3778 = 255. A hex digit can never be above F, and an octal digit never above 7 — "8" or "9" in a number means it cannot be octal.

Binary arithmetic and signed numbers

  • Addition follows four rules: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 0 carry 1, 1 + 1 + 1 = 1 carry 1. For example 0110 (6) + 0111 (7) = 1101 (13).
  • Negative numbers are usually held in two's complement: the MSB is the sign bit (0 = positive, 1 = negative). To negate a number, invert every bit and add 1: +5 = 0000 0101, so −5 = 1111 1011. An 8-bit two's complement number covers −128 to +127. Computers subtract by adding the two's complement.
  • Fractions continue the place values to the right of the binary point: 0.12 = ½, 0.012 = ¼, so 0.1012 = 0.625.

Codes used on aircraft

BCD — each decimal digit in 4 bits 5 0101 9 1001 59₁₀ = 0101 1001 (BCD) but 59₁₀ = 0011 1011 in pure binary Octal squawk code — 4 digits × 3 bits 7 111 7 111 0 000 0 000 digits 0–7 only · 12 bits · 8⁴ = 4 096 codes (there is no 8 or 9 on a transponder) Gray code — one bit changes per step dec binary Gray 0 000 000 1 001 001 2 010 011 3 011 010 4 100 110 5 101 111 6 110 101 7 111 100 Two's complement (signed numbers) +5 = 0000 0101 invert → 1111 1010, add 1 → −5 = 1111 1011 Where you meet them BCD: ARINC 429 BCD words, frequencies, clocks Octal: ATC codes, 429 labels Gray: shaft and altitude encoders (Gillham code)
Codes built on binary. BCD codes each decimal digit separately in four bits — easy to display, but wasteful. A transponder code is four octal digits, giving 4 096 codes. In Gray code only one bit changes between neighbouring values, so a position encoder can never read a wildly wrong value while it moves. Two's complement lets binary represent negative numbers.
  • Binary-coded decimal (BCD, 8421 code): each decimal digit is coded separately in four bits. 59 = 0101 1001 in BCD (but 0011 1011 in pure binary). The codes 1010–1111 are unused. BCD is easy to drive digital readouts from and is used in ARINC 429 BCD words such as radio frequencies, time and distance.
  • Octal: an ATC transponder code is four octal digits (0000–7777): 12 bits and 4 096 codes. ARINC 429 word labels are also written as three octal digits (Chapter 4).
  • Gray code: only one bit changes between consecutive values. Shaft encoders and the encoding altimeter's Gillham code use it so that a reading taken while the shaft moves is never more than one step wrong.
  • Two's complement (binary, "BNR") holds signed values such as pitch, roll and altitude rate on data buses.
  • ASCII codes letters and symbols in 7 bits (8 with parity) — used for text in ACARS messages and maintenance printouts.
Exam traps

Read every remainder list from the bottom up. Remember A = 10, not 11. And BCD is not the same as binary: 25 in BCD is 0010 0101, in binary 11001.

🧠 Mind map

See the whole chapter at a glance

🃏 Flashcards

Test your recall — tap a card to flip it

✅ Chapter quiz

23 exam-style questions

📚 Further reading

Free references

Chapter progress

Next chapter →