From a564e06beb41a73fb635fac9aef4ca50bc8843b9 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 15 Dec 2017 16:09:35 +0100 Subject: finished memory.hdl in project 5 --- projects/05/Memory.hdl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'projects/05/Memory.hdl') 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); +} -- cgit v1.2.3