/** * Memory of 16K registers, each 16 bit-wide. Out holds the value * stored at the memory location specified by address. If load==1, then * the in value is loaded into the memory location specified by address * (the loaded value will be emitted to out from the next time step onward). */ CHIP RAM16K { IN in[16], load, address[14]; OUT out[16]; PARTS: DMux4Way(in=load,sel=address[12..13],a=w1,b=w2,c=w3,d=w4); RAM4K(in=in,load=w1,address=address[0..11],out=w9); RAM4K(in=in,load=w2,address=address[0..11],out=w10); RAM4K(in=in,load=w3,address=address[0..11],out=w11); RAM4K(in=in,load=w4,address=address[0..11],out=w12); Mux4Way16(a=w9,b=w10,c=w11,d=w12,sel=address[12..13],out=out); }