## Class Work (CS 312) 28 Jan 2013

### Number Conversions

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

### Logic Problems

- 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.
- 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

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