Last active
February 11, 2020 14:35
-
-
Save torpedo87/7d3fd08cf9fe116229ddcc6e36d47cc3 to your computer and use it in GitHub Desktop.
m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CHIP Memory { | |
IN in[16], load, address[15]; | |
OUT out[16]; | |
PARTS: | |
// Put your code here: | |
//choose RAM if address[13..14] == [0,0] or [0,1] | |
//choose screen if address[13..14] == [1,0] | |
//choose KBD if addrss[13..14] == [1,1] | |
DMux4Way(in=load, sel=address[13..14], a=loadRAM16K1, b=loadRAM16K2, c=loadSCREEN, d=loadKBD); | |
RAM16K(in=in, load=loadRAM16K1, address=address[0..13] out=outRAM16K1); | |
RAM16K(in=in, load=loadRAM16K2, address=address[0..13] out=outRAM16K2); | |
Screen(in=in, load=loadSCREEN, address=address[13], out=outSCREEN); | |
Keyboard(out=outKBD); | |
Mux4Way16(a=outRAM16K1, b=outRAM16K2, c=outSCREEN, d=outKBD, sel=address[13..14], out=out); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment