(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
Re: Have I found a bug in the HardwareSimulator ? (Probably not)
Ps Having done a quick check online it would seem my original code was wrong too [0..2] should be swapped with [3..5] ie i've got my address digits the wrong way around, though this doesn't seem to matter according to the HS.. Cheers
How can this be your code for RAM8 when you USE a bunch of RAM8 parts in it?
I think you mean that this is your code for RAM64.
In your modifications you are progressively reducing the effective size of your memory and making it so that multiple addresses map to the same memory location. The tests can't detect that until you get to a point where you write to one address that overwrites a memory location that was previously written to using a different address and that is subsequently read using that previous address.
For instance, in your first modification (where you just changed line 2), you've made it so that if the person writes to any address where address = ???000 will write to address 000 in that RAM8 block. So if you write
RAM = 8
RAM = 16
and then go back and read RAM you will discover that it is now 16.
Putting the upper bits as the bank select (going to the MUX and DMUX parts) is the most intuitive way, but it doesn't really matter. As long as each address maps to a distinct memory location and it is the same location whether you are reading or writing, it will work fine.