Number Systems in Computing

Practice questions

What is the largest unsigned number that can be stored in 5 bits?

  1. 32
  2. 31
  3. 30
  4. 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?

  1. 10001
  2. 10101
  3. 10011
  4. 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?

  1. 8
  2. 9
  3. 11
  4. 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.

  1. 267
  2. 177
  3. 543
  4. 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?

  1. 7071
  2. 6400
  3. 3518
  4. 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'?

  1. A carry that is dropped
  2. A carry added back to the result
  3. A borrow taken from the next bit
  4. 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?

  1. -4
  2. 4
  3. -14
  4. 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:

  1. Zero
  2. Positive
  3. Too large to store
  4. 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?

  1. 0110
  2. 0101
  3. 0111
  4. 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?

  1. 1001
  2. 1010
  3. 1000
  4. 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?

  1. 16,777,216
  2. 65,536
  3. 1,000,000
  4. 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.

  1. 9A
  2. A9
  3. 7A
  4. 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?

  1. Red
  2. Green
  3. Blue
  4. 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?

  1. C8
  2. B8
  3. C6
  4. 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?

  1. 171
  2. 183
  3. 167
  4. 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?

  1. It is a multiple of 4
  2. It is odd
  3. It is less than 16
  4. 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)?

  1. 50
  2. 130
  3. 90
  4. 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.

  1. 214
  2. 206
  3. 224
  4. 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?

  1. 7
  2. 9
  3. 10
  4. 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?

  1. 31
  2. 63
  3. 64
  4. 127
Answer and explanation

Answer: B

Six ones equal 2^6 minus 1 = 64 minus 1 = 63.

Privacy · Terms · Refunds · Delivery