Class Work (CS 312) 28 Jan 2013

Number Conversions

  1. Convert the following numbers to unsigned binary, octal, and hexadecimal: 25, 32, 67, 96.
  2. Convert these numbers in octal to binary, decimal, and hexadecimal: 672, 215.
  3. Convert these hexadecimal numbers into binary, octal, and decimal: 2A5, D0C.

Logic Problems

  1. There are 3 baskets - one has apples, one has oranges, and the other has a mix of apples and oranges. All the labels are wrong. Pick one basket, and one fruit from that basket and place the labels correctly.
  2. You have 8 balls. One of them is defective and weighs less than others. You have a balance to measure the balls against each other. In 2 weighings how do you find the defective one?

More Number Conversions

  1. The hexadecimal number B4 is a 2's complement number in 8-bit binary. Convert it to decimal.
  2. Add 3D and F5 and express the answer in octal.
  3. Add 517 in octal to 3A in hexadecimal and express the answer in decimal. [Hint convert both numbers to binary and add.]
  4. Add the following 2's complement 8-bit numbers: 1011 1001 and 1110 0110. Ignore the overflow bit. Express the answer in decimal.