aboutsummaryrefslogtreecommitdiff
path: root/projects/05/Memory.hdl
diff options
context:
space:
mode:
authorYuchen Pei <me@ypei.me>2017-12-15 16:09:35 +0100
committerYuchen Pei <me@ypei.me>2017-12-15 16:09:35 +0100
commita564e06beb41a73fb635fac9aef4ca50bc8843b9 (patch)
treed2ee4b1d20f431b9026762fa3b207b48461a0c28 /projects/05/Memory.hdl
parentec61018d15ba4ad0a41e1ab44d7e1ecb5f2870d2 (diff)
finished memory.hdl in project 5
Diffstat (limited to 'projects/05/Memory.hdl')
-rw-r--r--projects/05/Memory.hdl17
1 files changed, 16 insertions, 1 deletions
diff --git a/projects/05/Memory.hdl b/projects/05/Memory.hdl
index 62a4fd2..8d3d47c 100644
--- a/projects/05/Memory.hdl
+++ b/projects/05/Memory.hdl
@@ -28,4 +28,19 @@ CHIP Memory {
PARTS:
// Put your code here:
-} \ No newline at end of file
+ DMux(in=load, sel=address[14], a=mload, b=load1);
+ DMux(in=load1, sel=address[13], a=sload, b=kload);
+ RAM16K(in=in, load=mload, address=address[0..13], out=mout);
+ Screen(in=in, load=sload, address=address[0..12], out=sout);
+
+ Or8Way(in=address[0..7], out=or1);
+ Or8Way(in=address[5..12], out=or2);
+ Or(a=or1, b=or2, out=ksel);
+
+ Keyboard(out=out1);
+ Mux16(a=out1, b=in, sel=kload, out=kout);
+
+ Mux16(a=kout, b=false, sel=ksel, out=fout1);
+ Mux16(a=sout, b=fout1, sel=address[13], out=fout2);
+ Mux16(a=mout, b=fout2, sel=address[14], out=out);
+}