DRIVE A: READY_
WELCOME!

You've found my articles! Please be kind and rewind.

C:\INSERTDISK2\ARTICLES\BINARY>

Logic Gates

How Boolean logic becomes physical circuits inside a computer.

A battery, wire and light bulb

Hands up, how many of you thought I was talking about Bill Gates at the end of the last part? While he is very important to computing he isn’t the Gates I was talking about. The Gates I mean are Logic Gates, they are a way of using the Boolean Logic we learnt in the last part to actually give the computer a way to use the logic we have created.

Circuits

Remember a few chapters back when we talked about an electrical circuit made up of a battery, a switch, a wire and a bulb?

The bulb would only turn on when the switch was flipped to the ON position. This is because, in order for electricity to do its job, it needs to complete a circuit. Basically, the electricity needs a path that eventually returns to its source.

[Image: Switch ON — complete circuit]

When the switch is OFF, it breaks the circuit. The electricity can't get past the break, so the bulb stays off.

[Image: Switch OFF — broken circuit]

Now let's say we add a second switch between the battery and the bulb. We have two choices about how to wire this up. We could wire the switches in series or in parallel.

Series

In series, we add the second switch on the same path as the first, by which I mean the same wire. If we wire this way, both switches need to be ON for the bulb to work.

What happens when we switch Switch A on?

Well... nothing.

Why?

Because the current still has to travel through Switch B. If Switch B is off, there is still a break in the circuit and the bulb can't light.

So with two switches in series:

Switch A AND Switch B must be ON.

Parallel

Now let's wire the switches in parallel, this means we are creating a second route for the circuit.

If we don’t have either switches on then the bulb is off because the circuit isn’t completed the switches are breaking it. If we switch A on and leave B off the light will light up because the circuit is completed through A. If we switch B on and leave A off the bulb will light up again because the circuit is completed through B. If we have both A and B on the bulb will light because the circuit is complete through both A and B.

As long as there is at least one complete path, the bulb lights. So with two switches in parallel:

Switch A OR Switch B can be ON.

Now, as much as I'm sure you love my drawings, we're talking about serious stuff here, so I reckon it's time we got serious.

Well... maybe just a bit.

When talking about electrical circuits, it's incredibly important that there isn't any ambiguity in your plans. The absolute last thing you want is for someone to be building a machine and not be sure whether the thing you've drawn is a converter, a battery, a switch or something else entirely.

So, to make sure everyone knows exactly what we're talking about, electrical engineers use standard symbols to represent the different components.

[Image: Standard circuit symbols]

This means that instead of having to draw a realistic-looking battery, switch or bulb every time, we can use a simple symbol that everyone understands.

Series

[Image: Two switches in series using standard symbols]

Parallel

[Image: Two switches in parallel using standard symbols]

This becomes particularly useful when our circuits start getting complicated.

And believe me, they were about to get complicated but don’t worry, I will help.

From circuits to computers

Early computers were designed on a bit of knowledge and a lot of trial and error. Engineers would decide what they wanted a particular circuit to do and then draw out the circuit before they started soldering components together.

That's fine when we're talking about our little circuit above, or even maybe the wiring in a house. But things get considerably more complicated when you start adding relay after relay, switch after switch and connection after connection.

Suddenly, you have a huge collection of components with wires running in every direction.

You need to be able to follow those connections and work out exactly what the circuit is going to do.

And this is where things get interesting.

One example we'll come across in a later article is a very useful circuit used in computing called an adder.

There are different kinds of adders, but they can become surprisingly complicated. A 16-bit adder, for example, has to deal with a huge number of possible combinations of its inputs.

The engineers knew how to build circuits that could handle these operations. But designing and understanding increasingly complicated circuits by simply following wires and components was becoming a real headache.

There had to be a better way.

What computing needed was someone to come along and make all of this much cleaner and easier to reason about. Thankfully, somewhere in Petoskey, Michigan, a young man was growing up who would eventually do exactly that.

His name was Claude Shannon.