Login  Register

RAM4K - Test script success, not 4K?

Posted by Rick on Aug 06, 2020; 7:28pm
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/RAM4K-Test-script-success-not-4K-tp4034960.html

The test script ends successfully on this chip. But it doesn't really have 4K of memory.
I'm confused.



CHIP RAM4K {
    IN in[16], load, address[12];
    OUT out[16];

PARTS:
RAM64(in=in,load=la,address=address[6..11],out=outa);
RAM64(in=in,load=lb,address=address[6..11],out=outb);
RAM64(in=in,load=lc,address=address[6..11],out=outc);
RAM64(in=in,load=ld,address=address[6..11],out=outd);
RAM64(in=in,load=le,address=address[6..11],out=oute);
RAM64(in=in,load=lf,address=address[6..11],out=outf);
RAM64(in=in,load=lg,address=address[6..11],out=outg);
RAM64(in=in,load=lh,address=address[6..11],out=outh);
         
Mux8Way16(sel=address[0..2],a=outa,b=outb,c=outc,d=outd,e=oute,f=outf,g=outg,h=outh,out=out);
DMux8Way(in=load,sel=address[0..2],a=la,b=lb,c=lc,d=ld,e=le,f=lf,g=lg,h=lh);