Computer Science 2210

Logic Gates


Logic Gates

Logic Gates

• Logic gates take binary inputs and produce a binary output.
• The values it deals with are 0 and 1 or on and off.
• The binary states are the electrical voltage states, i.e. 0 represents an ON state and 1 represents an OFF state.
• Multiple logic gates are used to create a logic circuit.
• Logic gates are a crucial element of a logic circuit.
• Different logic gates have different characteristics.
• Truth Tables are used to verify the outputs of the logic gates.

Six (6) Types of Logic Gates:

• This figure illustrates the symbols of different logic gates.

1. NOT Gate:

• NOT Gate is the most simple logic gate. 
• It takes a single input and inverts the value.
• If an input is 0, NOT will make it a 1 and vice versa.
• It is represented by 

Logic Notation: X = NOT A
Boolean Algebra X = 

Truth Table:

2. AND Gate:

• AND Gate produces ‘1’ as an output only and only if all inputs are ‘1’.
• If anyone input is '0' then the result will be '0'.
• It is represented by A.B.

Logic Notation: X = A AND B
Boolean Algebra X = A.B

Truth Table:

3. OR Gate:

• OR Gate produces ‘1’ in output if a single input is 1.
• It produces a ‘0’ in output only if both inputs are ‘0’.
• It is represented by a ‘+” sign.

Logic Notation: X = A OR B
Boolean Algebra X = A + B

Truth Table:

4. NAND Gate:

• It is also known as the NOT AND Gate.
• It is the reverse of AND Gate.
• It gives ‘1’ in output if and only if A and B both are NOT ‘1’.

Logic Notation: X = A NAND B
Boolean Algebra X = 

Truth Table:

5. NOR Gate:

• It is also known as NOT OR Gate.
• It is the reverse of OR Gate.
• It produces ‘1’ in output if NOT a single input is 1.

Logic Notation: X = A NOR B
Boolean Algebra X =

Truth Table:

6. XOR Gate:

• It is also known as Exclusive OR Gate.
• It produces ‘1’ in output if, (A is ‘1’ AND B is ‘0’) OR (A is ‘0’ AND B is ‘1’).

Logic Notation: X = A XOR B

Boolean Algebra X = 

OR it can also be written as,

Truth Table:

Logic Circuits:

• Logic circuits are created by connecting logic gates together.
• These circuits are created to perform a particular function.
• A logic circuit truth table is required to understand its function’s nature.

How to Create a Logic Circuit Truth Table:

It is considerably complicated to create a logic circuit truth table.
But if you follow the steps defined below, it will become easy for you to make it yourself.
Don’t overdo yourself by trying to do everything in your head.


1. First, add temporary output letters after each logic gate in a circuit as shown below:

2. Now find out the values of these new letters first i.e. K,L & M.
3. As you can see from the figure, that K is NOT A. 
4. L is the output of A OR
5. M is the output of K AND L.
6. And the final output will be M AND L.
7. This can also be written in the equation as X =
8. Therefore, it is advisable to solve in the same sequence and you will get your truth table easily.

Note: Just as you can make a boolean equation by seeing the logic circuit you can also create a logic circuit from the equation.

Practice Exercise: Create a logic circuit and truth table for the following:

© 2020 O’Level Academy. All Rights Reserved