RAM8 implementation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RAM8 implementation

fmiren
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:

ram8

So, I tried to implement RAM8 based on the image.

Any advice/hint is appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: RAM8 implementation

WBahn
Administrator
The figure is fine, but your code doesn't come close to matching it.

Look at the signal outA, for instance. You have it going from one of the outputs of the DMux directly to one of the inputs on the Mux.

Look at the diagram - are any of the outputs from the DMux connected directly to any of the inputs of the Mux?

How many registers does the figure have?

How many registers does your code have?
Reply | Threaded
Open this post in threaded view
|

Re: RAM8 implementation

fmiren
Thank you so much!

I got what I was doing wrong and fixed everything!

I don't know where I got the idea that I was implementing the image correctly :) Feel dumb about it.

The next step is Counter!