I'm trying to make a custom DPad for a game console controller. One of the requirements of a DPad is that only one of up/down may be active at a time, and only one of left/right may be active at a time. Usually you would do this with a physical solution, but I'm looking for a solution within the circuit.
So in the most simplest terms, I have 2 inputs A and B, and 2 outputs A' and B'. A usually outputs A' and B usually outputs B', except for the case when both A and B are high. Very simple truth table, the only interesting thing is the last row:
*When A and B are both high, exactly one of A' or B' should be high, and it should be the corresponding input that became high most recently. If both A and B became high at exactly the same time, then the circuit can just bias towards one, I'm not too worried about this case.
So the question is, how would I build a simple circuit like this? I'm using the 4021 8-Stage Shift Register as the base of my controller, with the inputs of my buttons feeding into this. I'd like it to be as simple as possible, probably using a few logic gates and latches.
So in the most simplest terms, I have 2 inputs A and B, and 2 outputs A' and B'. A usually outputs A' and B usually outputs B', except for the case when both A and B are high. Very simple truth table, the only interesting thing is the last row:
A | B | A' | B' |
0 | 0 | 0 | 0 |
0 | 1 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | * | * |
So the question is, how would I build a simple circuit like this? I'm using the 4021 8-Stage Shift Register as the base of my controller, with the inputs of my buttons feeding into this. I'd like it to be as simple as possible, probably using a few logic gates and latches.