Solution:

10. R0out, Yin
11. R1out, Xor, Zin, Yin
12. Zout, Yin, Xor, Zin
13. Zout, R1in, Xor, Zin
14. Zout, R0in

Your answer need not necessarily be this short to receive full marks, although it should be fairly close. (However, even if you interpreted the admonition to "use this algorithm" as stating that the values must be stored back into R0 and R1 as we go, I don't think it makes the above any longer, you just add an extra somethingout to each line.)

Guide to the above:


[exam] [CSC 258 additional problems] [main course page]