Homework 2
When you complete this homework you should
- Be able to write simple programs in wombat assembly language.
- Be able to assemble and disassemble wombat instructions.
- Be able to discuss elements of the wombat architecture.
Answer each, show all work including computations. If you use any sources, be sure that you reference these sources.
- [1 point each] Provide the WOMBAT machine language representation for the following assembly instructions
- LOADI 10010
- ADD 1C16
- JMPZ 0A16
- [1 point each] Provide the WOMBAT assembly code for each of the following WOMBAT machine instructions
- 00100000001111002
- 102e16
- 703a16
- [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.
- [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?
- [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.
- [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.
- [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.
- If the input is 1, 5, 1 the program should print 1 2 3 4 5
- If the input is 1, 5, 2 the program should print 1 3 5
- If the input is 1, 5, 3 the program should print 1 4
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.
- [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
- Submit the written portion in class on the day the homework is due.
- Submit the programming portions by email to danbennett360@gmail.com by class time on the day the homework is due.
- Please submit programs as attachments to the message.
- Please make sure that the title of the message includes the fact that this is Homework 2 for Computer Architecture.