Feb
11
2009

Tea or Coffee? Yes Please. Logic gates explained

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

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.

The AND gate

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

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 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

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 XNOR gate

An XOR 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.
  • TwitThis
  • StumbleUpon
  • Facebook
  • Digg
  • Reddit
  • del.icio.us
  • email
Written by Mike in: Blogging,Mike | Tags: , , , , , , , , , , , , ,

5 Comments

  • AmmO says:

    Yes very informative, although a little bit like being taught electronics at primary school mate. What I am wondering is with your latest forays into gliders/paper airplanes is where does the aeronautical slant of these articles appear?

  • Mike says:

    @AmmO – It is all a bit basic, but we really don’t get shown much beyond this as far as the gates go. As for the aeronautical aspect I’ve a few articles I’m hoping to throw out over the next weekon such joys as Stability, radio-aids and the crown-jewel – Regional Climatology

    The technical articles are as much for my good as for information, as writing them means I actually have to know the subject in hand :)

  • AmmO says:

    Yes I know the exact feeling when it comes to answering other peoples posts on codingforums.

    I will email you the feb 09 Tech4T update when I get 5 mins free

  • AmmO says:

    Hmmm first time ive been called charlie brown mr beaton, wasnt he the guy who owned snoopy

RSS feed for comments on this post.


Powered by WordPress | Aeros Theme | TheBuckmaker.com