Number Systems in Computing
Practice questions
What is the largest unsigned number that can be stored in 5 bits?
- 32
- 31
- 30
- 16
Answer and explanation
Answer: B
Five ones equal 2^5 minus 1 = 31. There are 32 different values from 0 to 31.
Add 1100 and 111 in binary. What is the sum?
- 10001
- 10101
- 10011
- 11001
Answer and explanation
Answer: C
12 + 7 = 19, which is 16 + 2 + 1 = 10011. Column working: 0+1=1, 0+1=1, 1+1=10, 1+0+1=10, carry 1.
How many bits are required to give a different code to each of 1000 items?
- 8
- 9
- 11
- 10
Answer and explanation
Answer: D
2^9 = 512 is less than 1000, while 2^10 = 1024 is enough. So 10 bits are needed.
Convert the binary number 10110111 to octal.
- 267
- 177
- 543
- 237
Answer and explanation
Answer: A
Grouping in threes from the right with padding gives 010 110 111, which is 2, 6, 7: octal 267 (decimal 183).
Which of these is NOT a valid octal number?
- 7071
- 6400
- 3518
- 1234
Answer and explanation
Answer: C
Octal digits are 0 to 7. 3518 contains an 8, so it is not valid.
In the one's complement method, what is the 'end-around carry'?
- A carry that is dropped
- A carry added back to the result
- A borrow taken from the next bit
- A final sign bit
Answer and explanation
Answer: B
If the leftmost addition produces a carry, it is removed from the left and added to the right end of the result.
Using 4-bit two's complement working, what is 0101 minus 1001 (5 minus 9, unsigned values), as a decimal?
- -4
- 4
- -14
- 9
Answer and explanation
Answer: A
The two's complement of 1001 is 0111. 0101 + 0111 = 1100 with no carry, so the answer is negative, size 0100 = 4. The result is minus 4.
In two's complement subtraction, a missing carry out of the leftmost bit means the result is:
- Zero
- Positive
- Too large to store
- Negative
Answer and explanation
Answer: D
No carry means A was smaller than B, so the answer is negative and the sum is its two's complement.
Using two's complement in 4 bits, what is 1101 minus 0110?
- 0110
- 0101
- 0111
- 1000
Answer and explanation
Answer: C
The two's complement of 0110 is 1010. 1101 + 1010 = 10111; discard the carry to get 0111 = 7.
What is the one's complement of 0110?
- 1001
- 1010
- 1000
- 0111
Answer and explanation
Answer: A
Flip each bit: 0110 becomes 1001. Adding 1 would give the two's complement, 1010.
How many different colours can the six-digit hex colour system describe?
- 16,777,216
- 65,536
- 1,000,000
- 4,096
Answer and explanation
Answer: A
Each of the three bytes has 256 values, so 256 × 256 × 256 = 16,777,216.
Convert the binary number 10100111 to hexadecimal.
- 9A
- A9
- 7A
- A7
Answer and explanation
Answer: D
The nibbles are 1010 = A and 0111 = 7, giving A7.
The colour code #0000FF has full strength in which colour?
- Red
- Green
- Blue
- White
Answer and explanation
Answer: C
The three pairs are red, green and blue in that order. The pair 00 00 FF leaves only the blue pair at full value.
Which hexadecimal number equals decimal 200?
- C8
- B8
- C6
- D4
Answer and explanation
Answer: A
200 divided by 16 gives 12 remainder 8. The quotient 12 is C, so 200 = C8.
What is the decimal value of the hexadecimal number B7?
- 171
- 183
- 167
- 187
Answer and explanation
Answer: B
B is 11, so 11 × 16 + 7 = 176 + 7 = 183.
A binary number ends in 1. Which statement about its decimal value must be true?
- It is a multiple of 4
- It is odd
- It is less than 16
- It is even
Answer and explanation
Answer: B
The last bit is the ones place. A 1 there makes the number odd, whatever the other bits are.
Which decimal number could be written with exactly 7 bits (leading bit 1)?
- 50
- 130
- 90
- 200
Answer and explanation
Answer: C
A 7-bit number lies between 64 and 127. Only 90 is in that range. 50 needs 6 bits; 130 and 200 need 8.
Convert 11010110 to decimal using nibbles.
- 214
- 206
- 224
- 198
Answer and explanation
Answer: A
The nibbles are 1101 = 13 and 0110 = 6. The value is 16 × 13 + 6 = 214.
How many bits are needed to write the decimal number 200 in binary?
- 7
- 9
- 10
- 8
Answer and explanation
Answer: D
128 is not more than 200 and 256 is more, so 200 lies in the 8-bit range 128 to 255.
What is the decimal value of the binary number 111111?
- 31
- 63
- 64
- 127
Answer and explanation
Answer: B
Six ones equal 2^6 minus 1 = 64 minus 1 = 63.