Skip to main content
Northern IrelandDigital TechnologySyllabus dot point

How are numbers, text, images and sound represented in binary inside a computer?

Representing data in binary, hexadecimal and denary, converting between bases, and how characters, images and sound are encoded digitally.

A CCEA A-Level Digital Technology answer on data representation: binary, denary and hexadecimal and converting between them, character encoding with ASCII and Unicode, and how images and sound are represented digitally.

Generated by Claude Opus 4.811 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. Number bases
  3. Converting between bases
  4. Representing characters
  5. Representing images and sound
  6. Try this

What this dot point is asking

CCEA wants you to represent data in binary, denary and hexadecimal, to convert between these bases, and to explain how characters, images and sound are encoded as binary. Everything a computer stores or processes is ultimately binary, so this is the foundation of AS 2.

Number bases

A computer's circuits have two stable states (on and off), so binary is the natural internal representation. A bit is one binary digit; eight bits make a byte. Hexadecimal is used by programmers because each hex digit maps to four bits, so a byte is two hex digits, far shorter and less error-prone to read than eight ones and zeros.

Converting between bases

To convert denary to binary, write the place values (128, 64, 32, 16, 8, 4, 2, 1 for a byte) and subtract from the largest that fits. To convert binary to hexadecimal, split into groups of four bits from the right and translate each group. To convert hexadecimal to denary, multiply each digit by its place value (16s and 1s for two digits).

Representing characters

ASCII cannot represent the thousands of characters in languages such as Chinese, or symbols beyond its 256 codes, which is why Unicode exists. The trade-off is size: Unicode characters can take more bytes than ASCII, so a Unicode file of the same English text may be larger.

Representing images and sound

A bitmap image is a grid of pixels, each storing a colour as a binary value. Resolution is the number of pixels (width times height) and colour depth (bit depth) is the number of bits per pixel; more of either gives higher quality but a larger file. Sound is a continuous wave sampled at regular intervals: the sample rate (samples per second) and the bit depth (bits per sample) set how faithfully the wave is captured, again trading quality against file size.

Try this

Q1. Convert binary 10110010 to hexadecimal. [2 marks]

  • Cue. 1011 = B, 0010 = 2, so the answer is B2.

Q2. State how many bits are in one nibble and how many hexadecimal digits represent one byte. [2 marks]

  • Cue. A nibble is 4 bits; one byte is represented by 2 hexadecimal digits.

Q3. Explain how increasing the sample rate affects a sound recording. [2 marks]

  • Cue. More samples per second capture the wave more faithfully, raising the quality, but the file becomes larger because more data is stored.

Exam-style practice questions

Practice questions written in the style of CCEA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

CCEA AS 24 marksConvert the denary number 214 to (a) 8-bit binary and (b) hexadecimal.
Show worked answer →

Work in place values, then group into nibbles for hex.

(a) The 8-bit place values are 128, 64, 32, 16, 8, 4, 2, 1. For 214: 128 fits (leaves 86), 64 fits (leaves 22), 32 does not, 16 fits (leaves 6), 8 does not, 4 fits (leaves 2), 2 fits (leaves 0), 1 does not. So 214 = 11010110 in binary.

(b) Split the byte into two nibbles: 1101 and 0110. 1101 = 13 = D; 0110 = 6. So 214 = D6 in hexadecimal.

Markers award marks for the correct binary value and for the correct hex value, and credit a correct method even if one digit is slipped. A quick check: D6 in hex is 13 times 16 plus 6 = 208 + 6 = 214, which confirms the answer.

CCEA AS 24 marksExplain why hexadecimal is often used by programmers in place of long binary numbers.
Show worked answer →

Link hexadecimal to binary through the four-bits-per-digit relationship.

Each hexadecimal digit represents exactly four binary bits (a nibble), because there are 16 hex digits and 16 combinations of four bits. This makes hex a compact shorthand for binary: an 8-bit byte becomes two hex digits, and a 32-bit value becomes eight. Shorter strings are easier for a human to read, write and copy without error than a long run of ones and zeros, which is why memory addresses, colour codes and machine values are usually shown in hex. Converting between hex and binary is also trivial, just translate each digit to or from its four bits, so no arithmetic is needed.

Markers reward the four-bits-per-digit point, the resulting compactness and reduced error, and the easy conversion to and from binary. Saying only "it is shorter" without the four-bit link limits the marks.

Related dot points

Sources & how we know this