# How to better understand binary data streams as electric signals?

I'm aware that at any step of any computer process the input of a user/program (that gets translated from code to machine language and then to cpu instructions), is represented using both electrically binary and logically binary streams. I know that any operation involves high and low voltages that correspond to 1s and 0s, but what is the component that turns current to data and vice-versa, how does that happen?

I'm a software developer, but at the moment I want to better understand the hardware part of computing, so please take that into consideration as well.

Kind regards!

• Possibly relevant: electronics.stackexchange.com/questions/75098/… Aug 18 '19 at 21:26
• That helps a lot, thank you! Aug 18 '19 at 21:32
• @tudorarion Have you looked up Ben Eater's videos and web pages on building your own 8-bit computer using breadboards? (What he does is pretty much how I also got started -- though I did these things in 1974 and used wire-wrapping, instead.) Also, you might look up Harry Porter's Relay Computer. That computer is a few miles away from me.
– jonk
Aug 18 '19 at 21:35
• When I speak to you and you listen, where is the component of your body that turns sound into words and vice-versa? Aug 19 '19 at 0:24
• I'll give those videos by Ben Eater a try, @jonk, along with researching about the relay computer. Cheers! Aug 19 '19 at 4:36

The basic building block of a digital system is a gate. Gates implement basic logical functions like AND, OR, NOT (inversion) and multiplex.

Gates, in turn, are ganged together to implement higher level functions like arithmetic, registers, data routing and storage.

At the electrical level, gates are made of transistors. The transistors operate as switches to implement the gate functions, passing or blocking current under the control of another input.

It is possible to build a computer using only one kind of gate. As long as you have something that can do an OR or AND, and an inversion, you can make any kind of logic with it. The Apollo Guidance Computer, for example, made do with only one kind of logic: a NOR gate.

For illustration purposes, here's a CMOS version of a NOR gate:

The CMOS NOR function uses two types of switch transistors: P-FETs and N-FETS (the P-FETs have the bubble on the control input, also called a gate.) Follow the truth table to see which FETs will turn on, and how this will drive the output.

Can you see how such a gate could be used for AND, when combined with inverters? That's a trick called DeMorgan's Theorem and it's how those slide-rule folks did it back in 1969, and how it's still done today.

Speaking of inverters, here’s how that looks in CMOS:

First, logic devices typically deal with voltages and don't care about the currents involved. In computers in particular, the currents just limit the speed of the circuit. You have to let the circuit become stable in a new voltage pattern before you can advance to the next cycle. That's why computers have at least one oscillator feeding a several-MHz clock signal into the circuit.

Second, there isn't “data” inside a computer, and thus, it doesn’t need to be converted.

Computer circuits are ridiculously complex, but then again, because they consist of repeated patterns —building blocks— of tinier standard circuits, they are still easy to understand and to build.

But in the end, all “data” is still voltages. “Data” is just a name for a voltage —either a high or a low voltage— at a certain named point of the circuit.

Capacitors are things that store charge. Current can charge or discharge a capacitor to some voltage. Logic state is simply defined as a set of capacitors in some ranges of voltages. (or for longer time scales, sometimes to the magnetic direction of small bits of spinning rust)

Logic and arithmetic is done by simple circuits that do non-linear translation of one set of voltages to another set, which can optionally be saved (by charging with current) in some capacitors as voltages representing a new state.

The combination is Turing complete. (except for infinite size)