title: Using opcodes in digital circuit design
body: <p>I'm working on a circuit which performs basic operations such as addition and subtraction using logic gates.</p>
  
  <p>Right now, it takes 3 inputs, two 4 bit numbers, and a 3 bit opcode which indicates what operation to perform.</p>
  
  <p><del>It seems that a 3-8 decoder would be a good idea here. This is my mockup! </del></p>
  
  <p><img src="https://i.stack.imgur.com/Q30sf.png" alt="enter image description here"></p>
  
  <p>To give a little more context, here is what my adder circuit looks like (+). I designed it to take two 4 bit numbers X &amp; Y:</p>
  
  <p><img src="https://i.stack.imgur.com/KgaWw.png" alt="enter image description here"></p>
  
  <p>However, what I am confused about is the fact that I have to feed in 4 inputs or 4 wires to each of the circuit that handles it's respective operations (+, -, =, etc). It appears to only connect one wire to the circuit I need to get to. I need to actually connect 8 wires, as I have to feed in the to 4 bit numbers.</p>
  
  <p>UPDATE: I ended up using a MUX to select the output that I want.</p>
  
  <p><img src="https://i.stack.imgur.com/OUm3M.png" alt="enter image description here"></p>