EveryCircuit
Contact
Reviews
Home
xshane360
modified 5 hours ago

Binary to 7-Segment Decoder

2
0
53
00:37:50
Take a look inside the component you can add to your EveryCircuit, but it's not explained what's actually going on inside. In the top left corner are 4 Logic Sources. Input a Binary number (0 through 9, or 0000 to 1001). From this moment on, to help you identify and follow along, I will refer to the 4 Logic Sources, from left to right, as B3, B2, B1, and B0. The first column of AND gates are the possible 2-bit binary pairs you will need, twice (since we have 4 Logic Sources). (For example, 00, 01, 10, and 11 on B0 & B1; and 00, 01, 10, and 11 on B2 & B3). (See Reference A, below) Normally, we would need 8 AND gates in this column for every possible combination for two 2-bit binary pairs, but since we only need to go up to 9 on our 7-segment display, we will never need "11" on our two most-left Logic Sources(B2 & B3), so 7 AND gates will work just fine. The top AND gate(in the first column) is the "00" pair for B0 & B1. Think of 0(zero) as "not". So, we would say, "NOT B0" and "NOT B1". If you look closely, the inputs to this AND gate are coming from the NOT gate of B0 and the NOT gate of B1. A "1" will pull directly from the Logic Source, while a "0" will pull from the NOT side of that Source. Ref. A Column 1 AND gates: 1st: 00 (B1 & B0) 2nd: 00 (B3 & B2) 3rd: 01 (B1 & B0) 4th: 10 (B1 & B0) 5th: 11 (B1 & B0) 6th: 01 (B3 & B2) 7th: 10 (B3 & B2) The second column of AND gates (ten AND gates, Reference B, see below) will now be pulling from our 2-bit binary pairs (1st column of AND gates, Reference A) to make our binary numbers 0 through 9 (we need to make a number zero on our display as well, this is why we need ten AND gates even though we're only going to number 9). For example, say we want to make the number 7 (binary for 0111). The 8th AND gate (2nd column, see below, Reference B) will need to pull from 5th and 6th AND gates from column 1 AND gates. (Reference A). Why? Well, 0111, so the right two numbers 11, are in slots B0 & B1, so that will come from 1st column 5th AND gate (Reference A). The left two numbers (of 0111), are 01 in the slots of (B3 & B2), so that will come from 1st Column 6th AND gate. Ref. B Column 2 AND gates: 1st: 0000 2nd: 0001 3rd: 0010 4th: 0011 5th: 0100 6th: 0101 7th: 0110 8th: 0111 9th: 1000 10th: 1001 A 7-Segment display has, well, 7 segments. They are labeled in a clockwise manner, starting from the top, as "a", "b"(top-right), "c"(bottom-right), "d"(bottom), "e"(bottom-left), "f"(top-left), and finally "g"(center). Ref. C a ---------------- | | f | | b | g | ---------------- | | e | | c | | --------------- d Now, onto the 1st column of our OR gates. We will focus on the top four OR gates (and the three OR gates to the right of those). These are responsible for lighting the segment "a" when needed. (See Reference D, below). Now, we must ask ourselves, when will segment "a" light-up when certain numbers are displayed? Those numbers are 0, 2, 3, 5, 6, 7, 8, & 9. Notice that numbers 1 & 4 are not included because, when displayed, segment "a" is extinguished. (Reference C, above) Now, back to those first top four OR gates in the 1st column of OR gates. We have four OR gates because eight numbers will light segment "a" (0, 2, 3, 5, 6, 7, 8, & 9), with 2-inputs per OR gate, we can handle these eight numbers with four OR gates. Ref. D Top four OR gates of 1st OR column: 1st: 0 OR 2 2nd: 3 OR 5 3rd: 6 OR 7 4th: 8 OR 9 Well, all we need to do is pull from our 2nd column of AND gates. For example, our first OR gate (0 OR 2), will pull from 0000 or 0010 AND gate (1st and 3rd AND gate from column 2 AND gates, see above, Reference B). The next 3 OR gates will work exactly the same, pulling what they need from the applicable AND gates in the 2nd AND gate column to light segment "a". These top four OR gates will then get "OR"ed together and sent out to segment "a" on our display. (See Reference C). In fact, this whole column of OR gates will work this exact same way, pulling what they need from 2nd column of AND gates to light their respective segments when needed. I hope you enjoyed reading and learning, or a refresher.
published 10 hours ago

EveryCircuit is an easy to use, highly interactive circuit simulator and schematic capture tool. Real-time circuit simulation, interactivity, and dynamic visualization make it a must have application for professionals and academia. EveryCircuit user community has collaboratively created the largest searchable library of circuit designs. EveryCircuit app runs online in popular browsers and on mobile phones and tablets, enabling you to capture design ideas and learn electronics on the go.

Copyright © 2026 by MuseMaze, Inc.     Terms of use     Privacy policy