EE 308
Homework Assignment 2
Due Jan. 28, 1999
- Consider the following hexadecimal 8-bit numbers as unsigned. Find their
decimal equivalents:
- 0xA2
- 0xCA
- 0x15
- 0x80
- Repeat Problem 1, considering the numbers as signed.
- Consider the hexadecimal 8-bit numbers below. Do the
indicated additions, and find the 8-bit result. Determine if a carry resulted.
Determine if an overflow resulted.
Convert the operands and results to decimal numbers, and indicate if the
results are correct. (Do the last part twice, first assuming the numbers are
unsigned, then assuming the numbers are signed.)
- 0x23 + 0x3C
- 0x3A + 0x61
- 0x92 + 0x83
- 0xD2 + 0x61
- Subtract the following 8-bit numbers. Was a carry generated? Was an
overflow generated?
Convert the operands and results to decimal numbers, and indicate if the
results are correct. (Do the last part twice, first assuming the numbers are
unsigned, then assuming the numbers are signed.)
- 0x4B - 0x17
- 0x41 - 0x7A
- 0x81 - 0x20
- 0x55 - 0xB2
- Write an instruction sequence to add the 8-bit numbers at address
0x1000 and 0x1001, and store the result into address 0x1002.
- Write an instruction sequence to swap the contents of accumulators
A and B. Hint: Use a memory location as a swap buffer.
Bill Rison,
<rison@ee.nmt.edu >