How do logic gates calculate their output?

3.63K views

Do transistors calculate the output? If so, wouldn’t transistors be the most fundamental logic of computers?

Thanks.

In: Technology

12 Answers

Anonymous 0 Comments

Yes, transistors are the building blocks of logic gates, which are the building blocks of computers. But they don’t really ‘calculate’ their output: they’re too simple for that.

At its most basic, a transistor is a switch that lets electricity flow through it when it receives electricity from a “control” input. So for example:

`power`

`|`

`T —-A`

`|`

`output`

The transistor is labeled “T”. If electricity is put in on input “A”, electricity will flow from the power supply to the output. If “A” is off, nothing will flow to the output. So if we hook two transistors up in a chain:

`power`

`|`

`T—-A`

`|`

`T—-B`

`|`

`output`

electricity will only flow all the way to the output if there’s electricity coming in on both input A **and** input B. This is an “AND” gate.

But if we create two parallel paths like two lanes of a highway, and have A and B each control one “lane”, then electricity will flow through if either A **OR** B is on. This is an OR gate.

(Unfortunately I can’t draw this with ascii art on Reddit.)

… and that’s the starting point for all of computers.

Anonymous 0 Comments

Compute is probably the wrong word at the level of a transistor. At this level you’re just describing components. Transistors don’t compute as they alone don’t allow you to recognize any mathematical output for a given input. They simply control the flow of electricity. You need wires, at least two transistors, a voltage source, and a voltage drain to create a unit of computation called a gate. A gate is a configuration of electrical components, that’s flow of current represents a mathematical computation on some input to derive an output; it only means something because it can be interpreted by a human. A gate is the smallest unit of computation because nothing smaller actually computes anything, whereas a transistor, like a wire or a voltage source, cannot represent any mathematical process. The two fundamental gates are NOT and NAND (or NOR) and all other computations can be generated from configurations of these gates.

Edit: I want to say there *is* a trivial computation that can be performed by just a single wire: the identity function, f(A) = A. This is computed by simply connecting an input pin to an output pin. This is not very interesting and it can’t be used to construct more interesting computation so it’s not really fair to call a wire the basic unit of computation.