Two’s Complement Deep Dive Quiz Quiz

Explore the fundamentals of two’s complement representation with this quiz designed to clarify the way negative integers are stored, binary addition, and conversion techniques. Strengthen your understanding of two’s complement notation, binary arithmetic, and how computers represent signed numbers.

  1. Understanding Two’s Complement Basics

    Which of the following best describes the purpose of two’s complement in binary number systems?

    1. To speed up multiplication operations
    2. To convert decimal numbers to fractions
    3. To represent both positive and negative integers efficiently
    4. To store only positive integers in less memory

    Explanation: Two’s complement is designed to represent both positive and negative integers in binary format, making arithmetic operations simpler. Storing only positive integers is handled by unsigned representations, not two’s complement. While arithmetic operations are simplified, multiplication speed is not its core feature. Converting decimals to fractions is unrelated to two’s complement.

  2. Identifying Two’s Complement Representation

    What is the two’s complement representation of -1 in an 8-bit binary system?

    1. 00000001
    2. 10000001
    3. 11111111
    4. 11111110

    Explanation: In an 8-bit system, -1 is represented as 11111111 in two’s complement. 00000001 represents positive 1, not -1. 10000001 corresponds to -127, and 11111110 represents -2. Only 11111111 accurately encodes -1 in two’s complement form.

  3. Calculating Two’s Complement Value

    What is the decimal value of the 8-bit binary number 11111011 in two’s complement?

    1. -5
    2. 5
    3. 253
    4. -253

    Explanation: To decode 11111011 in two’s complement, invert the bits and add one, yielding 00000101 + 1 = 00000110, which is 6, but since the sign bit is set, this is -5. The value 5 would be represented differently, and 253 is the unsigned interpretation. -253 cannot be represented in 8 bits.

  4. Determining Bit Width and Range

    What is the range of integers that can be represented in 4-bit two’s complement?

    1. -8 to 8
    2. -8 to 7
    3. -7 to 8
    4. 0 to 15

    Explanation: A 4-bit two’s complement number represents integers from -8 to 7. 0 to 15 is the range for unsigned 4-bit values. -7 to 8 and -8 to 8 both incorrectly include or exclude certain values beyond what can be represented. The most negative value is -8, and the most positive is 7.

  5. Converting Negative Decimals to Binary

    What is the two’s complement binary representation of -3 using 4 bits?

    1. 1001
    2. 1011
    3. 1101
    4. 0011

    Explanation: To get -3 in 4-bit two’s complement, write 3 as 0011, invert bits to 1100, add 1 to get 1101. 0011 represents positive 3, 1011 is -5, and 1001 is -7. Among the options, only 1101 correctly represents -3 using 4 bits.

  6. Addition in Two’s Complement

    What is the result of adding 0101 and 1011 in 4-bit two’s complement arithmetic?

    1. 1000
    2. 0110
    3. 0000
    4. 1110

    Explanation: 0101 (5) plus 1011 (-5) gives 0000 (0) in two’s complement using 4 bits. 1110 is -2, 1000 is -8, and 0110 is 6. Only 0000 represents the correct sum in this case.

  7. Sign Bit Recognition

    In a two’s complement binary number, what does a most significant bit (MSB) of 1 indicate?

    1. The number is negative
    2. The number is fractional
    3. The number is positive
    4. The number is unsigned

    Explanation: In two’s complement, an MSB of 1 indicates a negative value. An MSB of 0 means positive. Unsigned numbers do not use an MSB for sign, and fractions are not represented by the sign bit in two’s complement notation.

  8. Overflow Detection

    What happens when you add two large positive numbers in two’s complement and get a negative result?

    1. Bitwise AND should be performed
    2. Signed overflow has occurred
    3. The result is correct as-is
    4. It means the numbers were negative originally

    Explanation: If two positive numbers in two’s complement sum to a negative result, it means signed overflow occurred due to exceeding the range. The result is therefore incorrect if interpreted as a normal sum. Bitwise AND doesn’t correct overflow, and since both numbers are positive, they were not negative to start with.

  9. Subtraction with Two’s Complement

    When subtracting 0001 (1) from 1000 (-8) in a 4-bit two’s complement system, what is the result?

    1. 0111
    2. 1111
    3. 1001
    4. 0001

    Explanation: 1000 represents -8; subtracting 1 (or adding -1, 1111) gives 0111, which is 7. 1001 is -7, 1111 is -1, and 0001 is 1. Only 0111 is the correct result of this operation in a 4-bit two’s complement system.

  10. Converting Positive Decimals

    How is +6 represented in 4-bit two’s complement notation?

    1. 1100
    2. 0011
    3. 1010
    4. 0110

    Explanation: In two’s complement, positive numbers are written as their standard binary equivalents, so +6 is 0110. 1010 represents -6, 1100 is -4, and 0011 is +3. Therefore, 0110 is the right choice for representing +6.