0
\$\begingroup\$

I'm new to computer science and trying to learn the basics. Have learnt how to create logical gates using simple components like relays, thanks to nandgame.com. This was easy, boolean functions, have no problem with that. Now I have a very basic question about transistors.

Normally, in computer processors, is the collector of a transistor an always-on current, like, a 1 in binary, and the output regulated by the base/gate only, or do they tend to be connected in series, with collector taking a binary input that is either 1 or 0?

enter image description here

I got the impression somehow that the collector does not tend to take a binary input. At the same time, with the relays on nandgame.com, it is very convenient to use their "collector" for binary input, this lets a single relay be an AND gate, etc. So, maybe someone understands what I'm asking and why and can point me in the right direction.

\$\endgroup\$
5
  • 4
    \$\begingroup\$ This is electrical engineering rather than computer science. \$\endgroup\$ Commented Sep 13, 2021 at 13:37
  • \$\begingroup\$ The base is the input and the collect-emitter passes a signal, whether it be from a power rail or the collector-emitter of another transistor. The problem of your approach is it kind of ignores the fact that transistors have certain voltage and current conditions to operate. \$\endgroup\$
    – DKNguyen
    Commented Sep 14, 2021 at 3:36
  • \$\begingroup\$ There are some terminology issues here that make the question hard to read. A collector isn't "an always-on current", and in many logic families like CMOS, it is voltages, not currents, that indicate logic levels. In fact, often times the collector/drain might be the output -- in the end you need to look at the schematics for the logic family you care about (or indicate it specifically here). \$\endgroup\$
    – nanofarad
    Commented Sep 14, 2021 at 3:51
  • \$\begingroup\$ You seem to have some very odd misconceptions here. Do you understand what voltage and current are? \$\endgroup\$
    – Hearth
    Commented Sep 14, 2021 at 4:11
  • \$\begingroup\$ You want to look up how to make logic gates out of transistors. \$\endgroup\$ Commented Oct 4, 2021 at 12:51

2 Answers 2

3
\$\begingroup\$

Relays are switches controlled by a current. Transistors are switches... controlled by a current. FETs are switches... controlled by a voltage.

Gates are constructed by combining switches in various ways, in parallel or serial, to form pull-up and pull-down networks.

Example - NAND Gate (2 switches in series, simulate it here):

enter image description here

All four of these work the same way, using a pair of switches wired in series that pulls down the output to GND when both inputs are HIGH:

  • Relay - both coils on close two switches in series to pull the output down. Resistor pulls up otherwise.

  • Transistor - both NPNs are on, pulling the output down. Resistor pulls up otherwise.

  • nMOS - both nFETs are on, pulling the network down. Resistor pulls up otherwise.

  • CMOS - both nFETs are on, pulling the network down. One or both pFETs pull up otherwise.

Ultimately, all the semiconductor gates shown here drive the outside world with the collector (bipolar) or drain (MOS), sourcing power from the supply or ground. They work that way because that’s the easiest way to bias them and get a strong, close-to-the-rail drive without loading the inputs. In other words, they also buffer the inputs.

Continuing, NOR gates work the same way, but with switches wired in parallel on the pull-down side (simulate it here):

enter image description here


In both cases, CMOS is set apart from the others in that it uses an active pull-up, that exploits the opposite control polarity of the pFET gate to form a complementary switch to the nFETs on the low side.

You'll also notice in the sim that the CMOS gates use almost no current, because the pull-up and pull-down are controlled so that they don't turn on at the same time. That's the key to CMOS low power dissipation: no standby current, regardless of the logic level.

So while seemingly more complicated, requiring 4 elements instead of 2, CMOS zero-standby current and rail-to-rail drive offer huge advantages for large chips, which is why it's the dominant logic type in use today.

Now, you asked about using a ‘collector’ in series with another ‘collector’ to pass a signal. The NAND structures do that, but there’s a type of logic that takes it a step further: the transmission gate. These are most easily realized in CMOS, and are used to form elements like multiplexers, demultiplexers, and latches.

Transmission gates can also be used for logic, much like the relays you used over at nandland. And like relays, they have a neat party trick: they can pass digital or analog signals in both directions transparently, like a physical switch.


