Electronic – Logic gate counter on 7 segment display

7segmentdisplaydigital-logic

Using logic gates with general purpose transistors, I want to display numbers on a 7-segment display depending on the 2 pushbutton input. If both buttons are not pressed, I want it to say 0. If 1 is pressed, I want it to say 1, if the other one is pressed, I want it to say 2, and if both are pressed, I want it to say 3. I know how to do this with separate LEDs, ( 4 Different  LEDS are lit depending on the switches inputs) ,but I am having troubles figuring this out for a 7-segment display because of the overlapping digits on. I may have done a terrible job explaining this, but any info is helpful.

Best Answer

I'd do this in 2 steps. First make a circuit that has 4 outputs that correspond to your 0-3 codes. You can test this by hooking common LEDs to the outputs. I believe this is a common decoder circuit.

The second step is to connect the transistors to the LED segments. Place a transistor on each segment. Put power on the collector appropriate for the type of LED. Connect the emitter to a specific segment. The base should be connected to your decoder's outputs.

Say you have an 7-seg LED with segments numbered from 0 to 7. You decide segments 1 and 2 need to be lit for decoder output #0. Connect #0 to the bases of the transistors responsible for segments 1 and 2. Repeat for the other 3 outputs. Where you have different outputs sharing a transistor base, you may need diodes to prevent current from flowing 'backwards' and lighting up segments unexpectedly.