Range of 8-bit two's complement

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

Range of 8-bit two's complement

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What is the range of an 8-bit two's complement integer?
A -127 to 128
B -128 to 127
2. Which 8-bit pattern is the largest positive two's complement number?
A 01111111 = 127
B 11111111 = 127
3. Which 8-bit pattern is the smallest two's complement number?
A 10000000 = -128
B 11111111 = -128
4. What does 11111111 represent in 8-bit two's complement?
A -1
B -127
5. What range does unsigned 8-bit binary give, compared with two's complement?
A -128 to 127
B 0 to 255

Match the Pairs

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

Left columnRight column
101111111 A0 to 255
210000000 B-128 to 127
3An 8-bit two's complement integer can store every whole number from -128 up to 127 CThe largest positive 8-bit two's complement number, which is 127
4Unsigned 8-bit binary, with no sign bit, stores a different range from two's complement DThe smallest 8-bit two's complement number, which is -128
5Range of 8-bit two's complement: -127 to 128 EThe ends are the wrong way round. The range is -128 to 127, because the sign bit is worth -128 and the largest positive is 01111111 = 127.
611111111 = 255 in 8-bit two's complement F255 is the unsigned value. In two's complement the sign bit is worth -128, so 11111111 = -128 + 127 = -1.

Definitions

-128 to 127

Fill in the Blanks

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

1.
01111111 in two's complement = ___
2.
10000000 in two's complement = ____
3.
11111111 in two's complement = __
4.
Unsigned 8-bit range: 0 to ___
5.
Largest positive: ________ = 127

Spot the Error

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

Question 1
A bits ← 8
B min ← -127
C max ← 127
D OUTPUT min, max
Question 2
A // 8-bit two's complement
B 01111111 = 128
C 10000000 = -128
D 11111111 = -1
Question 3
A // 8-bit two's complement
B 01111111 = 127
C 11111111 = -1
D 10000000 = 128
Question 4
A unsigned ← 0 TO 255
B signed ← -128 TO 127
C values ← 2 ^ 7
D OUTPUT values
Question 5
A bits ← 8
B count ← 2 * bits
C low ← -(count DIV 2)
D high ← count DIV 2 - 1

Answer Key

Range of 8-bit two's complement
Section A: Quick Questions
Q1
B — -128 to 127
Q2
A — 01111111 = 127
Q3
A — 10000000 = -128
Q4
A — -1
Q5
B — 0 to 255
Section B: Match the Pairs
Q1
01111111 → The largest positive 8-bit two's complement number, which is 127
Q2
10000000 → The smallest 8-bit two's complement number, which is -128
Q3
An 8-bit two's complement integer can store every whole number from -128 up to 127 → -128 to 127
Q4
Unsigned 8-bit binary, with no sign bit, stores a different range from two's complement → 0 to 255
Q5
Range of 8-bit two's complement: -127 to 128 → The ends are the wrong way round. The range is -128 to 127, because the sign bit is worth -128 and the largest positive is 01111111 = 127.
Q6
11111111 = 255 in 8-bit two's complement → 255 is the unsigned value. In two's complement the sign bit is worth -128, so 11111111 = -128 + 127 = -1.
Section C: Definitions
Q1
-128 to 127 — The range of an 8-bit two's complement integer: 10000000 is -128, 11111111 is -1 and 01111111 is 127. Unsigned 8-bit binary gives 0 to 255 instead.
Section D: Fill in the Blanks
Q1
01111111 in two's complement = 127
Q2
10000000 in two's complement = -128
Q3
11111111 in two's complement = -1
Q4
Unsigned 8-bit range: 0 to 255
Q5
Largest positive: 01111111 = 127
Section E: Spot the Error
Q1
B — The smallest 8-bit two's complement value is -128 (10000000), not -127. The line should be min ← -128.
Q2
B — 01111111 is the largest positive value, which is 127. 128 cannot be stored as a positive 8-bit two's complement number. It should be 01111111 = 127.
Q3
D — The sign bit is worth -128, so 10000000 is -128, not +128. It should be 10000000 = -128.
Q4
C — 8 bits give 2 ^ 8 = 256 different patterns, for both unsigned and two's complement. 2 ^ 7 is only 128. It should be values ← 2 ^ 8.
Q5
B — The number of patterns is 2 to the power of bits, not 2 multiplied by bits. 2 * 8 is only 16. It should be count ← 2 ^ bits, which gives 256.