OCR Computer Science J277 - Mr Brown
Randomise two 8-bit numbers, then add them together column by column, starting with the 2⁰ (rightmost) bit, at your own pace.
Press "Add A + B" to begin, then "Next Column" to solve it one column at a time.
The dashed carry row is your working space. Fill in the Result row — and the overflow box on the far left, if you need it — then check your answer.
Binary addition works column by column, starting at the rightmost (2⁰) bit — exactly like the column addition you'd do with denary numbers. At every column, only four situations can happen:
Any carry generated in one column is carried into the next column to the left — just like carrying a ten in denary addition.
77 + 38, added column by column from the right:
| Place value | 2⁷ | 2⁶ | 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
|---|---|---|---|---|---|---|---|---|
| Carry in | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 |
| A | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| B | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 |
| Result | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 1 |
01001101 + 00100110 = 01110011Try this exact example yourself in the Playground!
An 8-bit register can only store 8 bits. If adding two 8-bit numbers produces a carry out of the leftmost (2⁷) column, the true answer needs a 9th bit — and that bit has nowhere to go.
11111111 + 00000001 = 1 00000000