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.
|
|
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. |
|||
|
|
I'm not sure I can agree with Dean's answer; you can't answer the question "how can I make a BCD-to-7-segment decoder?" with "use a BCD-to-7-segment decoder". His truth table a good start, however. Cut away the bottom part so that you retain a table for the digits 0 to 3:
This shouldn't be too hard. What do we see?
If you can't see the relationships right away, then add two intermediate results, which you derive from the inputs: that's \$A\$ and \$B\$ inverted. Your function table could look like this:
If you think I've done all the work for you, think again. The real work starts now: create a circuit from this using as few gates as possible. |
|||
|
|
This can be done with a single BCD decoder IC like the 4511. Connect one pushbutton to input A, and the other pushbutton to input B. Leave C and D disconnected. Reference the the sample circuit below. Since this is likely homework, however, I'm guessing that you need to do it with discrete logic gates and transistors. I'd start with the following truth table and design your gates from there. I'm sure you can figure out how to drive the transistors so as to sink current out of a common anode display.
|
|||
|
|
|
The design depends on your goal;
The best answer depends on a well phrased question. |
|||
|
|

