Homework 3: Do these instructions work?
The goals of this homework are:
- Understand the impact of an instruction set architecture.
Assume you have a simple machine which implements the following instructions
- LOAD: load a value from memory into the accumulator
- STORE: store the value in the accumulator to memory
- ADD: add a value from memory to the accumulator
- ADDI: add the immediate encoded in the instruction to the accumulator.
- NEGATE: negate the accumulator (IE 3 becomes -3, -3 becomes 3)
- JUMPNZ: Jump on not zero, if the accumulator is not 0, jump
- IO: If the value of the address is 0, read into the accumulator, if the value of the address is 1, output the accumulator.
- STOP
Please do/answer the following
- [2 points] Design an instruction format for a 8 bit machine.
- [1 point] Describe the range of immediate values
- [1 point] Describe the range of memory addresses.
- [4 points] Can you write a controlled looping program for this machine? IE, the loop must be able to exit when a condition is reached.
- [3 points] Compared to WOMBAT would you expect this machine to require more or fewer instructions to execute a loop? Justify your answer.
- [3 points] Compared to WOMBAT, would you expect the clock cycle to be faster or slower for this machine? Justify your answer.
- [2 points] What would the impact be of increasing the word size of this machine from 8 to 16 bits?
- [2 points] What is the impact of removing the ADDI instruction? Could you still write a loop? What would be the cost of this action?
- [2 points]If you could add one more instruction to this set, what would it be? Why?