{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lab02problems

# lab02problems - The first example is done for you Example...

This preview shows page 1. Sign up to view the full content.

Lab2 problems: Remember to solve these individually, working with your partner only when you get stuck, and seeking help from the TA only when you are both stuck. You may NOT use any calculators. Conversions: 1. Convert the hex number 0xbee into: a) binary b) octal c) decimal 2. Signed vs Unsigned numbers: a) What decimal number does this unsigned binary number represent: 1111 0110 b) What decimal number does this two's complement binary number represent: 1111 0110 3. a) What is the largest decimal value that can be stored in an 8-bit unsigned binary number? b) What is the largest decimal value that can be stored in an 8-bit two's complement binary number? 4. What is the answer, in binary, of each of the following 4-bit additions, and did they produce an overflow and/or a carry.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: The first example is done for you. Example: 1100 + 0011 1111, overflow = 0, carry = 0 Answer: 1111, V:0, C:0 a) 0110 + 0011 b) 1011 + 0110 Remember that in a 4-bit addition, the answer is truncated at 4 bits, as well. One way to determine the overflow and carry bits is to translate the inputs and answer to decimal. For overflow, translate them using 2's complement. If the answer is correct, there is no overflow. For carry, use unsigned numbers. 5. Give the answers to the following bitwise operations a) 0110 & 1100 b) 0110 | 1100 c) 0110 >> 2 d) ~0110 6. Each operation is written in Java or C, whichever you know. Rewrite the line to use a bitwise operation. a) a * 8 b) b / 16 c) c % 8...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online