How to Control Two 7-Segment Displays?

  • Thread starter Fatima Hasan
  • Start date
  • Tags Tags
    Control
23 replies · 4K views · last reply
Fatima Hasan
Messages
315
Reaction score
14

Homework Statement


Block diagram of a binary to decimal converter: four inputs A, B, C, D feed a box labelled Circuit to be Designed, whose outputs drive two 7-segment displays labelled (1) and (2). Text: Use 6 (not 6) for 6; Use 9 (not 9) for 9.


Homework Equations


-

The Attempt at a Solution


Seven Karnaugh maps labelled a1 to g1, each a 4-variable grid with AB across the top and CD down the side, filled with 1s and 0s for segment logic.

Handwritten Boolean expressions for segment outputs of a 7-segment display: a1 = A + B-bar + C-bar, b1 = 1, c1 = 1, d1 = A-bar + B-bar + C-bar, e1 = A-bar + B-bar + C-bar, f1 = A-bar + B-bar + C-bar, g1 = 0.

Seven Karnaugh maps labelled a2 to g2, each a 4-variable grid with AB across the top and CD down the side, filled with 0s and 1s.

Handwritten-style list of Boolean product-of-sums expressions labelled a2 through g2, each in variables A, B, C, D with overbars for complements.


I tried to design the circuit to control the first 7-segment , but I didn't get the correct answer.
Logic circuit diagram with inputs 1, 0, B, C, 1, 0 feeding a NAND gate and an OR gate with input A, driving segments g and a of a 7-segment display, plus a +5V supply and a dot output.

Could someone check where is my mistake ?
 
Attachments
  • Block diagram of a binary to decimal converter: four inputs A, B, C, D feed a box labelled Circuit to be Designed, whose outputs drive two 7-segment displays labelled (1) and (2). Text: Use 6 (not 6) for 6; Use 9 (not 9) for 9.
    Capture.png
    28.8 KB · Views: 1,652
  • Seven Karnaugh maps labelled a1 to g1, each a 4-variable grid with AB across the top and CD down the side, filled with 1s and 0s for segment logic.
    Capture1.png
    16.4 KB · Views: 1,003
  • Handwritten Boolean expressions for segment outputs of a 7-segment display: a1 = A + B-bar + C-bar, b1 = 1, c1 = 1, d1 = A-bar + B-bar + C-bar, e1 = A-bar + B-bar + C-bar, f1 = A-bar + B-bar + C-bar, g1 = 0.
    gif.gif
    1.8 KB · Views: 852
  • Seven Karnaugh maps labelled a2 to g2, each a 4-variable grid with AB across the top and CD down the side, filled with 0s and 1s.
    Capture22.png
    14.5 KB · Views: 948
  • Logic circuit diagram with inputs 1, 0, B, C, 1, 0 feeding a NAND gate and an OR gate with input A, driving segments g and a of a 7-segment display, plus a +5V supply and a dot output.
    2222.png
    4.5 KB · Views: 675
  • Handwritten-style list of Boolean product-of-sums expressions labelled a2 through g2, each in variables A, B, C, D with overbars for complements.
    2.gif
    8.5 KB · Views: 910
I'll check it over in more detail in a bit, but there are only 4 binary inputs to this 2-digit display, right? What is the maximum decimal number that can be displayed? When the lead digit is zero, do you want to display a "0" or just leave that display off? :smile:
 
berkeman said:
What is the maximum decimal number that can be displayed
9 ?
 
berkeman said:
When the lead digit is zero, do you want to display a "0" or just leave that display off?
Want to display a "0" .
 
Fatima Hasan said:
Want to display a "0" .
Okay. You see how "off" would be easier, right? :smile:

So start with a table like this:
Code:
ABCD  d1 d2
0000  0  0
0001  0  1
etc.
1111   ?  ?
and then check your work against that table...
 
Oh wait, maybe you already did that. I was confused by all of the "1" entries for the 2nd display, but maybe it's just because you are displaying "0" so much. Let me take a closer look...
 
berkeman said:
Shouldn't b2 and c2 always be on?
b1 and c1 are always on.
For example , when the decimal number is 12 ( d1=1 and d2 = 2 ) :
b1 and c1 = 1 .
a2=0 , b2 =0, c2 = 0 , d2 = 1 , e2= 1 , f2= 0 and g2 = 1.
 
Ah, got it. Sorry, I had the numbers of the two displays mixed up. So which digit is this simulation for?

Logic circuit diagram in a simulator: input switches feed an AND gate and an OR gate driving the segments of a 7-segment display, with the display lit to show a letter E.
 
