project03: Compound RAM chips

This commit is contained in:
2025-09-03 10:45:00 -04:00
parent e485868265
commit d0c67845f4
5 changed files with 71 additions and 5 deletions

View File

@@ -13,5 +13,15 @@ CHIP RAM16K {
OUT out[16];
PARTS:
//// Replace this comment with your code.
// find which RAM4K to load by address (from high two bits)
DMux4Way(in=load, sel=address[12..13], a=load0, b=load1, c=load2, d=load3);
// 4 RAM4K chips (low 12 bits select register within each)
RAM4K(in=in, load=load0, address=address[0..11], out=out0);
RAM4K(in=in, load=load1, address=address[0..11], out=out1);
RAM4K(in=in, load=load2, address=address[0..11], out=out2);
RAM4K(in=in, load=load3, address=address[0..11], out=out3);
// select which RAM4K output to send
Mux4Way16(a=out0, b=out1, c=out2, d=out3, sel=address[12..13], out=out);
}