Home · part 3 of 9
Two readings: drills
Six short randomised exercises on the thing every later page assumes: that one bit pattern is two numbers, and which one you get depends only on how you read the top bit. Four bits first, so every pattern is in sight.
Start at 4 bits, where there are only sixteen patterns and you can keep them all in your head. Switch to 8 once 4 feels mechanical. Answer on paper before you press check.
1. Read a pattern both ways
The same bits are two numbers. Read as unsigned, every bit is worth a positive power of two. Read as signed, the top bit is worth minus its power of two instead, and nothing else changes. Give both readings.
2. Write a value as a pattern
The other direction, in the two steps you would do on paper. First the wheel: a negative value is a count back from zero, so find the unsigned number on the same spoke, written in ordinary decimal: 16 − 3 = 13 for −3. Then the bits: build that unsigned number from place values by tapping cells. The reveal cross-checks it with invert-and-add-1. Once you can write the pattern directly, skip the wheel step, or just type the bits into step 1.
3. Find it on the wheel
The wheel with one ring of labels hidden. Click the spoke that carries the value or pattern asked for. The hidden ring is the one you are being asked to work out.
4. Step round the wheel
A subtraction, with the operands printed under one stated reading. Use whatever method you like, decimal or bits, to predict the pattern the register lands on and what it reads as under that reading. Then say whether the true answer fitted: about two prompts in five are chosen so that it does not, which is where the wrap, and later the flags, come from. If you work in decimal, the complete method is drawn step by step on From adding to subtracting.
5. Negate by hand
Invert every bit, then add 1. Write the result, then check that it reads as the negative of what you started with. One pattern in every width cannot be negated; you will meet it.
6. Does it fit?
Add the two patterns. The register keeps only the bottom bits, so the result may be right under one reading, both, or neither. Say whether each reading of the result is the true sum. This is what the C and V flags will report on the next page.
How to use these
- If drill 1 is hard, write out all sixteen 4-bit patterns in a column with both readings beside each, once, by hand. Then come back. Every other drill is that column being used.
- Answer first, every time. The reveal is for checking, not for learning the answer. A streak counter appears beside a score once you get three right in a row; try for ten.
- Drill 6 is the bridge to the flags: "the unsigned result is wrong" is what C = 1 means after an addition, and "the signed result is wrong" is V = 1.
- Scores are kept only in this browser. Reset them whenever you like.