Skip to content

Commit

Permalink
completed RAM64
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoylan committed Apr 22, 2012
1 parent e3d5cb5 commit a2b779c
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions project03/a/RAM64.hdl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// This file is part of the materials accompanying the book
// "The Elements of Computing Systems" by Nisan and Schocken,
// This file is part of the materials accompanying the book
// "The Elements of Computing Systems" by Nisan and Schocken,
// MIT Press. Book site: www.idc.ac.il/tecs
// File name: projects/03/a/RAM64.hdl

/**
* Memory of 64 registers, each 16 bit-wide. Out hold 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
* 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 after the next time step.)
*/

Expand All @@ -16,4 +16,23 @@ CHIP RAM64 {

PARTS:
// Put your code here.

// Address is 6 bits: xxxyyy
// The xxx refers to the particular RAM8 chip
// The yyy refers to the address on that chip

// Select the appropriate RAM8 chip with xxx
DMux8Way(in=load, sel=address[0..2], a=loadA, b=loadB, c=loadC, d=loadD, e=loadE, f=loadF, g=loadG, h=loadH);

// Feed yyy to all of them, and correct chip will get the load bit
RAM8(in=in, load=loadA, address=address[3..5], out=outA);
RAM8(in=in, load=loadB, address=address[3..5], out=outB);
RAM8(in=in, load=loadC, address=address[3..5], out=outC);
RAM8(in=in, load=loadD, address=address[3..5], out=outD);
RAM8(in=in, load=loadE, address=address[3..5], out=outE);
RAM8(in=in, load=loadF, address=address[3..5], out=outF);
RAM8(in=in, load=loadG, address=address[3..5], out=outG);
RAM8(in=in, load=loadH, address=address[3..5], out=outH);

Mux8Way16(a=outA, b=outB, c=outC, d=outD, e=outE, f=outF, g=outG, h=outH, sel=address[0..2], out=out);
}

0 comments on commit a2b779c

Please sign in to comment.