Preview

23 - Twos Complement

 1. Another method of representing signed numbers is two's complement. Most computers use this method to represent negative numbers.

  TRUE

  FALSE

 2. With two's complement, the bit at the far left of the bit pattern - the most significant bit or MSB - is used to __________________

  indicate the magnitude or size of the number

  indicate positive or negative

  indicate the length of the binary sequence

  None of the above

 3. In twos complement positive numbers always start with a 1.

  TRUE

  FALSE

 4. A four-bit, positive, two's complement number could hold a maximum value of _________

  5

  6

  7

  8

 5. 1111 in two's complement would be:

  minus 3

  minus 2

  minus 1

  zero

 6. The number -8 would be represented in two's complement as:

  1000

  1110

  1111

  1010

 7. Read the rules (below) for using two's complement for negative numbers. What is the missing step #4?
#1:
Find the positive binary value for the negative number 
you want to represent.

#2
Add a 0 to the front of the number, to indicate that it is positive.

#3
Invert or find the complement of each bit in the number.

#4
__________________________________

  Invert th e bits again and remove the leading 1

  None of the above

  Add 1 to this number

  Add 0 to this number

 8. What should happen in step 3? (to convert -1 into twos complement)
Find -1 using two's complement numbers
=======================================

Step 1: 1 = 001
Step 2: Adding 0 to the front becomes 0001
Step 3: .................................
Step 4: Add 1 = 1111 (-8 + 4 + 2 + 1 = -1)

  Invert all the bits and add 1 which gives 11101

  None of the above

  Reverted becomes 1111000

  Inverted' becomes 1110

 9. Look at the following calculation to convert -4 into two's complement. Is it correct? Which statement is true?
Find -4 using two's complement numbers
======================================

4 = 100
Adding 0 to the front becomes 1000
'Inverted' becomes 0001
Add 1 = 0010 = -4

  The step that inverts the bits is incorrect

  The calculation is correct

  The step that adds 1 is incorrect - in this case, it should add +4

  The step which adds a 0 has been done wrong. It should be 0100

 10. What is the two's complement four bit binary number 0001?

  2

  1

  4

  3

 11. What is the two's complement four bit binary number 0110?

  positive 3

  minus 3

  positive 6

  minus 6

 12. What is the two's complement four bit binary number 1011?

  positive 3

  positive 5

  minus 5

  minus 3

 13. What is +2 in two's complement binary? (four bits)

  2 would be 1100

  2 would be 0010

  2 would be 0011

  2 would be 1110

 14. Positive 2 in two's complement binary (using eight bits) would be 01110010

  FALSE

  TRUE

 15. How would you represent the positive integer 256 in eight bits (two's complement format)?

  The answer is 00110011

  The answer is 01111111

  ERROR: input requires 10 bits; 8 bits were specified

  The answer is 01000000

 16. Why is it not possible to represent the number 54 in four bits (two's complement)?

  54 would require 10 bits

  It is possible to represent in four bits

  54 would require 7 bits

  54 is not an odd number, which presents difficulties in two's complement

 17. The following representation is minus 74 in:
11001010

  ASCII

  sign and magnitude

  two's complement

  None of the above

 18. The following number is -74 in two's complement: 10110110

  FALSE

  TRUE

 19. The following calculation that converts -9 into two's complement is correct?
-9
-128	64	32	16	8	4	2	1
1	1	1	1	0	1	1	1

-128+64+32+16+4+2+1=-9

  FALSE

  TRUE

 20. Is this calculation, that converts -105 to two's complement, correct?
-105
-128	64	32	16	8	4	2	1
1	1	0	1	0	1	1	1
	-128+64+ 16+4+2+1=-105

  No - there should be no 1 under the 16

  No - there should be no 1 under the 64

  Yes

  It is incorrect because -105 cannot be represented in just eight bits