ex Practice number representation and computer arithmetic.

Please download, print (2-sided), and write your answers on this standard sheet to help us grade and provide feedback to you faster.

Problem 1

Most people can count to 10 on their fingers; computer scientists can do better. Write answers to these expressions as simple arithmetic expressions or exact numbers in base ten.

  1. If you regard each finger as one bit, with finger extended as 1 and finger curled as 0, how high can you count in base 2 using ten fingers and starting at zero?
  2. With both ten fingers and ten toes?
  3. Now use just ten toes, with the left pinky toe as a sign bit for two’s (toes) complement numbers. What is the minimum expressible number? (10-bit two’s complement)
  4. What is the maximum fingers-and-toes-complement (20-bit two’s complement) number?

Problem 2

Perform the following conversions:

  • Show the 8-bit two’s complement representation of -10710 and 10710.
  • Show the decimal notation of the signed integers whose 16-bit two’s-complement representations are given in hexadecimal notation as 0x5F8C and 0xCAFE.

Problem 3

Perform the following calculations on the 8-bit representation of unsigned integers. Show your work and do the calculuations in binary. Additionally, convert the sum to decimal notation. Indicate for each calculation whether or not overflow has occurred.

  00101101       11111111       00000000
+ 01101111     + 11111111     - 11111111
----------     ----------     ----------

Problem 4

Repeat all parts of problem 3 assuming the 8-bit values represent signed integers in two’s complement representation.