(Part 3 of 3)
Building the Logic Gates.
By now you should have opened the Logic Gate spreadsheet and know what they look like. Two merged cells at the top. Two bordered cells going down the left side and a bold bordered cell to the right. The puzzle was to make them work like logic gates. That turned out to be easy. A simple “=IF(“ formula did the trick. I made a statement about the two cells on the left and gave the true and false part of the formula a 1 or 0 depending on what was required.
0 0 1 1
0 1 0 1
AND 0 0 0 1 =IF(O3+O4=2,1,0)
NAND 1 1 1 0 =IF(R3+R4=2,0,1)
OR 0 1 1 1 =IF(U3+U4=0,0,1)
NOR 1 0 0 0 =IF(X3+X4=0,1,0)
XOR 0 1 1 0 =IF(AA3+AA4=1,1,0)
XNOR 1 0 0 1 =IF(AD3+AD4=1,0,1)
That’s it in a nutshell.
Copy and paste a gate where you want it. Click on one of the left cell boxes and either drag the box that appears in the original location or simply type “=” and then click on the box/cell you want to be wired to. Do it again with the other left side box and repeat until you’ve made something.
Here is a tip: If you want to change one gate for another, you only need to copy/paste the bottom right box. This way the hypothetical wires stay connected. Of course you’ll also want to copy/paste the new gate name.
I’ll attach the 4 channel switch and my Quadrature reader. You will see a similarity that I also used on the big project. One might say I could have used the same inverter (NOT) twice rather than having two. That is correct but I like the visual flow and less labels.
Speaking of labeling I found the left side works well for this. This makes your gates 3x3 so, leave room for that if you’re building something big. Also don’t forget about “Trace Precedents” and “Trace Dependents” in the formulas tab. It is often handy to see the wires when troubleshooting.