top of page

Logic Gates

How do computers think?

I'd always ask people, "How do computers think?"

​

People would say, "Well, a person called a programmer programs a program that the computer understands."

 

And I'd ask, "Yes, but how does the computer understand the program?"

 

"Well, another program interprets the programmer's program into a program that the computer can understand."

 

"Yes," I'd reply, "but how does the computer understand that?"

 

And so on.

 

​

The final answer I got was that the program is programmed to program the program that the programmer programmed for the program's program in a program that the program was programmed to understand.

 

Perhaps I didn't explain my question clearly.

 

How does a bunch of metal and plastic understand anything?

​

 

And then one sunny day, I found the answer in a tiny book of science for children.

 

It turns out that the answer is Logic gates.

 

What is a logic gate, you ask?

 

Let me give you an example of one.

 

This is an AND gate:

AND logic gate

The 2 lines at the top are the 'inputs' and the line at the bottom is the 'output'. The output will only send out a signal if a signal is coming in from both inputs at the same time.

​

This is just a conceptual idea. There are many ways to actually build this in the physical world.

​

Nowadays (2017) we use transistors made of tiny circuits of silicone.

 

In the olden days, AND gates were made with electromagnets. You can find videos of people making these things out of Kinex and other interesting materials.

​

Charles Babbage designed a computer in the 1830s using steam power.

​

Let me describe to you a simple electromagnetic setup.

ELECTROMAGNETS

​

Here's a few items we can use to do electromagnetic stuff.

​

​

​

​

​

This is a battery. You've seen these before.

​

​

​

​

​

This is a lightbulb, at least this is what they looked like when I was a kid.

​

​

​

​

​

This is a piece of wire. Pretty standard stuff.

​

​

​

 

 

 

 

We all know what happens when you put these things together:

Yay!

​

Now, let's add a little doozie:

This is a switch. Now we can control the circuit.

For computer purposes, I'd like you to think of the switch as our 'input' and the lightbulb as the 'output'.

​

This design is called a 'buffer' in computer terms and can be described as having the following behaviour:

​

When the input is positive then the output is positive.

​

Or, when the switch is closed then the lightbulb is on.

​

(And vice versa: When the switch is not closed then the lightbulb is not on.)

Now, let's introduce a few more components.

This is a metal bar.

​

​

​

You can wrap a wire around it,

if you so desire.

If you get a current going through the wire then the bar will become a magnet, as long as the current is running.

​

​

This is what is called an electromagnet, or an electrical magent.

This is a piece of metal on a spring. (The spring is fixed at the other end so it won't move.)

If you have this near the electromagnet then the metal piece will move towards the electomagnet when it has a current running through it.

to be continued. last updated on Nov' 20, 2017

bottom of page