Why two's complement is used

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Why two's complement is used

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What is two's complement used for?
A Storing negative integers in binary
B Storing only decimal fractions in binary
2. Why can't ordinary binary show a negative number by itself?
A It can only store numbers bigger than 255
B It only uses 0 and 1, so there is no minus sign
3. In two's complement, the leftmost bit is 1. What does that tell you?
A The number is positive
B The number is negative
4. In two's complement, the leftmost bit is 0. What does that tell you?
A The number is positive
B The number is negative
5. Which 8-bit pattern is a negative number in two's complement?
A 10010110
B 01101001

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
100001010 AA negative number in 8-bit two's complement: the leftmost bit is 1, so the value is below zero
210000001 BA positive number in 8-bit two's complement: the leftmost bit is 0, so it is just ordinary binary for denary 10
3Binary alone has no minus sign, so two's complement uses the leftmost bit to show the sign CIn two's complement a leftmost bit of 1 means the number is negative, not positive. Positive numbers have a leftmost bit of 0.
4A positive number in two's complement looks exactly the same as ordinary binary DBinary cannot contain a minus sign because computers only store 0s and 1s. Two's complement uses the leftmost bit to show a negative.
5Leftmost bit 1 means the number is positive E00000101 = 5 in binary and in two's complement
6-00000101 shows -5 in binary F1 0 0 0 0 0 1 1 (leftmost bit = sign)

Definitions

two's complement

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
Sign bit 0 means the number is ________
2.
Sign bit 1 means the number is ________
3.
+5 in 8 bits: _0000101
4.
Binary only has 0 and 1, so no _____ sign
5.
Method for negatives: two's __________

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A bits ← 00000101
B sign ← rightmost bit of bits
C OUTPUT sign
Question 2
A bits ← 10000011
B sign ← leftmost bit of bits
C IF sign = 0 THEN
D OUTPUT "negative"
Question 3
A denary 6 in binary: 00000110
B in two's complement: 10000110
C # positives look the same
Question 4
A Binary uses only 0 and 1
B It has a minus symbol
C So negatives need a sign bit
Question 5
A 10000001 has sign bit 1
B so it is negative
C 00000001 has sign bit 1
D so it is positive

Answer Key

Why two's complement is used
Section A: Quick Questions
Q1
A — Storing negative integers in binary
Q2
B — It only uses 0 and 1, so there is no minus sign
Q3
B — The number is negative
Q4
A — The number is positive
Q5
A — 10010110
Section B: Match the Pairs
Q1
00001010 → A positive number in 8-bit two's complement: the leftmost bit is 0, so it is just ordinary binary for denary 10
Q2
10000001 → A negative number in 8-bit two's complement: the leftmost bit is 1, so the value is below zero
Q3
Binary alone has no minus sign, so two's complement uses the leftmost bit to show the sign → 1 0 0 0 0 0 1 1 (leftmost bit = sign)
Q4
A positive number in two's complement looks exactly the same as ordinary binary → 00000101 = 5 in binary and in two's complement
Q5
Leftmost bit 1 means the number is positive → In two's complement a leftmost bit of 1 means the number is negative, not positive. Positive numbers have a leftmost bit of 0.
Q6
-00000101 shows -5 in binary → Binary cannot contain a minus sign because computers only store 0s and 1s. Two's complement uses the leftmost bit to show a negative.
Section C: Definitions
Q1
two's complement — A way to store negative integers in binary. The leftmost bit shows the sign: 0 means positive, 1 means negative. Positive numbers look the same as ordinary binary.
Section D: Fill in the Blanks
Q1
Sign bit 0 means the number is positive
Q2
Sign bit 1 means the number is negative
Q3
+5 in 8 bits: 00000101
Q4
Binary only has 0 and 1, so no minus sign
Q5
Method for negatives: two's complement
Section E: Spot the Error
Q1
B — In two's complement the sign is shown by the leftmost bit, not the rightmost. The line should be: sign ← leftmost bit of bits.
Q2
C — A leftmost bit of 1 means the number is negative, so the test must be IF sign = 1 THEN. A sign bit of 0 means positive.
Q3
B — Positive numbers look the same in two's complement as in ordinary binary. 6 stays 00000110, with a leftmost bit of 0.
Q4
B — Binary has no minus sign, only the digits 0 and 1. That is why two's complement uses the leftmost bit to show negative numbers.
Q5
C — The leftmost bit of 00000001 is 0, not 1. A sign bit of 0 means the number is positive.