Skip to main content
ScotlandComputer ScienceSyllabus dot point

How are numbers, text and graphics stored using only binary digits?

Low-level operations and data representation: representing positive integers in binary, characters using a code such as ASCII, real numbers using floating point (mantissa and exponent), and graphics as bit-mapped or vector data.

An SQA National 5 Computing Science answer on low-level operations and data representation, covering how positive integers are stored in binary, how characters are stored using a code such as ASCII, how real numbers are stored using floating point with a mantissa and exponent, and how graphics are stored as bit-mapped or vector data.

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 key area is asking
  2. Representing positive integers in binary
  3. Representing characters
  4. Representing real numbers: floating point
  5. Representing graphics
  6. Why representation matters
  7. How this key area is examined
  8. For the official course specification

What this key area is asking

The SQA wants you to know how a computer represents different kinds of data using only binary digits: positive integers, characters, real numbers (floating point) and graphics.

Representing positive integers in binary

To convert a denary (decimal) number to binary, fit it into the place values from the largest down. To convert binary back to denary, add up the place values where the bit is 1. This is one of the most reliably examined skills in the course.

Representing characters

The size of the character set decides how many characters can be represented: a code using more bits per character can represent more symbols, which is why extended sets are needed for accented letters and other alphabets. At National 5 the key idea is that text is stored as a sequence of code numbers, one per character.

Representing real numbers: floating point

This mirrors scientific notation: just as 0.0034 can be written as 3.4 times 10 to the power of -3 (a mantissa of 3.4 and an exponent of -3), floating point keeps the digits in the mantissa and the scale in the exponent. More bits for the mantissa give more precision; more bits for the exponent give a wider range.

Representing graphics

The two store images very differently, and each has trade-offs. A bit-mapped image can capture photographic detail but its quality depends on resolution and it becomes blocky when enlarged. A vector image can be scaled to any size without losing quality, because the objects are recalculated, and is usually smaller for simple shapes; but it is less suited to detailed photographs.

Why representation matters

Everything in a computer - numbers, text, pictures, sound, even the program's instructions - is ultimately stored as binary. Understanding how each kind of data is encoded explains why files have different sizes, why some images scale better than others, and why a real number stored in floating point can lose a little precision. It also underpins the storage-size calculations in the Computer Systems area.

How this key area is examined

Questions ask you to convert between denary and binary (showing working), state how characters or real numbers are stored, or compare bit-mapped and vector graphics. For binary, use the place-value method and check your answer. For characters, mention a code such as ASCII and the idea of one code number per character. For floating point, name the mantissa and exponent and what each holds. For graphics, contrast pixels with objects-and-attributes and give vector's scaling advantage.

For the official course specification

The SQA publishes the full National 5 Computing Science course specification, specimen question papers and coursework tasks at sqa.org.uk. Always revise from the current specification and SQA past papers, because question style and terminology are board-specific.

Exam-style practice questions

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

SQA N5 style3 marksConvert the denary (decimal) number 75 into an 8-bit binary number. Show your working.
Show worked answer →

Three marks for the method and the correct answer.

Write the place values for 8 bits: 128 64 32 16 8 4 2 1.

Fit 75 into them from the left: 64 fits (75 - 64 = 11), 8 fits (11 - 8 = 3), 2 fits (3 - 2 = 1), 1 fits (1 - 1 = 0). So the bits set are 64, 8, 2 and 1.

Binary: 0100 1011.

Check: 64 + 8 + 2 + 1 = 75. Markers reward the place-value method, the correct 8 bits, and a check that the bits add back to 75.

SQA N5 style4 marksCompare how a bit-mapped graphic and a vector graphic store an image, and give one advantage of vector graphics.
Show worked answer →

Four marks: how each stores the image, plus an advantage.

Bit-mapped: the image is stored as a grid of pixels, with the colour of every individual pixel recorded. Detail depends on resolution.

Vector: the image is stored as a list of objects and their attributes (for example a circle with a centre, radius, colour and line thickness), described mathematically rather than pixel by pixel.

Advantage of vector: it can be scaled (resized) without losing quality, because the objects are recalculated; bit-mapped images become blocky when enlarged. Markers reward the pixel-grid description, the objects-and-attributes description, and a correct advantage such as lossless scaling or smaller file size for simple images.

Related dot points

Sources & how we know this