CSC 103: How Computers Work

HW 2: PIPPIN with Conditional Instructions

Due Friday October 5: 4pm to EGR 105B

Convert the following generic computer code segments into PIPPIN

(a)
   W = (X * (Z - 3)) + 16)

(b)

   if (Y < 0)
      Z = 1
   else
      Z = 2
Recall that we work in assembly language, but the computer works in machine language, which is in binary. You can look at your program in machine language by clicking the 'binary' button at the bottom of the simulator. You can also get more information on the instruction codes for PIPPIN by looking at the PIPPIN User's Guide on the course web page.

Hints:

What to hand in

Hand in the computer code - you can type it into a word document once you have it working. Do not forget the line numbers for both programs written along the left margin of each line of code.