0

I'm building a full adder circuit using transistors. I am only doing it for fun, that's why I'm not using IC gates.

I am feeding it 5V and I'm getting really strange outputs. And it isn't even consistent, sometimes it does one thing and other times, other things. The outputs are around 3-4V, the LEDs sometimes shine normally, sometimes very faintly, sometimes not at all. And I just can't get it working. Can you see something off in my schematic?

And yes, I checked my PCB, I soldered everything good, there are no bridges.

I tried removing the resistors before the grounds, (R1, R6, R9, R18, R21, R26, R29, R32, R33) but it still doesn't work.

Here is the schematic: Full adder schematic

Null
  • 7,448
  • 17
  • 36
  • 48
Matthias
  • 3
  • 3
  • I vaguely remember that when I studied my rusty EE diploma, the teacher told us that we could build a full adder using two half adders. So perhaps you can tear your full adder into two halves and test one half each time. I see that you are building logic gates using 2N2222 and resistors. I was wondering that if you tested each gate first, before gluing them together. Or are you just hoping everything should go well, and just test the whole mess in one go? – tlfong01 Mar 05 '21 at 14:51
  • 1
    Well, since you have series resistors in parts of your diagram: divide and conquer. Disconnect some of the stages and test. BTW, are you leaving your inputs floating? – Claudio Avi Chami Mar 05 '21 at 14:56
  • 1
    Sometimes it's useful to put 10k on a transistor base-to-emitter to prevent trickle currents from turning it on "a little bit". – Kyle B Mar 05 '21 at 14:59
  • 1
    @tlfong01 you are right, I only tested the whole thing together and hoping that it'll be good. I feel so stupid now. Gonna test everything then. – Matthias Mar 05 '21 at 19:50
  • 1
    @ClaudioAviChami I'm not leaving them floating, I connect the logical 0s to ground and yeah, I'll be testing it piece by piece tomorrow. – Matthias Mar 05 '21 at 19:51
  • 1
    @KyleB I can't really understand what you mean. I'm not like a professional, but not an absolute starter. I can feel by your comments, that this project was a bit too difficult for me. I only started this, because I couldn't really find easier ones. At least ones that are not too easy. If it's not too much to ask, could you provide some easier, but not like starter level stuff? – Matthias Mar 05 '21 at 19:55
  • 1
    @Matthias What I mean is --- Each of your transistors has 3 pins... In the schematic, the 'base' is the pin on the left. The 'emitter' is the one on the bottom. Place 10k between these pins can stabilize the transistor. With even a trickle of current, the transistor can turn on a little, that error gets amplified down the line so voltages start going wonky. I'm talking micro to nano amperes --- The kind of currents that could result from just sitting too close to your cell phone or TV --- spurious stuff. By placing that resistor there, it slams the door shut on that possibility. – Kyle B Mar 05 '21 at 20:53
  • @KyleB Oh I get it. I'm going to try that too. Thank you for the information! – Matthias Mar 06 '21 at 09:33

2 Answers2

3

With the exception of your "NOT" gates, none of your gates have any voltage gain. They all use transistors wired as emitter followers, which means that the voltage offsets from base to emitter accumulate until your signal levels are useless.

See my answer to Why are NAND gates used to make AND gates in computers? for a more thorough discussion of this issue.

See also Can you make a CPU out of electronic components drawn by hand on paper? and Will this schematic work as a four-bit shift register?

And your question is essentially an exact duplicate of Building a full adder with NPN BJT transistors

Dave Tweed
  • 168,369
  • 17
  • 228
  • 393
  • So in the first paragraph, you mean that only in the NOT gate, the output is almost directly connected to Vcc? In the others it has to flow through transistors. Or you mean that only in the NOT gate, the emitter goes directly to Ground and doesn't like goes into the rest of the circuit? I also checked out the links, that you attached. They seem a bit too difficult for me. I'm gonna search for other sources maybe I can understand something. – Matthias Mar 06 '21 at 10:19
  • Thanks you, that new link actually helped me! Before closing this thread, could you please answer my previous question: "So in the first paragraph, you mean that only in the NOT gate, the output is almost directly connected to Vcc? In the others it has to flow through transistors. Or you mean that only in the NOT gate, the emitter goes directly to Ground and doesn't like goes into the rest of the circuit?" – Matthias Mar 06 '21 at 11:58
  • Actually both. The point is, for the NOT gate, the output "swing" (range of voltage that it can produce) is much greater than the input swing. It has voltage gain. Conversely, with your AND and OR gates, the output swing is always slightly less than the input swing -- each B-E junction that the signal must pass through introduces another 0.7 V drop. Many paths through your circuit have four such drops in series. – Dave Tweed Mar 06 '21 at 12:16
  • I get it now. So the best solution is to just rebuild it with NOR gates? – Matthias Mar 06 '21 at 12:50
0

You can't build a logic family this way -- as previously said, there is no voltage gain (signal restoration) in your AND or OR gates. This means that the output voltage swing (high to low) is smaller than the input swing. Eventually it won't be sufficient for your intended logic 1 (or logic 0) levels.

Build NAND and NOR gates (e.g. your AND's with following inverters.

Take a look at your carry_out signsl. It's at least 0.7 V below the 'B' signal coming in (VBE of Q22). That in turn is at least 0.7 V below its input (Q17) etc. follow that back and you'll see that there isn't a strong logic level.

There are other techniques to build gates with discrete -- investigate RTL or TTL logic.

jp314
  • 18,395
  • 17
  • 46