Logic gates are the basic components in digital electronics. They are used to create digital circuits and even complex integrated circuits. For example, complex integrated circuits may bring already a complete circuit ready to be used – microprocessors and microcontrollers are the best example – but inside them they were projected using several logic gates. In this tutorial we will teach you everything you need to know about logic gates, with several examples.

As you may already know, digital electronics accept only two numbers, “0” and “1.” Zero means a 0 V voltage, while “1” means 5 V voltage or 3.3 V voltage on newer integrated circuits. You can think “0” and “1” as a light bulb turned off or on or as a switch turned off or on.

A letter, also known as variable, represents a binary number. So “A” can be “0” or “1.” So, if A is connected to a switch, A will be “0” when the switch is turned off and “1” when the switch is turned on. A line drawn right above the variable name means that the variable is inverted. For example, if A = 0, /A will be “1,” and if A = 1, /A will be “0.” On text processors we need to substitute the line drawn above the letter with a slash because it is hard to draw a line above the letter. So here will be using this kind of notation due to a limitation on our text processor.

Now that you know the basics, we can introduce you to logic gates.


Gabriel Torres is a Brazilian best-selling ICT expert, with 24 books published. He started his online career in 1996, when he launched Clube do Hardware, which is one of the oldest and largest websites about technology in Brazil. He created Hardware Secrets in 1999 to expand his knowledge outside his home country.