Project 2: Additonal ALU test

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Project 2: Additonal ALU test

cadet1620
Administrator
Contributed by Mark Armbrust
22 Nov 2011
Save these files in your nand2tetris/projects/02 directory.
  ALU-nostat.tst
  ALU-nostat.cmp

This test does not replace ALU.tst.

The normal ALU.tst tests the complete functionality of the ALU; 'out', 'zr' and 'ng' must all be correct for the test to pass.

The 'zr' and 'ng' status flags depend on the correct function of 'out'. If you are having trouble getting the computation part of the ALU working, the incorrect status bits add to the confusion.

The ALU-nostat.tst is the same as the normal ALU.tst, except that it does not stop if the status bits compare incorrectly. This lets you concentrate on getting the ALU computation correct.

Once your ALU passes ALU-nostat.tst, then you can work on the 'zr' and 'ng' status bits and get your ALU to pass ALU.tst.