ScholaFly

CS02-03 Computer Science Watch

Character codes run in order

Subscribe on YouTubeLike this lesson on YouTube

Watch on YouTube

In this lesson

In this video you'll learn about character codes run in order for GCSE Computer Science, with worked examples and the mistakes examiners report. By the end you'll be able to explain that character codes are commonly grouped and run in sequence within an encoding table, and work out an unknown code from a known one, in denary and in binary, without a table.

What it covers

  1. 0:55 The codes run in order, in denary
  2. 3:31 Three runs, and the gaps between them
  3. 5:28 Staying in binary
  4. 7:42 What the order
  5. 8:36 Exam technique

Key words

About this video

GCSE Computer Science - Character codes run in order | Units and file sizes 3/6 (2026/27 exams)

In this video you'll learn about character codes run in order for GCSE Computer Science, with worked examples and the mistakes examiners report.

By the end you'll be able to explain that character codes are commonly grouped and run in sequence within an encoding table, and work out an unknown code from a known one, in denary and in binary, without a table.

For: AQA, Edexcel, OCR GCSE Computer Science
Watch first: CS02-02 Character sets and ASCII

Specifications: AQA 8525 3.3.5, Edexcel 1CP2 2.2.1, OCR J277 1.2.4

Video code: CS02-03 - search YouTube for "ScholaFly CS02-03" to come straight back to this video.

Videos in this chapter:
CS02-00 — Units, characters and file size - Intro
CS02-01 — Bits, bytes and the units of storage
CS02-02 — Character sets and ASCII
CS02-03 — Character codes run in order
CS02-04 — Unicode
CS02-05 — Working out the size of a text file
CS02-06 — The limits of a fixed number of bits

#CharacterCodesRunInOrder #GCSEComputerScience #ComputerScience

For more, visit ScholaFly: https://scholafly.com

Read the transcript

Your phone sorts your contacts alphabetically, and it has never once opened a dictionary. It is comparing numbers, one letter at a time. Whoever built the first character table put the alphabet in order on purpose. That is why sorting names is subtraction, and why, if someone says A is sixty-five, you already know M.

Character codes only make sense once a code table does, so if C S oh two, oh two, Character sets and ASCII, has not been watched yet, take that one first. Otherwise you are in the right place: video three of six in Units, characters and file size.

The good news first, because on this topic there genuinely is some. Edexcel's report on their twenty twenty-five Principles of Computer Science paper looked at a question that gave one letter's code and asked for another. It said this. Most candidates gave the correct ASCII code for G which was seventy-one. So most students already do this in ordinary numbers. What this video adds is doing it in binary, and picking the right run first. Inside a character table the letters sit in one unbroken run, each code exactly one more than the one before. A is sixty-five, so M, twelve letters on, is seventy-seven. That was a design choice, not an accident. Order the alphabet once, and every machine after it can sort text with arithmetic. First example. The code for g is one hundred and three, and you want k. Count the steps, not the letters between: g, h, i, j, k is four steps. So k is one hundred and seven, and it sits four along from g in the same run. Your turn. Capital D is sixty-eight, and three students give the code for capital H. A says seventy-one, B says seventy-two, C says one hundred and four. Take your pick, and hold on to your reason. I'll wait. It is B, seventy-two. D, E, F, G, H is four steps up from sixty-eight. A is seventy-one, which is G. And C is lower-case h, from a different run. That third answer is not carelessness. It is the slip real exam papers keep catching.

Two runs of letters live in that table, and they sit further apart than most people assume. Capitals are one run, starting at A equals sixty-five. Lower-case is a second, starting at a equals ninety-seven. The digits are a third, starting at zero equals forty-eight. Capital Z is ninety and lower-case a is ninety-seven, so they are not neighbours. Six other characters sit in that gap. Sequence holds inside a run, not across the table. The digits run catches people the same way. The character seven is not the number seven, and you cannot do sums with it. One to try. Capitals start at A equals sixty-five, lower-case at a equals ninety-seven. Give the code for lower-case w, without a table. Pause here and work it through. I'll wait. Lower-case w is one hundred and nineteen. Start at ninety-seven for a. W is the twenty-third letter, so that is twenty-two steps, not twenty-three, because a itself costs you nothing. Check it from the other end if you like: lower-case z is one hundred and twenty-two, and w sits three below that.

