CS273
Homework 2
Due Monday, September 17, 2001
Read text pp 1-10 (but stop before you get to binary-coded
decimal); read text pp 33-45.
Please remember - how you get your answers is at least as important as the
answers themselves. Show all your work. If you do not show
your work, you get no credit.
For all the problems that involve conversions to and from decimal, use the
multiplication method to convert to decimal, and the division method to convert
from decimal. Also, when going from two's complement binary
form to decimal, be sure to use `+' and `-' with decimal number.
From the Book
from page 45, 46, and 48
- 1-1 (20 points) (a), (b), (c), (e), (i) Note:If in doubt
about question, justify your answer; questions may have more than one valid answer.
- 1-2 (4 points) (a) Note: There is two parts to this
question, take the two's complement binary number 1) to decimal and
2) go from decimal to hex.
For the next two questions, you may go directly to hexadecimal from
two's complement binary. However, to go on to decimal use the
multiplication method.
- 1-11 (2 points)
- 1-12 (2 points) Note: Give the smallest two's complement
number that is affected by the change in sign rule. For 8 bits, we
defined this to be -12710 in class.
- 1-46 (2 points)
Not From the Book
- (10 points) Using your Lab1
program, MODIFY the program to add an instruction to subtract
+1010 from the B accumulator just before the ``bra''
instruction. Now answer the following questions using either
simulator:
- What opcode is shown for the subtraction
instruction?
- What is in the A and B accumulators on cycle 0?
- What is in the A and B accumulators on cycle 2?
- What cycle are we on just after the execution of the subtraction instruction?
- What is in the A and B accumulators on cycle 9?
- What is in the PC on cycle 9?
Last modified: Fri Sep 14 19:34:32 MDT 2001