Attachments
  • Logic circuit diagram in a simulator: input switches feed an AND gate and an OR gate driving the segments of a 7-segment display, with the display lit to show a letter E.
    upload_2018-11-30_8-44-23.png
    8.2 KB · Views: 572
Also, are you using a common-cathode or common-anode display? It looks like the segments are just inverted in your diagram, if it's for the most significant digit. Switch to a common-cathode display if you want to drive the segments with "1 = ON"...
 
berkeman said:
So which digit is this simulation for?
The first one (d1).
 
berkeman said:
Also, are you using a common-cathode or common-anode display?
I don't know what is the difference between them , we haven't covered that yet.
 
Fatima Hasan said:
I don't know what is the difference between them , we haven't covered that yet.
You would drive the segments of a common-cathode LED display high to turn them on. The common-cathode of all of the LED segments is connected to ground:

https://www.electronics-tutorials.ws/articles/segment1.gif

https://www.electronics-tutorials.ws/articles/segment1.gif

In a common-anode LED display, you connect the common-anode to your +5V supply, and drive the segments low to turn them on. Your display in the simulation appears to be the common-anode type, since the segments are off when you drive them high, and on when you drive them low. That may be your only issue with this problem...
 
berkeman said:
Your display in the simulation appears to be the common-anode type, since the segments are off when you drive them high, and on when you drive them low.
Logic circuit simulation: switches B and C feed an AND gate, whose output and input A feed an OR gate driving a seven-segment display showing a zero, with +5V and ground connections.

Got it , thanks a lot for your help.
 
Attachments
  • Logic circuit simulation: switches B and C feed an AND gate, whose output and input A feed an OR gate driving a seven-segment display showing a zero, with +5V and ground connections.
    232323.png
    4.6 KB · Views: 543
  • Like
Likes   Reactions: berkeman
Fatima Hasan said:
Got it , thanks a lot for your help.
Great! I think I would turn off the dot though... :smile:
 
berkeman said:
Great! I think I would turn off the dot though... :smile:

This is the simulation for the second digit :
https://www.physicsforums.com/attachments/234945

But I didn't get the correct answer , It should be 0 instead of 1 . Also , I am not sure if that is the minimum number of gates or not.
Could you check it please ?
 
berkeman said:
Great! I think I would turn off the dot though... :smile:
I solved the question again and got different answers .
In my first solution, I started by doing simplification then I took the commons between them and I got 28 gates in the final answer ... While in my second solution , I did the opposite by taking the commons in the beginning and then I got 24 gates in my final answer ...

Here's my first solution :
Logic circuit schematic with four input columns feeding many AND, OR and NOT gates, wired to two seven-segment display outputs on the right.

The second one :
Logic circuit schematic with four inputs a, b, c, d (with inverters) feeding a network of AND and OR gates, with outputs driving two seven-segment displays on the right.

Which method is the correct one ?
Thanks .
 
Attachments
  • Logic circuit schematic with four input columns feeding many AND, OR and NOT gates, wired to two seven-segment display outputs on the right.
    Untitled.png
    15.5 KB · Views: 554
  • Logic circuit schematic with four inputs a, b, c, d (with inverters) feeding a network of AND and OR gates, with outputs driving two seven-segment displays on the right.
    Untitled1.png
    17.5 KB · Views: 523
Last edited:
berkeman said:
I mean what is the decimal equivilant of 0b1111 = 0xF = 0d?
@berkeman, did you intend something else for that last number?
 
Mark44 said:
@berkeman, did you intend something else for that last number?
I was just asking what the "?" would be. 0xF = what in decimal... The OP seems to be doing okay now, I was a bit confused early on in the thread about which digit was which.
 
Fatima Hasan said:
Which method is the correct one ?
Do they both simulate correctly? If so, the one with the fewer gates would be the preferred answer, no?

Also, have you looked at IC schematics for the parts that do this function? That may be a good cross-check for your work. Just Google 7-segment display drive ICs or similar, and use Google Images to start looking at their schematics. :smile:
 
  • Like
Likes   Reactions: Fatima Hasan
berkeman said:
Do they both simulate correctly? If so, the one with the fewer gates would be the preferred answer, no?

Also, have you looked at IC schematics for the parts that do this function? That may be a good cross-check for your work. Just Google 7-segment display drive ICs or similar, and use Google Images to start looking at their schematics. :smile:
Thanks for your help .
 
berkeman said:
I was just asking what the "?" would be. 0xF = what in decimal... The OP seems to be doing okay now, I was a bit confused early on in the thread about which digit was which.
I thought that might be what you were doing, but "0d?" was confusing to me, since 0xd would be 13 (decimal), which is different from 0xF.