Skip to main content
ScotlandComputer ScienceSyllabus dot point

How is data stored and measured in a computer system?

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.

Generated by Claude Opus 4.810 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. Storing the three kinds of data
  3. Units of storage
  4. Why representation and units matter
  5. How this key area is examined
  6. For the official course specification

What this key area is asking

The SQA wants you to know how a computer system stores positive integers, real numbers and characters in binary, and to use the units of storage from the bit upwards.

Storing the three kinds of data

This key area is the Computer Systems view of representation: it focuses on how a system stores data and how much room that data takes.

The reason there are different methods is the kind of value. Whole numbers fit binary place values exactly. Numbers with decimals need floating point so the point can move. Text is not a number at all, so each character is given a code number first, then stored in binary like any other number.

Units of storage

Knowing the order and rough size of these units lets you reason about file sizes and storage. A short text file is measured in kilobytes, a photo or song in megabytes, a film or a large game in gigabytes, and a whole hard drive in terabytes. The single most useful facts are that a byte is 8 bits and that each unit up is about a thousand times bigger.

Why representation and units matter

A computer can only physically store two states, so all data - numbers, text, images, sound - is encoded in binary. The units of storage let us measure how much binary a piece of data uses, which is why a high-resolution photo needs more storage than a line of text, and why a hard drive's capacity is quoted in gigabytes or terabytes. These ideas also underpin the file-size and compression points in the Web design and development area.

How this key area is examined

Questions ask you to state how integers, reals or characters are stored, give the number of bits in a byte, or order the units of storage by size. Keep the three storage methods distinct (place values for integers, mantissa and exponent for reals, code numbers for characters) and learn the units list with the byte equals 8 bits fact. These are recall marks that are easy to secure with the vocabulary learned precisely.

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 style2 marksState how many bits are in a byte, and put these units in order of size from smallest to largest: gigabyte, kilobyte, megabyte.
Show worked answer →

One mark for the byte and one for the correct order.

There are 8 bits in a byte.

In order from smallest to largest: kilobyte, megabyte, gigabyte.

Markers reward the value 8 for the byte and the units in the right order. Each unit up is about 1000 (strictly 1024) times the one below it, so a megabyte is bigger than a kilobyte and a gigabyte is bigger than a megabyte.

SQA N5 style2 marksExplain why a real number is stored differently from a positive integer in a computer system.
Show worked answer →

Two marks for two linked points.

A positive integer is a whole number, so it can be stored directly using binary place values (128, 64, 32 and so on).

A real number has a fractional part, so it is stored using floating point: the significant digits are kept in a mantissa and the position of the point is kept in an exponent. This lets the system store numbers with decimals and a very wide range of sizes.

A good answer says integers use straightforward binary place values while reals need a mantissa and exponent because of the fractional part.

Related dot points

Sources & how we know this