title: Trying to build a PC (counter) for the nand2tetris book, but I'm having some trouble with the logic
body: <p>Here's my code:</p>
  
  <pre><code>CHIP PC {
      IN in[16],load,inc,reset;
      OUT out[16];
  
      PARTS:
      Inc16(in = regout, out = incout);
      Mux16(a = regout, b = incout, sel = inc, out = incdecision);
      Mux16(a = incdecision, b = false, sel = reset, out = resetdecision);
      Mux16(a = regout, b = resetdecision, sel = load, out = loaddecision);
      Register(in = loaddecision, load = true, out = regout, out = out);
  }
  </code></pre>
  
  <p>Basically, the value coming out of the register is incremented, which is only accepted if inc is 1 (checked via Mux) which then goes through another Mux which may reset it, and then another Mux which may or may not write it depending on the value of load. Then whatever value came out of that (be it the changed value or the value coming from the old register) is put into the register.</p>
  
  <p>What am I doing wrong?</p>