Well, in an effort to aid my revision for rapidly approaching JAR exams I’ve decided to attempt another technical post, especially seeing as my rough attempt at explaining SALR and DALR (HERE) seems to be popular with good old search engine traffic.
This week I will mostly be discussing Logic gates.
I’m going to skip the construction of these little computing wonders, though for interested parties they’re constructed out of anything from levers and weights through to MOSFET’s (Metal Oxide Semiconductor Feild Effect Transistors) on intergrated circuits such at the processor in the very computer you’re reading this on.
The great god of Wikipedia tells us that the first properly functioning Logic gates were to be found on Charles Babbage‘s Analytical engine. These were actually fairly complex constructions of pegs, barells, levers and all manner of mechanical trickery. Though the basic principles of operation from these gates to modern-day electronic gates is identical. It’s this principle I intend to explain and explore. I’m going to stick to purely electrical logic gates
I’m going to skip the lesson in the Binary (base-2) system and simply summise that as far as we’re concerned if a wire has a potential difference accross it then it’s Logic (Binary) 1, and if it has none it’s Logic (Binary) 0.
I suppose I’m also assuming that we know what a potential difference is, but for the purposes of this article we can define it thus:
If a wire has a potential difference accross it then when it is added into a complete circuit, electrical current will flow in the wire
So, our logic gates look at a selection of wires and (based on their state as on/off – 1/0) create a logical output of 1 or 0.
There are several types of Logic gate which, surprisingly, perform several types of comparason.
Firstly, I’ll introduce the OR gate.

An 'OR' gate
Named because it will return a ’1′ if any one of it’s inputs are ’1′. So if either the top OR the bottom input is 1 it will output 1 as well. If both are 1 it will output 1 but if both are 0 it will output 0.
The AND gate is next, again it’s function is quite simple.

An AND gate
It’ll only return ’1′ if all it’s inputs are also 1. So if the top AND bottom inputs are 1, it will output 1. If not it will output 0.
Next we’ll introduce the NOT operator. This little fellow inverts the logic on a wire. For example, if an input is a ’1′ a NOT operator will make it a ’0′ and vice-versa.

The little circle is the 'NOT' operator
So, using this NOT operator we can invert the output of our AND gate giving us a Not-AND gate or NAND gate.

A NAND gate
A simple way of thinking of this is just to treat is as an AND gate and then reverse the output you get. This will only return ’0′ when all of the inputs are ’1′.
A it follows that you can add the NOT operator to an OR gate as well, making a Not-OR (NOR) gate.

a NOR gate
There’s one other family of gates we need to know about, and that’s either-or gates. They’re basically OR gates but they won’t return ’1′ when both inputs are ’1′. You can get both a XOR gate and a XNOR gate.

An XNOR gate

An XOR gate
Ok, so that’s all our gates. Nice and simple. Next post I’ll go into where they’re used and run through some examples of simple logic circuits. Even some tricks we can pull with the gates to make them store data for us.
Share this:
These icons link to social bookmarking sites where readers can share and discover new web pages.