Same job again, except this time you are handed binary and you never leave it. The character p has the seven-bit code one, one, one, zero, zero, zero, zero. Give the seven-bit code for q. The tempting route is to convert into an ordinary number, add one, and convert back. Three conversions, three chances to slip, and a denary answer to a binary question earns nothing. So stay in binary. q is one after p, so add one at the right-hand end. That last digit is a zero, and zero plus one is one. So q is one, one, one, zero, zero, zero, one. Then say both halves: that is the pattern, and it is the seven-bit code for q. Had that digit already been a one, it would roll over and carry, which is how o becomes p. C S oh one, oh six, Binary addition, has that method in full. Then count the digits you were given. Seven went in, so seven come out, with no extra zero on the front. The boards differ here. A Q A and Edexcel print ASCII as seven bits, and O C R's papers use eight. Match the width in front of you. So here is your handle for this video, three checks in a fixed order: which run, which case, how many digits. Run those three before you write anything down, and the arithmetic is the easy part.

Which brings you back to the contacts list, and the reason any of this was designed. The whole idea fits in one sentence, worth being able to write. Because the letters' codes run in alphabetical order, comparing two codes gives the same answer as comparing two letters. So sorting names is sorting numbers, which a machine is already fast at. How a program actually shuffles the list is a separate topic, and C S one one, oh four, Bubble sort, is where that starts. One decision, taken once, a long time ago, and your contacts list runs on it still.

Marks go missing here in a way that has nothing to do with the counting. A Q A's report on their twenty twenty-five Computing concepts paper describes a question that gave students the binary value for the letter c. Firstly, some students did not state a binary value but rather a decimal value and secondly some students did not appear to know that the binary values for the ASCII letters are sequential so that they could add one to the binary value of c given in question seven point two. Both halves of that are what you just did. Stay in the base you were given, and answer in the base you were asked for. The same report, on a different habit, this one about width. A common error answering this question was to write an eight-bit binary value adding a leading zero when the question required them to state the value as presented in Figure one, which was a seven-bit binary value. Right method, wrong width, no mark. And O C R's report on their twenty twenty-two Computer systems paper puts the case slip like this. Some candidates clearly gave a lowercase t which would have a different ASCII code and was therefore incorrect. So read the case out of the question before you count anything at all.

Which run, which case, how many digits. That is the whole video, so here it is properly. Inside a run the codes go up one at a time, so count the steps from a code you already know. Capitals, lower case and digits are three separate runs. Z and a are not neighbours, and the character seven is not the number seven. In binary, add the one in binary, and hand back the same number of digits you were given.

This is how you avoid watching things you already know a second time. The thumb under each video is a tick you leave for yourself, and that is all it is. So tap it if you could count from a code you know to the one you want, in the right run and the right case, without hesitating. And if the counting still needs a second look, hold the thumb back and keep this saved until it has had a couple of days to settle. Then take Unicode, C S oh two, oh four, which pushes this same table past the English alphabet.

Next in the chapter is the video Unicode.

For more, visit scholafly.com, or watch the next video.

Related terms

For: AQA GCSE 8525, Edexcel GCSE 1CP2, OCR GCSE J277

On the specification

BoardSpecStatement
AQA GCSE 85253.3.5Character encoding
Edexcel GCSE 1CP22.2.1Explain how computers encode characters using 7-bit ASCII.
OCR GCSE J2771.2.4Data storage - Numbers
For teachers

This GCSE Computer Science lesson teaches character codes run in order. By the end, students should be able to explain that character codes are commonly grouped and run in sequence within an encoding table, and work out an unknown code from a known one, in denary and in binary, without a table. It works through four worked examples and the mistakes examiners report.