DoRevision

Data Representation

A byte has no meaning on its own. The same eight bits are a number, a letter, a shade of grey or an instant of sound, and the data type is the instruction that decides which.

⏱️ 20 min 🎯 15 activities
Best used for
Intervention Mock preparation Cover lesson

Get the method right under pressure

Free interactive practice on the steps that lose marks under exam pressure.

Start revising free

What you'll cover

The byte that will not tell you what it is

Here is one byte: 01000001. What is it? It is the number 65. It is also the capital letter A. It is also a fairly dark shade of grey. It is also one instant of a sound, part of the way between silence and full volume. ⚠️ IT IS ALL OF THOSE AT ONCE, AND NOTHING IN THE BYTE ITSELF TELLS YOU WHICH ONE IS MEANT. There is no extra flag hidden in there. Eight bits, and not one of them is about interpretation. So how does a computer ever know? ⚠️ BECAUSE SOMETHING ELSE TELLS IT. THAT SOMETHING IS THE DATA TYPE. A data type is not a fact about the data. It is an instruction about how to read it. Look at what that explains, because it is most of this topic. It explains why your specification lists DATA TYPES in the same breath as characters, images and sound, which looks like an odd bundle until you see that all four are answers to one question: read these bits as what? It explains why a file opened in the wrong program shows nonsense rather than an error. The bits were perfectly readable. ⚠️ THEY WERE JUST NOT BEING READ AS WHAT THEY WERE. It explains why file formats exist at all. A format is largely a way of writing down, alongside the data, what the data is supposed to be. And it explains why a value can suddenly go wrong when it gets too large. The type fixes how many bits you get, and how many bits you get fixes how far you can count.

Five words this topic runs on

Five terms, defined and nothing more. What one byte looks like under each reading comes next.

One byte, read five ways

  • Read as an ordinary whole number, 01000001 comes out as 65
  • Read through the agreed table that pairs characters with numbers, it comes out as the capital letter A
  • Read as the brightness of a single dot on a greyscale screen, it comes out as a fairly dark grey
  • Read as one measurement taken from a sound wave, it comes out as one instant part of the way between silence and full volume
  • Read with no instruction at all, it comes out as eight bits and nothing more
  • AN INTEGER, because the bits are being read as place values in the ordinary way
  • A CHARACTER, because a character set is being used to turn the number into a symbol
  • A PIXEL VALUE, because the number is being read as how bright one dot should be
  • AN AUDIO SAMPLE, because the number is being read as the height of a wave at one moment
  • RAW DATA, because without a data type there is nothing to interpret it as

Why it shows nonsense instead of an error

Someone opens a photograph in a plain text editor. Instead of refusing, the editor fills the screen with random-looking symbols. Why does it behave that way?

  • Because the bits are perfectly readable as characters; they are simply not what those bits were meant to be read as, and nothing in them says so
  • Because opening the file in the wrong program corrupted the data
  • Because the text editor is missing the software needed to read images
  • Because image files are encrypted and the text editor cannot decrypt them

Read these bits as what

Everything in this topic is one of these three answers. Notice that the bits never change; only the instruction does.

True about representing data

Select the TWO statements that are true.

  • A data type is an instruction about how to read a pattern of bits, not a property carried inside the bits
  • How large a number a type can hold follows from how many bits the type gives it
  • Each byte carries a marker inside it saying whether it is a number, a letter or part of an image
  • Images and sound are stored using completely unrelated methods

How to answer a representation question

Two habits are worth more here than any amount of extra drill. ⚠️ FIRST: ALWAYS SAY WHAT THE BITS ARE BEING READ AS. An answer that says "01000001 is 65" has said something true and incomplete. "Read as an unsigned integer, 01000001 is 65" has answered the question, and on a question where the same pattern could be several things, the phrase is doing real work rather than padding. The same applies to anything you calculate. Say what the number you produced actually measures. A figure with no unit and no reading attached is hard to credit even when it is correct. ⚠️ SECOND: SHOW THE WORKING ON EVERY CALCULATION, AND SET IT OUT SO EACH LINE SAYS WHAT IT IS. Not a column of digits, but the method named, then the arithmetic, then the answer. If the final figure is wrong and the method is visible and right, there are usually marks in the working. If only an answer appears and it is wrong, there is nothing to credit. And check that your answer is the right KIND of thing before you write it. A count of something that comes out fractional, or a file size smaller than the data it holds, is telling you the method went astray. One fact about this qualification worth knowing. ⚠️ THIS SPECIFICATION IS GRADED A\* TO G ON AN EIGHT-POINT SCALE AND IS UNTIERED, SO EVERY CANDIDATE SITS THE SAME PAPERS. It is not the nine-to-one system used by the English boards. If a resource talks about grade 9, it was written for a different qualification and may differ in other ways too, so check what it was written for before trusting its detail.