Finally, let's touch on contemporary bipolar logic. What is shown above for 'bipolar' is called 'RTL', or resistor-transistor logic. It was an early logic family developed in the 1960s, which saw application in the Apollo Guidance Computer as a 3-input NOR gate.

Contemporary bipolar logic, called TTL, or transistor-transistor logic, is a bit more complex. TTL uses transistors in series and in parallel in some creative ways to achieve lower power and better performance than its predecessors. Beginning with its introduction in the late 1960s up until the mid-1980s, most systems were built with it.

Below is what the guts of TTL NAND and NOR actually look like (simulate it here)

enter image description here

TTL inputs use a 'common base' NPN with inputs applied on the emitters. This is passed through to the collectors and on to the next stage buffer bases. After that, there's some voodoo going on: a phase splitter that allows the circuits to use only NPN transistors in the output stage.

With TTL there's some static current draw in certain states, and of course the inputs source current (100s of uA) when pulled low. You can observe that in the simulation.

Another bipolar logic family, called ECL or emitter-coupled logic, offered a higher-performance option for speed-critical designs. It was notoriously power-hungry, used weird power supplies and differential signals. Its most famous use was for the CRAY-1 and CRAY-2 supercomputers. Try a quick sim here: http://www.falstad.com/circuit/e-eclnor.html

\$\endgroup\$
2
  • \$\begingroup\$ It is a great challenge to try to explain things at such a low level... Just a few remarks: However, relays and BJT are voltage controlled because we need both input and output voltage to cascade gates. For this purpose, we artificially insert resistance into their input circuit (winding the coil with a thin copper wire and connecting a base resistor to the transistor). All these configurations can be represented by the voltage divider configuration where we control the resistance of the top (PMOS), bottom (NMOS) or both (CMOS) legs of the divider. In the latter case, they should overlap. \$\endgroup\$ Commented Dec 10, 2021 at 13:35
  • 1
    \$\begingroup\$ Transistor bases and relay coils require current, and have a DC fan out. FETs do not, and don’t. The gates shown are all buffer types with one unit load inputs. OP is hinting at passing a signal through a BJT like you would a relay. That’s possible with a common-base type connection, but BJT biasing makes it tricky. With CMOS it’s much easier. \$\endgroup\$ Commented Dec 10, 2021 at 17:49
1
\$\begingroup\$

There are no binary inputs. There are voltages and currents. Sometimes we decide that a certain voltage or current means 1 and a certain voltage or current means 0. But that's our decision. That's not physics.

In a simple MOSFET-based gate, you have a resistor connected between the positive power supply, and the output. This sets the output to positive voltage "by default". Then, you have some arrangement of MOSFETs between the output and the ground (negative or zero voltage). If there is voltage between the G and S (gate and source) pins of a MOSFET, then it allows current to flow between the D and S (drain and source) pins.

If there's any path between the output and the ground, then all current from the positive supply through the resistor goes to ground through the MOSFETs and does not develop any "back pressure" (i.e. voltage), leading the output to be a low voltage. If there is no such path, then the "back pressure" develops and the voltage after the resistor is the same as the voltage of the power supply.

The point is, the way the gate works is an interplay of voltage and current and resistance. The inputs are voltages and the output is a voltage, but in the middle it's a tangle of different stuff. If we decide that a high voltage is a 1, that definition doesn't work on a part of the circuit where there is current flowing or not flowing, or a high or low resistance through a MOSFET. You can say that a flowing current means a 1... but when you connect that point to another part of the circuit that uses high or low voltages, just because you said flowing current was 1, that doesn't mean the other part will see it as a 1, if it's not a high voltage!

That is why we talk about whole gates, which have outputs and inputs that are all the same kind of thing, and it doesn't make sense to talk about cutting a gate in half and connecting half of it to another gate. Sure, you can design new gates based on mixing and matching parts of other gates, but the whole thing should be treated as one gate.

\$\endgroup\$
1
  • \$\begingroup\$ An interesting and original viewpoint... \$\endgroup\$ Commented Dec 10, 2021 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.