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.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
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
- Data representation in a computer system: storing positive integers, real numbers and characters in binary, and the units used to measure storage from the bit upwards.
An SQA National 5 Computing Science answer on data representation in computer systems, covering how positive integers, real numbers (floating point) and characters are stored in binary, the meaning of bit and byte, and the units of storage scaling up through kilobyte, megabyte, gigabyte and terabyte.
- Data types and structures: variables holding character, string, numeric (integer and real) and Boolean values, and the 1-D array as a structure for holding many values of the same type under one name.
An SQA National 5 Computing Science answer on data types and structures, covering the variable types of character, string, integer, real and Boolean, when each is chosen, and how a one-dimensional array stores many values of the same type under a single name accessed by an index.
- Computer architecture: the role of the processor, memory and the buses that connect them; and the environmental impact of the manufacture, use and disposal of computer systems.
An SQA National 5 Computing Science answer on computer architecture and environmental impact, covering the role of the processor (with its registers and arithmetic logic unit and control unit), main memory, and the address and data buses, and the environmental impact of manufacturing, running and disposing of computer systems.
- Computational constructs: assignment, arithmetic, comparison and logical operators, concatenation, predefined functions, and the control structures of selection and iteration (fixed and conditional).
An SQA National 5 Computing Science answer on computational constructs, covering assignment, arithmetic, comparison and logical operators, string concatenation, predefined functions, and the control structures of selection (IF) and iteration (fixed and conditional loops) used to build programs in a high-level language.
- The iterative software development process: analysis, design, implementation, testing, documentation and evaluation, and why the process is iterative rather than strictly linear.
An SQA National 5 Computing Science answer on the software development process, covering the six stages of analysis, design, implementation, testing, documentation and evaluation, what is produced at each stage, and why the process is iterative so that developers loop back to earlier stages when problems are found.