Midterm Review Questions (without Answers)

The midterm exam will be broken into two components:

The written portion will require you to:

The review below, in addition to everything you wrote for your labs, is intended to be comprehensive. All topics which could potentially be on the exam are somehow covered by this review.

Questions

  1. The leftmost bit of a 32-bit number is in what position?
  2. Shifting an unsigned binary number N two positions to the left is equivalent to multipling N by what (in decimal)?
  3. Shifting an unsigned binary number N four positions to the right is equivalent to performing truncating division (ignoring the remainder) by what (in decimal)?
  4. For ANY unsigned binary number, which bit must you look at in order to determine if the number is odd or even?
  5. What is -8 in twos complement representation? Represent your solution using 8 bits.
  6. What is 1 + 1 with a carry-in bit set?
  7. What is 1 + 1 without a carry-in bit set?
  8. What is 1 + 0 without a carry-in bit set?
  9. What is:

      11111101
    + 01000101
    

    Specify if the result has a carry-out set and if the result sets the overflow bit.

  10. What is:

      10010110
    - 11101010
    

    Specify if the result has a carry-out set and if the result sets the overflow bit.

  11. Consider an unknown binary number N. Using only bitwise operations and bitmasks, give an expression that will produce N, except that bit 7 is guaranteed to be one. Express any bitmasks using 2-digit hexadecimal.
  12. While this isn't a review question, be familiar with the process to convert between binary and decimal floating point representations.