IB Computer Science HL · Year 2 · Lesson 31

Binary, hexadecimal and binary data representation

Convert accurately between number systems, then explain how different media ultimately become bit patterns for storage and retrieval.

Paper 150 minutesA1.2.1 · A1.2.2
Targets

Representation is an agreed mapping from meaning to bits

2 / 10
  • describe the principal methods of representing integer values using binary, hexadecimal and decimal, including conversions in both directions;
  • use the four-bit relationship between binary and hexadecimal;
  • explain why binary encoding underpins storage/retrieval;
  • explain how integers, characters/strings, images, audio and video are represented in binary form.
A1.2.1A1.2.2
Learn + retrieve

Rapid Recall Deck

3 / 10

Attempt each card first. If a term is new, flip and study it, then answer it again without looking. Mark only secure recall as “Know it”.

A1.2.1

Binary ↔ decimal

4 / 10

Binary → decimal

Convert 10110110₂ to decimal. Show place values.

128
64
32
16
8
4
2
1

10110110₂ = 128 + 32 + 16 + 4 + 2 = 182₁₀.

Decimal → binary

Convert 173₁₀ to 8-bit binary.

173 = 128 + 32 + 8 + 4 + 1, so the 8-bit representation is 10101101₂.

A1.2.1

Binary ↔ hexadecimal

5 / 10

Hex → binary

Convert AC₁₆ directly to binary using one four-bit group per hexadecimal digit.

A = 1010 and C = 1100, so AC₁₆ = 10101100₂.

Binary → hex

Convert 111001011011₂ to hexadecimal by grouping from the right.

1110 0101 1011 maps to E 5 B, so the result is E5B₁₆.

A1.2.1

Hexadecimal ↔ decimal

6 / 10

Hex → decimal

Convert 2F₁₆ to decimal.

2F₁₆ = 2×16 + 15 = 47₁₀.

Decimal → hex

Convert 254₁₀ to hexadecimal.

254 = 15×16 + 14, so the hexadecimal digits are F and E: FE₁₆.

A1.2.2 · Explain

Binary encoding only works because the interpretation is agreed

7 / 10

From meaning to bits

Describe how binary represents each of these data types: integer, character/string, image, audio and video. Do not stop at “everything is 0s and 1s”; identify the intermediate numeric representation that is ultimately encoded as bits.

Integer
Character / string
Image
Audio
Video
For each: identify the numeric representation that is ultimately encoded as bits.

Integers are encoded directly as numeric bit patterns. Characters use an agreed character encoding that assigns numeric codes, and strings are sequences of encoded characters. Images store numeric pixel values such as colour/intensity. Audio stores sampled measurements converted to discrete numeric values. Video stores encoded sequences of frames plus associated audio/metadata. In each case, the storage device ultimately records the resulting binary patterns.

Explain

Bits need a decoding rule

8 / 10

Why representation affects storage and retrieval

Two programs read the same bit pattern but use different character encodings. Explain why they can display different characters even though the stored bits are unchanged.

Bits alone do not carry a universal human meaning. The program must interpret them using an agreed encoding. If two programs map the same numeric code to characters differently, the same stored pattern can be decoded into different symbols. Correct retrieval therefore depends on knowing the representation/encoding used when the data was stored.

Exam lens

Conversions require accuracy; explanations require mechanism

9 / 10

Paper 1-style mini-set

1. Convert AC₁₆ to binary.

2. Convert 11011110₂ to hexadecimal.

3. Explain how a colour image can be stored in binary.

  1. 10101100₂.
  2. DE₁₆.
  3. The image is divided into pixels; each pixel is assigned numeric colour/intensity values according to the image representation, and those numbers are encoded as bits together with required metadata.
Homework

Finish the learning cycle

10 / 10

IA — main task

Continue Criterion D development/testing. Keep your documentation focused on evidence, not decorative screenshots.

Paper 1 — short practice

Complete five mixed binary/decimal/hex conversions from memory, then explain binary storage for strings, images, audio and video without notes.