• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Build Electronic Circuits

Build Electronic Circuits

Electronics explained in a simple way

  • Start Learning
    • Basic Electronics
    • Digital Electronics
    • Circuits
    • Practical Skills
      • Printed Circuit Boards
    • Microcontrollers
      • Arduino
    • Maker Lifestyle
      • Podcast
  • About Me
  • Blog
  • Products
  • Contact
You are here: Home / Digital Electronics / Logic Gates And How They Work

Logic Gates And How They Work

September 11, 2020 By Øyvind Nydal Dahl 6 Comments

I was first introduced to logic gates when I was around 14 years old. I had heard that computers consisted of ones and zeroes. But I didn’t understand what that really meant.

So I asked my father to explain it. And I loved his explanation because it was so simple and easy to understand. Read that article first if you’re not sure what a 1 and a 0 is yet.

Logic gates are components that we use for “doing stuff” with the 1s and 0s. You can combine them to create building blocks like flip-flops, adders, and more. Which you can use to build calculators, Arduinos, and even smartphones and computers!

Below, you’ll find an overview of the logic gates, their logic gate symbols, and how they work.

NOT gate/Inverter

The simplest logic gate of all is the NOT gate. It takes one bit as input (A). And it gives as an output (Y) what is NOT on the input. So if there is a 1 on the input, its output is 0. And if there is 0 on the input, its output is 1. It’s also called an inverter.

If you want to use a NOT gate in your circuit, you can for example use the CMOS IC 4572 or 40106.

Logic gate symbol for NOT gate
Input (A)Output (Y)
01
10
NOT Gate Truth Table

AND gate

The AND gate takes two (or more) inputs and gives out a 1 if all the inputs are 1. Otherwise, it gives out a 0.

If you want to use it in a circuit, the CMOS IC 4081 contains 4 AND gates.

The truth table is below, but all you really need to remember is that the AND gate needs a 1 on input A and input B to give out 1.

Logic gate symbol for AND gate
Input AInput BOutput Y
000
010
100
111
AND Gate Truth Table

OR gate

The OR gate takes two (or more) inputs and gives out a 1 if any of the inputs are 1. Otherwise, it gives out a 0.

If you want to use it in a circuit, the CMOS IC 4071 contains 4 OR gates.

The truth table is below, but all you really need to remember is that the OR gate needs a 1 on input A or input B to give out 1.

Logic gate symbol for OR gate
Input AInput BOutput Y
000
011
101
111
OR Gate Truth Table

NAND gate

The NAND (or NOT AND) gate operates in the opposite way of the AND gate. It’s like if an AND gate had a NOT gate on its output:

A NAND gate made from logic gates AND + NOT

If you want to use NAND gates in a circuit, the CMOS IC 4011 contains 4 NAND gates.

You’ll find the truth table below. But all you need to remember is that the only time the output of a NAND gate is 0 is when both the inputs are 1.

Logic gate symbol for NAND gate
Input AInput BOutput Y
001
011
101
110
NAND Gate Truth Table

NOR gate

The NOR (or NOT OR) gate operates in the opposite way of the OR gate. It’s like if an OR gate had a NOT gate on its output.

A NOR gate made from logic gates OR + NOT

If you want to use NOR gates in a circuit, the CMOS IC 4001 contains 4 NOR gates.

You’ll find the truth table below. But all you need to remember is that the only time the output of a NOR gate is 1 is when both the inputs are 0.

Logic gate symbol for NOR gate
Input AInput BOutput Y
001
010
100
110
NOR Gate Truth Table

XOR gate

Logic gate symbol for XOR gate

The XOR (or Exclusive OR) gate outputs 1 if its two inputs are not equal. You’ll find four XOR gates in the CMOS IC 4070.

Input AInput BOutput Y
000
011
101
110
XOR Gate Truth Table

XNOR gate

Logic gate symbol for XNOR gate

The XNOR (or Exclusive NOT OR) gate outputs 1 if its two inputs are equal. It basically works like an XOR gate with an inverter on the output. You’ll find four XNOR gates in the CMOS IC 4077.

Input AInput BOutput Y
001
010
100
111
XNOR Gate Truth Table

Using Logic Gates in Circuits

A logic gate can be built with transistors and usually comes as an Integrated Circuit (IC).

There are two classic IC series that contain a lot of the same functions; the 7400-series and the 4000-series.

The 7400-series is the oldest series. The 4000-series was introduced as a lower-power and more versatile option to the 7400. But today, several families of the 7400-series exist, some with similar properties as the 4000-series.

List of common 4000 series IC with pinouts, explanations, and example circuits

Complete list of ICs in the 4000-series
Complete list of ICs in the 7400-series

Filed Under: Digital Electronics

Reader Interactions

Comments


  1. S. R. Das says

    July 9, 2014

    More explanation required in this manne

    Reply

  2. Arnav Mahajan says

    November 5, 2016

    You should explain with the use of some transistor including circuit diagrams and some real circuits including videos.

    Reply

    • admin says

      January 7, 2019

      Yep, will update this soon.

      Reply

  3. Dave says

    January 3, 2019

    I’ve heard the terms of true and false being used to describe the state of something. Can you please elaborate on this at all? Thanks

    Reply

    • admin says

      September 11, 2020

      Often true and false is used in programming as a replacement for 1 and 0.

      True = 1 = HIGH
      False = 0 = LOW

      Best,
      Oyvind

      Reply

  4. livingstone says

    November 3, 2020

    i was tought b4 but i didn’t undestand but after i read thru this artical am able to get the concept very well. thanks for your sacrifice.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Search:

Footer

Topics

  • Basic Electronics
  • Digital Electronics
  • Circuits
  • Practical Skills
  • Microcontrollers
  • Maker Lifestyle
  • Newsletter Archive

Social:

  • Facebook
  • Twitter
  • YouTube

Copyright © 2021 · Ohmify AS · Terms and Conditions · Privacy Policy