Logical binary shifts (left ×2 per shift · right ÷2 per shift) and two's complement negative numbers (mirror-and-nudge). Seven stages from theory to mastery. Click any stage card to dive in — or continue where you left off.
Read the theory and terminology to get grounded.
Green cards are stages you've already visited. Grey cards are new territory. Click any card to jump straight to that stage.
Logical shifts move bits left or right (each shift ×2 or ÷2), and two's complement lets 8-bit registers store negative numbers. This lesson covers both, with the two verbatim examiner traps that catch students every session.
A logical binary shift moves every bit a fixed number of places left or right. A left shift by n multiplies the value by 2n; a right shift by n divides by 2n (integer division). Bits that fall off the end are lost forever; empty positions are filled with zeros.
Two's complement is how computers store negative numbers in a fixed-size register. In 8-bit two's complement, the most significant bit (MSB) has place value −128 (not +128). The range becomes −128 to +127 instead of 0 to 255.
Note: binary addition and overflow are covered in 1.2A Binary Operations Trainer. This lesson (1.2B) covers shifts and two's complement only.
| Term | Definition |
|---|---|
| Logical shift | An operation that moves every bit a fixed number of places left or right. Bits off the end are lost; empty positions are filled with 0. |
| Left shift | Each bit moves one place to the left. A single left shift multiplies the value by 2. |
| Right shift | Each bit moves one place to the right. A single right shift divides the value by 2 (integer division). |
| MSB | Most Significant Bit — the leftmost bit. In unsigned binary it's worth +128; in two's complement it's worth −128. |
| LSB | Least Significant Bit — the rightmost bit, place value 1. |
| Two's complement | A method of representing signed integers where the MSB has a negative place value. Enables an 8-bit register to store negative numbers. |
| Sign bit | The MSB of a two's complement number: 0 means positive/zero, 1 means negative. |
| Mirror-and-nudge | Method to convert negative denary to two's complement: write the positive binary, flip every bit, add 1. |
| Signed vs unsigned | Signed uses two's complement (range −128 to +127 for 8-bit). Unsigned treats all bits as positive (range 0 to 255 for 8-bit). |
| Operation | Effect on value | Multiplier |
|---|---|---|
| Left shift by 1 | Multiply by 2 | ×2 |
| Left shift by 2 | Multiply by 4 | ×4 (not ×2) |
| Left shift by 3 | Multiply by 8 | ×8 |
| Right shift by 1 | Divide by 2 (integer) | ÷2 |
| Right shift by 2 | Divide by 4 (integer) | ÷4 |
| Right shift by n | Multiply by 2n (left) or divide by 2n (right) | 2n |
| Column | Place value (unsigned) | Place value (two's complement) |
|---|---|---|
| Column 8 (MSB) | 128 | −128 |
| Column 7 | 64 | 64 |
| Column 6 | 32 | 32 |
| Column 5 | 16 | 16 |
| Column 4 | 8 | 8 |
| Column 3 | 4 | 4 |
| Column 2 | 2 | 2 |
| Column 1 (LSB) | 1 | 1 |
| System | Minimum | Maximum | Total values |
|---|---|---|---|
| Unsigned | 0 (00000000) | 255 (11111111) | 256 |
| Two's complement (signed) | −128 (10000000) | +127 (01111111) | 256 |
Perform a logical left shift of 2 places on 00001101.
Perform a logical right shift of 3 places on 11000000.
Convert denary −45 to 8-bit two's complement.
Convert two's complement 10110100 to denary.
In two's complement, the MSB has place value −128, not +128. This is the single most common two's complement trap. Reading 10000000 as +128 gives −128 the wrong sign completely.
Cited: 2024 M/J examiner report — verbatim: "using this value as 128 rather than –128"A left shift by 2 places multiplies by 2² = 4, not by 2. Students confuse "shift 2 places" with "×2". Each additional place doubles the effect.
Cited: 2024 examiner report — verbatim: "most common incorrect answer given was that it would multiply the binary number by 2"Logical shifts always fill vacated positions with 0. Filling with 1s is arithmetic shift (not on the 0478 syllabus). Cambridge only test logical shifts.
Cited: recurring shift-question mistakeSome students automatically read "shift" as "shift right". Read the question — Cambridge specify left or right in every question.
Cited: recurring patternThe method is mirror-and-nudge: flip every bit, then add 1. Students often flip the bits and forget the +1, giving one's complement (which is wrong for Cambridge).
Cited: recurring two's complement mistakeThe 8-bit two's complement range is −128 to +127 — not symmetric. The extra value comes from the MSB being −128, giving one more negative value than positive.
Cited: recurring patternThese are the exact phrasings Cambridge accept. Learn them.
Answer these in your head, then tap to see the model answer. Aim for 5 or 6 right before moving on.
Every bit moves left. Bits off the left edge are lost. Zeros fill on the right.
Effect: value is multiplied by 2n where n is the number of places.
Every bit moves right. Bits off the right edge are lost. Zeros fill on the left.
Effect: value is divided by 2n (integer division).
They're the fastest way for a CPU to multiply or divide by powers of 2. Also used for extracting individual bits and packing data into registers.
A left shift by 2 places multiplies by 2² = 4. This is the most common wrong answer on shift questions.
Cited: 2024 examiner report — verbatimType an 8-bit binary number, choose direction and places, then see the shifted result with lost bits marked and filled positions highlighted.
Unsigned 8-bit binary can store 0 to 255. But we also need negative numbers. The clever trick: reinterpret the MSB as having value −128 instead of +128. Now bit patterns starting with 1 are negative, and the same 256 patterns cover the range −128 to +127.
To convert a negative denary number to two's complement:
Example: −45 → +45 = 00101101 → mirror = 11010010 → nudge = 11010011.
Read left to right using place values −128, 64, 32, 16, 8, 4, 2, 1. Multiply each bit by its place value and add.
Example: 10110100 = (−128) + 32 + 16 + 4 = −76.
The single most common two's complement mistake is treating the MSB as +128. In two's complement it's −128. Always.
Cited: 2024 M/J examiner report — verbatim: "using this value as 128 rather than –128"In two's complement, the MSB of an 8-bit number represents:
Apply the specified shift and type the resulting 8-bit binary.
Press New Question.
Stretch: 5 in a row across mixed left/right shifts.
Convert the given denary value to 8-bit two's complement, or vice versa.
Press New Question.
Stretch: after getting one right, explain the mirror-and-nudge steps aloud.
What effect does the shift have on the value?
Press New Question.
Stretch: shift 3 = ×8. Shift 4 = ×16. Notice the pattern: 2n.
Which statement about shifts or two's complement is WRONG?
Press New Question.
Stretch: explain out loud why the wrong statement is wrong, using mark-scheme phrasing.
Answer as many shift + two's complement questions as you can in 60 seconds.
Press Start Sprint to begin.
Stretch: beat your personal best twice in a session.
Weak skills come round twice as often. No question repeats immediately. 20 questions across 8 skills.
Press New Question.
12 questions in Cambridge Paper 1 style. Every question cites its source. Write your answer, then click Mark for keyword scoring.
Press New Question to begin.
Press New Question.
Every trap below is drawn from a real Cambridge examiner report or a recurring pattern flagged across multiple sessions.
The MSB is −128 in two's complement, not +128. This single mistake wrecks every two's complement answer.
Cited: 2024 M/J examiner report — verbatim: "using this value as 128 rather than –128"Left shift by n places multiplies by 2n. Shift by 2 = ×4, not ×2.
Cited: 2024 examiner report — verbatim: "most common incorrect answer given was that it would multiply the binary number by 2"Logical shifts always fill with 0. Filling with 1s is arithmetic shift, not on the 0478 syllabus.
Cited: recurring shift-question mistakeCambridge always specify left or right. Read the question — don't default.
Cited: recurring patternTwo's complement is mirror-and-nudge. Flip every bit, then add 1. Skipping the +1 gives one's complement, which is wrong.
Cited: recurring two's complement mistakeThe 8-bit two's complement range is −128 to +127. Not symmetric.
Cited: recurring patternIn right shift by 3, the three rightmost bits fall off (are lost). Students sometimes drop the wrong end's bits.
Cited: recurring shift mistakeThe same bit pattern has different values in the two systems. 10110100 = 180 unsigned or −76 two's complement. Read the question format.
Cited: recurring interpretation mistakeShift by 3 = ×8 (2³), not ×3 or ×6. Always powers of 2.
Cited: recurring shift arithmetic mistakeLeft shift n places = ×2n. Right shift n places = ÷2n. Always powers of 2, never just ×n.
Two's complement 8-bit: MSB place value is −128. Say it out loud until you can't forget it.
Two's complement for negatives: flip every bit (mirror), then add 1 (nudge). Miss the +1 and you get one's complement.
Logical shift: whatever end is vacated, fill with 0. Left shift → 0s on right. Right shift → 0s on left.
Cambridge always specify left or right. Never default. Circle the direction word before shifting.
Not −127 to +127 (that would be one's complement). Not −128 to +128 (that's 257 values). Exactly −128 to +127.
Green ≥ 70% · Yellow 30–69% · Grey untried. Tap any cell to manually mark a skill as mastered.
Ten items. Tap each once you're confident. When all 10 are ticked, 1.2B is mastered.
Every wrong answer is logged. See your weak areas and turn them into vault entries.
Track accuracy, streaks, and mastery in one place.
Quick links to questions and activities you want to revisit.
Jot down anything useful during your session — questions, mnemonics, or gaps you want to come back to.
Store definitions, mark-scheme points, model answers, and common mistakes.