summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <me@ypei.me>2017-12-08 13:51:31 +0100
committerYuchen Pei <me@ypei.me>2017-12-08 13:51:31 +0100
commit7ce33ecd1734f5a83afb55b8311b541d17cbbd6f (patch)
tree86a01b23460f5f5bd2d719026acd823a1d00dbfe
parent4584283403948cc6d1bd49a83e0fca47a58f8e9f (diff)
finished project 3
-rw-r--r--projects/03/a/PC.hdl16
-rw-r--r--projects/03/a/PC.out28
2 files changed, 39 insertions, 5 deletions
diff --git a/projects/03/a/PC.hdl b/projects/03/a/PC.hdl
index 817ff67..aba68d1 100644
--- a/projects/03/a/PC.hdl
+++ b/projects/03/a/PC.hdl
@@ -17,8 +17,16 @@ CHIP PC {
PARTS:
// Put your code here:
- Register (in=in, load=load, out=regout);
- Inc16 (in=regout, out=incout);
- Mux16 (a=incout, b=regout, sel=load, out=regincout);
- Mux16 (a=regout, b=false, sel=reset, out=out);
+ Mux16 (a=out5, b=in, sel=load, out=out0);
+ Inc16 (in=out0, out=out1);
+ Mux16 (a=out1, b=out0, sel=load, out=out2);
+ Mux16 (a=out0, b=out2, sel=inc, out=out3);
+ Mux16 (a=out3, b=false, sel=reset, out=out4);
+ Register (in=out4, load=true, out=out5, out=out);
+
+ //Inc16 (in=out4, out=out0);
+ //Mux16 (a=out4, b=out0, sel=inc, out=out1);
+ //Mux16 (a=out1, b=in, sel=load, out=out2);
+ //Mux16 (a=out2, b=false, sel=reset, out=out3);
+ //Register (in=out3, load=true, out=out4, out=out);
}
diff --git a/projects/03/a/PC.out b/projects/03/a/PC.out
index 8bd9bf5..5eca76b 100644
--- a/projects/03/a/PC.out
+++ b/projects/03/a/PC.out
@@ -2,4 +2,30 @@
| 0+ | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 |
| 1+ | 0 | 0 | 0 | 1 | 0 |
-| 2 | 0 | 0 | 0 | 1 | 0 |
+| 2 | 0 | 0 | 0 | 1 | 1 |
+| 2+ | -32123 | 0 | 0 | 1 | 1 |
+| 3 | -32123 | 0 | 0 | 1 | 2 |
+| 3+ | -32123 | 0 | 1 | 1 | 2 |
+| 4 | -32123 | 0 | 1 | 1 | -32123 |
+| 4+ | -32123 | 0 | 0 | 1 | -32123 |
+| 5 | -32123 | 0 | 0 | 1 | -32122 |
+| 5+ | -32123 | 0 | 0 | 1 | -32122 |
+| 6 | -32123 | 0 | 0 | 1 | -32121 |
+| 6+ | 12345 | 0 | 1 | 0 | -32121 |
+| 7 | 12345 | 0 | 1 | 0 | 12345 |
+| 7+ | 12345 | 1 | 1 | 0 | 12345 |
+| 8 | 12345 | 1 | 1 | 0 | 0 |
+| 8+ | 12345 | 0 | 1 | 1 | 0 |
+| 9 | 12345 | 0 | 1 | 1 | 12345 |
+| 9+ | 12345 | 1 | 1 | 1 | 12345 |
+| 10 | 12345 | 1 | 1 | 1 | 0 |
+| 10+ | 12345 | 0 | 0 | 1 | 0 |
+| 11 | 12345 | 0 | 0 | 1 | 1 |
+| 11+ | 12345 | 1 | 0 | 1 | 1 |
+| 12 | 12345 | 1 | 0 | 1 | 0 |
+| 12+ | 0 | 0 | 1 | 1 | 0 |
+| 13 | 0 | 0 | 1 | 1 | 0 |
+| 13+ | 0 | 0 | 0 | 1 | 0 |
+| 14 | 0 | 0 | 0 | 1 | 1 |
+| 14+ | 22222 | 1 | 0 | 0 | 1 |
+| 15 | 22222 | 1 | 0 | 0 | 0 |