master
Jamie Munro 2 years ago
parent e28ee921dc
commit d2d30b0ea4
  1. 0
      02/ALU-nostat.out
  2. 7
      02/Add16.out
  3. 9
      02/FullAdder.out
  4. 5
      02/HalfAdder.out
  5. 5
      02/Inc16.out
  6. 2
      03/a/Bit.hdl
  7. 13
      03/a/PC.hdl
  8. 15
      03/a/RAM64.hdl
  9. 13
      03/a/RAM8.hdl
  10. 17
      03/a/Register.hdl
  11. 15
      03/b/RAM16K.hdl
  12. 15
      03/b/RAM4K.hdl
  13. 15
      03/b/RAM512.hdl

@ -0,0 +1,7 @@
| a | b | out |
| 0000000000000000 | 0000000000000000 | 0000000000000000 |
| 0000000000000000 | 1111111111111111 | 1111111111111111 |
| 1111111111111111 | 1111111111111111 | 1111111111111110 |
| 1010101010101010 | 0101010101010101 | 1111111111111111 |
| 0011110011000011 | 0000111111110000 | 0100110010110011 |
| 0001001000110100 | 1001100001110110 | 1010101010101010 |

@ -0,0 +1,9 @@
| a | b | c | sum | carry |
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |

@ -0,0 +1,5 @@
| a | b | sum | carry |
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |

@ -0,0 +1,5 @@
| in | out |
| 0000000000000000 | 0000000000000001 |
| 1111111111111111 | 0000000000000000 |
| 0000000000000101 | 0000000000000110 |
| 1111111111111011 | 1111111111111100 |

@ -14,5 +14,5 @@ CHIP Bit {
OUT out;
PARTS:
// Put your code here:
Mux(a=out, b=in, sel=load, out=out);
}

@ -16,5 +16,16 @@ CHIP PC {
OUT out[16];
PARTS:
// Put your code here:
Or(a=res, b=load, out=or1);
Or(a=or1, b=reset, out=load0);
Register(in=in, load=load0, out=out0, out=out);
Inc16(in=out0, out=incr);
Mux16(a=out0, b=incr, sel=inc out=out1);
Mux16(a=out1, b=in, sel=load, out=out2)
mux16(a=out2, b=false, sel=reset, out=in);
}

@ -15,5 +15,18 @@ CHIP RAM64 {
OUT out[16];
PARTS:
// Put your code here:
DMux8Way(in=load, address=address[3..5], a=load0, b=load1, c=load2, d=load3, e=load4, f=load5, g=load6, h=load7);
RAM8(in=in, load=load0, address=address[0..2], out=out0);
RAM8(in=in, load=load1, address=address[0..2], out=out1);
RAM8(in=in, load=load2, address=address[0..2], out=out2);
RAM8(in=in, load=load3, address=address[0..2], out=out3);
RAM8(in=in, load=load4, address=address[0..2], out=out4);
RAM8(in=in, load=load5, address=address[0..2], out=out5);
RAM8(in=in, load=load6, address=address[0..2], out=out6);
RAM8(in=in, load=load7, address=address[0..2], out=out7);
RAM8(in=in, load=load8, address=address[0..2], out=out8);
Mux8Way16(a=out0, b=out1, c=out2, d=out3, e=out4, f=out5, g=out6, h=out7, sel=address[3..5], out=out);
}

@ -15,5 +15,16 @@ CHIP RAM8 {
OUT out[16];
PARTS:
// Put your code here:
DMux8Way(in=load, sel=address, a=load0, b=load1, c=load2, d=load3, e=load4, f=load5, g=load6, h=load7);
Register(in=in, load=load0, out=out0);
Register(in=in, load=load1, out=out1);
Register(in=in, load=load2, out=out2);
Register(in=in, load=load3, out=out3);
Register(in=in, load=load4, out=out4);
Register(in=in, load=load5, out=out5);
Register(in=in, load=load6, out=out6);
Register(in=in, load=load7, out=out7);
Mux8Way16(a=out0, b=out1, c=out2, d=out3, e=out4, f=out5, g=out6, h=out7, sel=address, out=out);
}

