John Mavrick's Garden

Search IconIcon to open search

Last updated Unknown

Status: Links: Nand2Tetris Project 3


Notes

Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
CHIP RAM512 {
    IN in[16], load, address[9];
    OUT out[16];

	PARTS:
    DMux8Way(in=load, sel[0..2]=address[6..8], a=r0, b=r1, c=r2, d=r3, e=r4, f=r5, g=r6, h=r7);
    RAM64(in=in, load=r0, address=address[0..5], out=reg0);
	RAM64(in=in, load=r1, address=address[0..5], out=reg1);
	RAM64(in=in, load=r2, address=address[0..5], out=reg2);
	RAM64(in=in, load=r3, address=address[0..5], out=reg3);
	RAM64(in=in, load=r4, address=address[0..5], out=reg4);
	RAM64(in=in, load=r5, address=address[0..5], out=reg5);
	RAM64(in=in, load=r6, address=address[0..5], out=reg6);
	RAM64(in=in, load=r7, address=address[0..5], out=reg7);
	Mux8Way16(a=reg0, b=reg1, c=reg2, d=reg3, e=reg4, f=reg5, g=reg6, h=reg7, sel=address[6..8], out=out);
}

Truth Table

time in load address out
0+ 0 0 0 0
1 0 0 0 0
1+ 0 1 0 0
2 0 1 0 0
2+ 13099 0 0 0
3 13099 0 0 0
3+ 13099 1 130 0
4 13099 1 130 13099
4+ 13099 0 0 0
5 13099 0 0 0
5+ 4729 0 472 0
6 4729 0 472 0
6+ 4729 1 472 0
7 4729 1 472 4729
7+ 4729 0 472 4729
8 4729 0 472 4729
8 4729 0 130 13099
8+ 5119 0 130 13099
9 5119 0 130 13099
9+ 5119 1 511 0


Interactive Graph