This assignment will use the PIPPIN software from the Decker/Hirshfield text. The practice problems will include an introduction to using the software. Also, please see the following information regarding using the Decker/Hirschfield software.
0 LOD X 2 SUB Y 4 STO T4 6 CPL T4 8 JMZ 14 10 LOD Y 12 JMP 16 14 LOD X 16 STO W 18 HLTPlease try to save the above program, Mystery to your computer, and then load the file from disk when running PIP. ;Instructions for doing this are here. If you have trouble saving this file, you can instead start PIP form scratch and type the assembly instructions into PIP yourself.
This program considers locations X and Y as input, and W as the result. Our goal is to examine the behavior of the program.
| PC|ACC| W | X | Y | T4| +---+---+---+---+---+---+ | 0 | 0 | 0 | 5 | 8 | 0 | | 2 | 5 | 0 | 5 | 8 | 0 | | 4 |-3 | 0 | 5 | 8 | 0 | | | | | | | | | | | | | | |
Hint: If you understand the instructions, you should be able to fill in the table by hand-simulating the program. Of course, after trying this on your own, you can check your answers by watching the PIPPIN program as it runs.
| PC|ACC| W | X | Y | T4| +---+---+---+---+---+---+ | 0 | 0 | 0 |12 | 3 | 0 | | 2 |12 | 0 |12 | 3 | 0 | | 4 | 9 | 0 |12 | 3 | 0 | | | | | | | | | | | | | | |
Hint: Though you may want to consider additional examples, your write-up for this problem should be stated without mention of specific examples.
Your program should cause the following (please note the use of subscripts carefully):
W1 = 2 * X0
X1 = X0 - Y0
Y1 = W1 + Z0
Z1 = Y1 / 4
For example, if the initial values were {W=1, X=2, Y=3, Z=4} then the final values should equal {W=4, X=-1, Y=8, Z=2}
Save your PIPPIN program to a file named "Mixup" for submission.
If (X<5) Then Copy the value from Cell Y into cell W Else Copy the value from Cell Z into Cell W
For example, if the initial memory contents appear as {W=6, X=7, Y=8, Z=9} then after running such a program, the contents should appear as {W=9, X=7, Y=8, Z=9}.
Alternatively, if the initial memory contents appear as {W=1, X=2, Y=3, Z=4} then after running such a program, the contents should appear as {W=3, X=2, Y=3, Z=4}.
Save your PIPPIN program to a file named "IfElse" for submission.
For example, if X=27, then W should be set to 5. If X=53, W should be set to 7.
Save your solution in a file named "SquareRoot".