15 years after CS 101, I have a “practical” use for the digital logic gates we learned and I about and I have long since forgotten… Redstone circuits in Minecraft.
We have a subway system for transportation that mainly runs in a loop, so each station has only two destinations. The circuitry for this is very simple, as there is only two states. We have an indicator light for the direction the cart will go when it is launched from the station. As the system grows, there will be stations with more than two possible destinations.
The track switching isn’t difficult, but I’m having trouble with the destination signal lights. If I have four possible, destinations, I require two bits of input, with the following combinations:
Each combination will light up one of the destination signal lights.
I have built a Half-adder and attached a NAND gate to the inputs as well.
The NAND gate lights up on 00, the half-adder’s XOR gate lights up on 01 or 10, and the half-adder’s AND gate lights up on 11.
Of course, the problem I have here is no way to differentiate between 01 and 10. XOR is true for both those inputs.
So, what to I do here? An even/odd finite state machine? That might end up taking up too much space. I’d love to hear any suggestions from people who remember their digital logic, and/or minecrafters.