Login  Register

RAM8

Posted by Sebastian on Feb 09, 2011; 4:22am
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/RAM8-tp2456300.html

Hello,

I am currently trying to get my RAM8 to work, however I am unfortunately failing. I have already discovered what the problem is, but in order to fix it it would require me to mess with the registers, which is something I rather not do and I presume I am not supposed to either.

This is my current design:

CHIP RAM8 {

    IN  in[16], load, address[3];
    OUT out[16];

    PARTS:
    DMux8Way16(in=in, sel=address, a=a, b=b, c=c, d=d, e=e, f=f, g=g, h=h);
    Register(in=a, load=load, out=aa);
    Register(in=b, load=load, out=bb);
    Register(in=c, load=load, out=cc);
    Register(in=d, load=load, out=dd);
    Register(in=e, load=load, out=ee);
    Register(in=f, load=load, out=ff);
    Register(in=g, load=load, out=gg);
    Register(in=h, load=load, out=hh);
    Mux8Way16(a=aa, b=bb, c=cc, d=dd, e=ee, f=ff, g=gg, h=hh, sel=address, out=out);
}

As you can see, every time load equals true, ALL of the registers are updated, but since every way of DMux8Way16 except for the one in which 'in' is inserted is null, every other register is set to null. How do I solve this without having to resort to changing the registers?

Regards,
Sebastian

PS: My compliments on the book. So far it has been a very satisfying learning experience!