@ -14,5 +14,20 @@ CHIP Register {
OUT out[16];
PARTS:
// Put your code here:
Mux(a=out[0], b=in[0], sel=load, out=out[0]);
Mux(a=out[1], b=in[1], sel=load, out=out[1]);
Mux(a=out[2], b=in[2], sel=load, out=out[2]);
Mux(a=out[3], b=in[3], sel=load, out=out[3]);
Mux(a=out[4], b=in[4], sel=load, out=out[4]);
Mux(a=out[5], b=in[5], sel=load, out=out[5]);
Mux(a=out[6], b=in[6], sel=load, out=out[6]);
Mux(a=out[7], b=in[7], sel=load, out=out[7]);
Mux(a=out[8], b=in[8], sel=load, out=out[8]);
Mux(a=out[9], b=in[9], sel=load, out=out[9]);
Mux(a=out[10], b=in[10], sel=load, out=out[10]);
Mux(a=out[11], b=in[11], sel=load, out=out[11]);
Mux(a=out[12], b=in[12], sel=load, out=out[12]);
Mux(a=out[13], b=in[13], sel=load, out=out[13]);
Mux(a=out[14], b=in[14], sel=load, out=out[14]);
Mux(a=out[15], b=in[15], sel=load, out=out[15]);
}

@ -15,5 +15,18 @@ CHIP RAM16K {
OUT out[16];
PARTS:
// Put your code here:
DMux8Way(in=load, address=address[13], a=load0, b=load1, c=load2, d=load3, e=load4, f=load5, g=load6, h=load7);
RAM8(in=in, load=load0, address=address[0..12], out=out0);
RAM8(in=in, load=load1, address=address[0..12], out=out1);
RAM8(in=in, load=load2, address=address[0..12], out=out2);
RAM8(in=in, load=load3, address=address[0..12], out=out3);
RAM8(in=in, load=load4, address=address[0..12], out=out4);
RAM8(in=in, load=load5, address=address[0..12], out=out5);
RAM8(in=in, load=load6, address=address[0..12], out=out6);
RAM8(in=in, load=load7, address=address[0..12], out=out7);
RAM8(in=in, load=load8, address=address[0..12], out=out8);
Mux8Way16(a=out0, b=out1, c=out2, d=out3, e=out4, f=out5, g=out6, h=out7, sel=address[13], out=out);
}

@ -15,5 +15,18 @@ CHIP RAM4K {
OUT out[16];
PARTS:
// Put your code here:
DMux8Way(in=load, address=address[9..12], a=load0, b=load1, c=load2, d=load3, e=load4, f=load5, g=load6, h=load7);
RAM8(in=in, load=load0, address=address[0..8], out=out0);
RAM8(in=in, load=load1, address=address[0..8], out=out1);
RAM8(in=in, load=load2, address=address[0..8], out=out2);
RAM8(in=in, load=load3, address=address[0..8], out=out3);
RAM8(in=in, load=load4, address=address[0..8], out=out4);
RAM8(in=in, load=load5, address=address[0..8], out=out5);
RAM8(in=in, load=load6, address=address[0..8], out=out6);
RAM8(in=in, load=load7, address=address[0..8], out=out7);
RAM8(in=in, load=load8, address=address[0..8], out=out8);
Mux8Way16(a=out0, b=out1, c=out2, d=out3, e=out4, f=out5, g=out6, h=out7, sel=address[9..12], out=out);
}

@ -15,5 +15,18 @@ CHIP RAM512 {
OUT out[16];
PARTS:
// Put your code here:
DMux8Way(in=load, address=address[6..8], a=load0, b=load1, c=load2, d=load3, e=load4, f=load5, g=load6, h=load7);
RAM8(in=in, load=load0, address=address[0..5], out=out0);
RAM8(in=in, load=load1, address=address[0..5], out=out1);
RAM8(in=in, load=load2, address=address[0..5], out=out2);
RAM8(in=in, load=load3, address=address[0..5], out=out3);
RAM8(in=in, load=load4, address=address[0..5], out=out4);
RAM8(in=in, load=load5, address=address[0..5], out=out5);
RAM8(in=in, load=load6, address=address[0..5], out=out6);
RAM8(in=in, load=load7, address=address[0..5], out=out7);
RAM8(in=in, load=load8, address=address[0..5], out=out8);
Mux8Way16(a=out0, b=out1, c=out2, d=out3, e=out4, f=out5, g=out6, h=out7, sel=address[6..8], out=out);
}
Loading…
Cancel
Save