Have I found a bug in the HardwareSimulator ? (Probably not)
Posted by Lozminda on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Have-I-found-a-bug-in-the-HardwareSimulator-Probably-not-tp4033046.html
Here's my code for RAM8
1 DMux8Way(in=load, sel[0..2]=address[0..2], a=l0, b=l1, c=l2, d=l3, e=l4, f=l5, g=l6, h=l7);
2 RAM8(in=in, load=l0,address[0..2]=address[3..5],out=o0);
3 RAM8(in=in, load=l1,address[0..2]=address[3..5],out=o1);
4 RAM8(in=in, load=l2,address[0..2]=address[3..5],out=o2);
5 RAM8(in=in, load=l3,address[0..2]=address[3..5],out=o3);
6 RAM8(in=in, load=l4,address[0..2]=address[3..5],out=o4);
7 RAM8(in=in, load=l5,address[0..2]=address[3..5],out=o5);
8 RAM8(in=in, load=l6,address[0..2]=address[3..5],out=o6);
9 RAM8(in=in, load=l7,address[0..2]=address[3..5],out=o7);
10 Mux8Way16(a=o0, b=o1, c=o2, d=o3, e=o4, f=o5, g=o6, h=o7, sel[0..2]=address[0..2], out=out);
(I've put the line numbers in to help with the following)
I run it through the HS (HardwareSimulator) and according to it, my chip is fine. I wasn't completely sure i'd wired it correctly so just to look for false positives as it were i changed line 2 to
RAM8(in=in, load=l0,address[0..2]=address[0..2],out=o0); (The second address is [0..2] not [3..5])
And the HS again completed the test script with no errors
so i changed subsequent lines until i had this
2 RAM8(in=in, load=l0,address[0..2]=address[0..2],out=o0);
3 RAM8(in=in, load=l1,address[0..2]=address[0..2],out=o1);
4 RAM8(in=in, load=l2,address[0..2]=address[0..2],out=o2);
5 RAM8(in=in, load=l3,address[0..2]=address[0..2],out=o3);
6 RAM8(in=in, load=l4,address[0..2]=address[0..2],out=o4);
7 RAM8(in=in, load=l5,address[0..2]=address[0..2],out=o5);
8 RAM8(in=in, load=l6,address[0..2]=address[3..5],out=o6);
9 RAM8(in=in, load=l7,address[0..2]=address[3..5],out=o7);
still no errors from the HS. It was only when i'd changed all but one did i finally get a comparison error.
Any thoughts anyone ?
All the best to my fellow N2Ters, have a good day!
Lozminda