Advertisement
Guest User

PC.hdl

a guest
Feb 22nd, 2018
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. // JackDraak's HACK project (NAND2Tetris) [22 Feb 2018]
  2. CHIP PC {
  3. IN in[16],load,inc,reset;
  4. OUT out[16];
  5.  
  6. PARTS:
  7. Register(load=rload, in=loriorr, out=regout, out=out); // Increment
  8. Inc16(in=regout, out=incout); // Throw away overflow
  9. Mux16(sel=load, a=incout, b=in, out=lori); // Load
  10. Mux16(sel=reset, a=lori, b=false, out=loriorr); // Reset
  11. Nand(a=true, b=load, out=aout);
  12. Nand(a=true, b=inc, out=bout);
  13. Nand(a=true, b=reset, out=cout);
  14. Nand(a=aout, b=bout, out=about);
  15. Nand(a=true, b=about, out=abnot);
  16. Nand(a=abnot, b=cout, out=rload); // load + inc + reset
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement