DoRevision

Binary Builder

Shifting is not really about moving digits about. It is the cheapest multiplication a processor owns. Plus the reason adding three numbers behaves differently from adding two.

⏱️ 18 min 🎯 14 activities
Best used for
Homework Independent study Mock preparation

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

Why a processor would rather shift

You already know how to convert between binary, denary and hexadecimal from the previous module. This one is about doing arithmetic once the numbers are in binary, and it starts with something that sounds like a party trick and is actually the point. Take a binary number and move every bit one place to the left. The value doubles. Move every bit two places left and it multiplies by four. Move them right instead and it halves. ⚠️ Nothing was calculated to make that happen. No adding, no carrying, no working out. Every bit simply moved, and the value changed anyway, because each position is worth twice the one to its right. That is why a processor has a shift instruction at all. Multiplying is expensive; shifting is close to free. So a shift is not really a way of moving digits about. It is the cheapest multiplication and division a computer owns, and if you can shift but cannot say what it did to the value, you have learned the half that does not earn marks. One thing to fix before we start: every number in this module is eight bits wide, and that width is fixed. That matters more than it sounds, and you will see why shortly.

Words for binary arithmetic

Five terms. Two are about adding, two are about shifting, and the last one is why either can go wrong.

Left, right, and what falls off

Both directions look like the same operation mirrored. They are not, because what they throw away is completely different.

How to work a column sum without losing your place

Column arithmetic in binary is easier than in denary, because there are only two digits. ⚠️ Almost nobody who loses marks here loses them on the arithmetic. They lose them by losing track. Work right to left, one column at a time, and write the carry above the next column before you move on to it. Not in your head. On the page, above the column it is going into. That single habit removes the most common error on this topic entirely. ⚠️ Then say what the answer MEANS, not only what it is. Give the value, and if something did not fit, say so and say why - a result that has run out of room is a real finding and there are marks for identifying it, not just for the digits. And show every column. A final digit that is wrong, with correct working beside it, still earns most of the marks. A bare wrong answer earns none of them.

Match each shift to what it does to the value

  • Shifting left by one place
  • Shifting left by two places
  • Shifting right by one place
  • Shifting right by three places
  • multiplies the value by two
  • multiplies the value by four
  • divides the value by two
  • divides the value by eight

When a column carries more than one

This specification asks you to add up to THREE binary numbers at once. Adding three, a single column can produce a carry of two, which never happens when adding only two. Why?

  • A column can now reach a total of four or more, and four needs two bits of carry rather than one
  • It cannot happen; a carry is always exactly one however many numbers are being added
  • Because three numbers means three separate carries, one from each number
  • Because binary digits are worth more when there are more numbers in the sum

Three numbers, one awkward column

Add 00000111 and 00000111 and 00000111 - that is 7 + 7 + 7, and the answer should be 21. Work right to left, writing each carry above the next column. Rightmost column: three ones make 3. In binary that is 11, so write 1 and carry 1. Next column: three ones make 3, plus the carry of 1 makes 4. In binary that is 100, so write 0 and carry 2. ⚠️ There it is. A carry of two, which adding only two numbers could never produce. Next column: three ones make 3, plus the carry of 2 makes 5, which is 101, so write 1 and carry 2. Next column: no ones, plus the carry of 2 makes 2, which is 10, so write 0 and carry 1. Next column: just the carry of 1, so write 1. Reading it back: 00010101, which is 16 + 4 + 1 = 21. Correct. ⚠️ The reason this matters is that most revision material adds only two numbers, where a column tops out at three and the carry is always one. This specification asks for three, so carries of two are ordinary here rather than a sign of a mistake.

Two places to the left

A value of 12 is held in eight bits. It is shifted two places to the left, and no bits fall off the top. Work out the new value.

Order a column addition

Put the steps of adding binary numbers by hand into the order you should do them.

  • Line the numbers up so that matching place values sit in the same column
  • Add the digits in the rightmost column, together with any carry waiting above it
  • Write the result digit underneath and put any carry above the next column along
  • Move one column to the left and repeat until every column is done
  • Check whether the answer still fits in the number of bits available

Complete the binary arithmetic paragraph

A value passed from one column into the next during an addition is called a _____. When a result needs more bits than the space set aside for it, the condition is called _____. Moving every bit one place to the left multiplies the value by _____, while moving every bit three places to the right divides it by _____.

carry overflow two eight four a shift a nibble place value

Shift and add at speed

Five in a row, three lives. Every answer is about the VALUE, not just the digits.

Spot the true binary arithmetic facts

Tap the TWO statements that are true.

  • A left shift of one place doubles the value
  • Overflow happens when a result needs more bits than are available
  • A right shift always divides exactly, with nothing lost
  • Adding two binary numbers can produce a carry of two

Three arithmetic calls

Three situations. Choose the answer that gives the reason as well as the result.

  • A program needs to multiply an eight-bit value by eight, and does it with a shift. How many places, and what is the risk?
  • A student adding three eight-bit numbers gets a carry of two out of one column, decides they must have gone wrong, and starts again. What do you tell them?
  • A right shift of one place is used to halve an odd value. What happens to the remainder?

Explain binary addition and shifts

A friend has been practising binary addition with two numbers only, and treats shifting as a trick for moving digits around. Write them the answer that fixes both.

  • Set out the rules for adding two binary digits, including what happens when both are 1
  • Explain why adding three numbers can produce a carry larger than one, when adding two never can
  • Explain what overflow is, and why it is a limit of the storage rather than a mistake in the arithmetic
  • Explain what a left shift and a right shift each do to the VALUE, not just to the digits
  • Finish with what a right shift can lose, and why that means dividing by shifting is not always exact