I'm struggling with RAM8 implementation. This is my code:
DMux8Way (in=in, sel=address, a=outA, b=outB, c=outC, d=outD, e=outE, f=outF, g=outG, h=outH);
Mux8Way16 (a=outA, b=outB, c=outC, d=outD, e=outE, f=outF, g=outG, h=outH, sel=address, out=outmux);
Registr (in=outmux, load=load, out=out);
I understand the problem with the code. In the first line, in(16) and in(1) hade different lengths. Also, outputs of DMux8Way (a, b, etc) have a length of 1, while Mux8Way16 inputs are 16-bit. I just don't know how to fix them.
The main question though is whether I got logic correctly because I'm not sure I'm doing it properly. I looked at Charles Petzold's "Code" (which is a wonderful book btw) to advance my understanding of memory. Here is the circuit description from the book:
So, I tried to implement RAM8 based on the image.
Any advice/hint is appreciated.