Homework 2


When you complete this homework you should
Answer each, show all work including computations. If you use any sources, be sure that you reference these sources.
  1. [1 point each] Provide the WOMBAT machine language representation for the following assembly instructions
    1. LOADI 10010
    2. ADD 1C16
    3. JMPZ 0A16
  2. [1 point each] Provide the WOMBAT assembly code for each of the following WOMBAT machine instructions
    1. 00100000001111002
    2. 102e16
    3. 703a16
  3. [1 point] Give the low level (CPU Component Level) RTN needed to accomplish the instruction ADDI 100. This should include the fetch portion of the operation.
  4. [1 point] Given the WOMBAT instruction set, what is the largest immediate that can be added to the accumulator using the ADDI instruction? Why is this true?
  5. [1 point] The WOMBAT instruction format includes 4 bits for the opcode and 12 bits for the operand. What limit does this impose on the number of instructions present in the instruction set? Justify your answer.
  6. [1 point] Are all of the WOMBAT instructions of equal "difficulty" for the CPU to execute? How would you make this decision? Justify your answer.
  7. [3 points] Write a program which reads in integers representing a lower bound, an upper bound and a skip factor, and prints the numbers from the lower bound to the upper bound inclusive. The input will be in the proper order, the lower bound will always be less than the upper bound, and the increment will be greater than 0.
  8. [7 points] Write a program in WOMBAT assembly language that given three integers will determine if they form a Pythagorean triple. The program should accept the numbers in any order, and print a 1 if the numbers are a Pythagorean triple and a 0 if they are not.

Submission