ExamYard Lectures

Binary, denary, hexadecimal, BCD and prefixes

A Level Computer Science 9618 · Chapter 1, Information representation · 6-minute lecture

The teaching part (1 min) is free to watch. A free account opens the whole lecture: 5 practice questions, 2 real past-paper questions with the answers explained, the mistakes that lose marks, the full-marks tip, a one-card summary and a quick quiz.

What this lecture covers

  1. Why computers count in twos
  2. Place values in binary
  3. Denary to binary
Read the transcript of the teaching part

Last time

Before we start: last time, in File sizes, you learned these points. Here they are again on one card. Keep them in mind, because today builds on them.

Why computers count in twos

A light switch is on or off. Billions of tiny switches inside a processor do the same, so every number a computer stores is a pattern of ones and zeros. Hexadecimal is the shorthand people use to read those long patterns, and BCD is a special way to store each decimal digit separately.

Place values in binary

In binary, the columns are worth one, two, four, eight, sixteen, thirty-two, sixty-four and one hundred and twenty-eight. To convert binary to denary, add up the columns that hold a one. The number one zero one one one zero one zero has ones in the columns for 128, 32, 16, 8 and 2. That is one hundred and twenty-eight plus thirty-two plus sixteen plus eight plus two: one hundred and eighty-six.

Denary to binary

To go the other way, start with the biggest column that fits. For 186, take 128 and write a one. The remainder is fifty-eight. The next column, 64, is too big, so write a zero. Thirty-two fits: write one, leaving twenty-six. Sixteen fits, leaving ten. Eight fits, leaving two. Four does not fit, two does, and one does not. The binary number is one zero one one one zero one zero.

How often it comes up

How often Cambridge has asked each part, counted by ExamYard from every past paper in its question bank: Binary and denary conversions.

The whole chapter: Information Representation.

Chapter 1: Information representation

Also for A Level Computer Science 9618

Which topics come up most in A Level Computer Science 9618 past papers, counted from every paper since 2004: Paper 1 topic frequency, Paper 2 topic frequency.