When building the RAM8 my first thought was it would be great to use a DMux to put the incoming data into the right register. But then I noticed we had not constructed an 8 way 16 bit Dmux, and it's also not one of the built in functions. Is there another way? Also, is there a test script for the 8 way 16 Dmux? I am error prone, and the test scripts help me to work through the issues.
So I constructed the 8way16 DMux and used it to build all the Ram chips. It worked fine. I am still wondering if there is another more efficient way, or if this is the correct way to do it. I feel like I might be missing something obvious. Thanks!
I am a bit rusty on this but I fairly certain you don't need to build a DMux8Way16.
The chips you built in Ch 2 are sufficient.
What you need to apply selectively to the different registers is not 16 bits wide
I had this same idea but then to find out that using the standard DMux8Way is enough, just put as an input the load instruction and sel=address, the outputs of this things are going to be the loads of the chips, but also its ids (this is very important).
Then, just fed every register as:
Register(in=in, load=idj, out=outj);
Yes, I am forcing that each register accepts the in, but at the end it doesn't matter because the load operation only depends on the parameter idj, which is 1 if has the correct output from DMux8Way.
If nothing is loaded, then you do not alter your j-register .
Hi,Thorvald,I wrote code according to your ideas,but its behavior was incorrect. I think I didn't implement the write function of RAM8, could you give me some other tips, thanks.
sorry I posted the following code, when the problems are resolved, I will remove the code as soon as possible.
This is a good implementation of RAM8.hdl. It passes RAM8.tst on my system.
Have you implemented and tested Register.hdl?
Are your versions of Register.hdl and Bit.hdl in the same directory as the RAM8.hdl you are testing?
Are you testing the RAM8.hdl that you think your are? It's a common error to put one's work in a subdirectory and run the Hardware Simulator on the parent directory. You can check the HDL displayed in the simulator and see if it looks like the correct HDL file was loaded.
Hi,Mark,I'm glad you reply so quickly. Thank you again! Your spirit given me a lot of courage to learn this course.The problem was indeed that Register.hdl、Bit.hdl and RAM8.hdl wasn't in the same directory.
I made it both the ways. It can be easily built both ways. Just keep in mind on important thing, that if you're building DMux8Way16 then you need DMux16 as well.