What a file format is actually for

Take a run of bytes off a disk: 01001000 01100101 01101100 01101100 01101111. Read as text through the usual character set, that is the word Hello. Read as numbers, it is the sequence 72, 101, 108, 108, 111. Read as greyscale pixel values, it is five dots of varying darkness in a row. ⚠️ ALL THREE READINGS ARE CORRECT. THE BYTES DO NOT PREFER ANY OF THEM. So how does anything ever open correctly? Because the data almost never travels alone. ⚠️ A FILE FORMAT IS, IN LARGE PART, AN AGREEMENT TO WRITE DOWN ALONGSIDE THE DATA WHAT THE DATA IS SUPPOSED TO BE. How wide the image is. How many bits each measurement uses. Which character scheme was used. Strip that away and you are left with bytes that could be anything. The file extension is the crudest version of the same idea, and it is only a hint: renaming a photograph so it ends in a text extension does not change a single bit inside it. It changes only which program the computer offers to open it with. Now the second consequence, which catches people out. ⚠️ THE TYPE ALSO FIXES HOW MANY BITS YOU GET, AND THAT FIXES HOW FAR YOU CAN COUNT. Eight bits give you a fixed number of distinct patterns and no more. Count past the largest pattern and there is nowhere for the value to go: it wraps around to the bottom, or the extra bit is simply lost. That is overflow, and notice it is not a fault in the arithmetic. The addition was correct. ⚠️ THERE WAS SIMPLY NO ROOM IN THE TYPE FOR THE ANSWER, which is why choosing a type with enough bits is a real decision rather than a formality.

How far can one byte count

A data type is given one byte, which is 8 bits. Each bit can be 0 or 1, so the number of distinct patterns is 2 multiplied by itself 8 times. How many different values can that type represent?

Order what has to happen before bits mean anything

A file is opened and a photograph appears. Put the stages in order.

  • A run of bits is read off the storage device, carrying no meaning of its own
  • Information stored with the file says what kind of data it is
  • That tells the program how many bits make up each measurement
  • Each group of bits is read as a number describing one dot
  • The dots are arranged and displayed, and a photograph appears

The interpretation run

Five questions on what bits mean and who decides. Three lives.

Complete the data type facts

A single binary digit is a _____, and eight of them grouped together are a _____. The instruction that says how a pattern of bits should be read, and how many bits it occupies, is its _____. An agreed table pairing each symbol with a number, so that text can be stored and read back correctly, is a _____.

bit byte data type character set encoding overflow sample pixel

Spot the true data representation facts

Tap the TWO statements that are true.

  • A data type is an instruction about how to read bits, and it comes from outside the bits themselves
  • Overflow happens because the type provides a fixed number of bits, not because the arithmetic was done wrongly
  • Every byte contains a marker identifying what kind of data it holds
  • Changing a file extension converts the data inside the file into the new format

Three questions about bits

Three cases. Each answer has to carry the reasoning, not just the verdict.

  • A program stores a running total in a type given one byte. The total climbs steadily and then suddenly reads as a very small number. The arithmetic has been checked and is correct. What happened?
  • Text sent from one system arrives on another as the wrong symbols, though the file is undamaged. What is the most likely explanation?
  • A student writes on a question about a byte: "01000001 is 65." The marker credits it only partially. What is missing?

Explain what decides the meaning of a byte

A classmate has learned to convert between binary, denary and hexadecimal perfectly, and cannot see why a photograph opened in a text editor shows symbols instead of a picture. Write them an explanation.

  • Explain why a pattern of bits has no meaning on its own, using one byte as an example
  • Explain what a data type is and why it has to come from outside the bits
  • Explain what happens when a file is opened as the wrong type, and why the result is nonsense rather than an error
  • Explain what a file format stores besides the data itself, and why that is necessary
  • Finish by explaining why the type also fixes how far a value can count, and what overflow is