In our previous tutorial, we have learned about the Boolean algebraic laws and theorems. We learned that the Boolean function can be represented easily in SOP (sum of products) form and POS (product of sums) form. To represent these standardized equations logically, we use the logic gates.

Any Boolean function can be represented by using a number of logic gates by interconnecting them. Logic gates implementation or logic representation of Boolean functions is very simple and easy form.

The implementation of Boolean functions by using logic gates involves in connecting one logic gate’s output to another gate’s input and involves in using AND, OR, NAND and NOR gates. Let’s have a look into the logic gate implementation of SOP and POS forms of Boolean functions.

### Logic gates

Logic gates are the basic building blocks of digital electronic circuits. A logic gate is a piece of an electronic circuit, that can be used to implement Boolean expressions.

Laws and theorems of Boolean logic are used to manipulate the Boolean expressions and logic gates are used to implement these Boolean expressions in digital electronics. AND gate, OR gate and NOT gate are the three basic logic gates used in digital electronics.

#### AND Gate

Logic AND gate is a basic logic gate of which the output is equal to the product of its inputs. This gate multiplies both of its inputs so this gate is used to find the multiplication of inputs in binary algebra.

The output of an AND gate is HIGH only if both the inputs of the gate are HIGH. The output for all the other cases of the inputs is LOW. The logic symbol and the truth table of an AND gate is shown below.

#### OR Gate

The output of the logic OR gate is equal to the sum of its inputs. This gate adds both of its inputs so this gate is used to find the summation or the addition of inputs in binary algebra. The output of an OR gate is HIGH if either of the inputs are HIGH. The output is LOW only when all the inputs are LOW. The logic symbol and the truth table of an OR gate is shown below.

#### NOT Gate

Logic NOT gate is a basic logic gate of which the output is equal to the inverse of its input. This gate produces the complement of the input. So this gate is used to represent the complement of variables in binary algebra. If the input is HIGH, the output is LOW and if the input is LOW, the output is HIGH. The logic symbol and the truth table of a NOT gate is shown below.

### SOP Boolean Function Implementation using logic gates

The sum of product or SOP form is represented by using basic logic gates like AND gate and OR gate. The SOP form implementation will have the AND gate at its input side and as the output of the function is the sum of all product terms, it has an OR gate at its output side. This is important to remember that we use NOT gate to represent the inverse or complement of the variables.

##### Logic gate implementation

#### Implementation for 2 input variables

Implement the Boolean function by using basic logic gates. F = A B + A B’

In the given SOP function, we have one compliment term, AB’. So to represent the compliment input, we are using the NOT gates at the input side. And to represent the product term, we use AND gates. See the below given logic diagram for representation of the Boolean function.

#### Implementation for 3 input variables

Implement the Boolean function by using basic logic gates.

F = A B C + A B C’+ A’ B C’

In the given function, we have two compliment terms, A’B C’ and ABC’. So to represent the compliment input, we are using the NOT gates at the input side. And to represent the product term, we use AND gates. See the below given logic diagram for representation of the Boolean function.

### POS Boolean Function Implementation using logic gates

The product of sums or POS form can be represented by using basic logic gates like AND gate and OR gates. The POS form implementation will have the OR gate at its input side and as the output of the function is product of all sum terms, it has AND gate at its output side. In POS form implementation, we use NOT gate to represent the inverse or complement of the variables.

##### Logic gate Implementation

Ex 1:

#### Implementation for 2 input variables

Implement the Boolean function by using basic logic gates. F = (A + B) * (A + B’)

In the given function, we have a complement term, (A + B) and (A + B’). So to represent the compliment input, we are using the NOT gates at the input side. And to represent the sum term, we use OR gates. See the below given logic diagram for representation of the Boolean function.

#### Implementation for 3 input variables

Implement the Boolean function by using basic logic gates.

F = (A + B + C) * (A’ + B’ +C) * (A + B’ + C)

In the given Boolean function, we have two compliment terms, (A’ + B’ +C) and (A + B’ + C). So to represent the compliment input, we are using the NOT gates at the input side. And to represent the sum term, we use OR gates. See the below given logic diagram for representation of the Boolean function.

### Implementation of Boolean functions using Universal logic gates

‘Universal logic gates’ are NAND gate and NOR gates. The reason behind this is, NAND gate and NOR gate can perform (or can function like) all the 3 basic gates, such as AND gate, OR gate and NOT gate. We can design any basic logic gate by using NAND gate or NOR gate. This is why they are called as “Universal gates”.

Let’s see the implementation of the Boolean functions using universal logic gates.

#### Implementation of Boolean functions using NAND gates

NAND gate is a logical combination of AND gate and NOT gate and this can function like AND gate, OR gate and NOT gate. So we use NAND gates to implement the Boolean function.

The important thing to remember about NAND gate is this is the inverse of basic AND gate. This means the output of the NAND gate is equal to the complement of the output of the AND gate.

Let’s see an example to understand the implementation.

Implement the Boolean function by using a NAND logic gate.

F (A, B, C, D, E) = A + (B’ + C) (D’ + BE’)

In NAND gate implementation, we use NAND gates at both input and output side. Observe the designed logic diagram below. The step by step procedure to implement the given Boolean function using NAND gates is shown below.

First, the given Boolean function or equation should be represented using AND-OR gates. The AND-OR implementation is shown below.

In order to convert the AND gates into NAND gates, a bubble (complement) is introduced at the output of the AND gate. To compensate the bubble, the input of the next gate is also introduced with a bubble. The implementation is shown below.

To impose uniformity at the input, if a gate has one input with a bubble, the other input is also introduced with a bubble. Again, in order to compensate the bubble, the output of the preceding gate is introduced with bubble or complement the literal. The same is shown in the following figure.

If an OR gate is not having any bubble at either of the inputs, bubbles are introduced and are appropriately compensated as shown in the figure below.

An OR gate with two complemented inputs is equivalent to a NAND gate (according to DeMorgan’s Law A’+B’ = (AB)’). Hence, replacing the OR gate, which is having two complemented inputs, with NAND gate, we get the final structure of the implementation of the Boolean function using NAND gates. The final implementation is shown below.

#### Implementation of Boolean functions using NOR gates

NOR gate is the combination of OR gate and NOT gate and this can function like AND gate, OR gate and NOT gate. So we use NOR gate to implement the Boolean functions. The important thing to remember about NOR gate is this is the inverse of basic OR gate. This means the output of the NOR gate is equal to the output of the OR gate.

Let’s see an example to understand the implementation.

Implement the Boolean function by using NOR logic gate.

g (A, B, C, D, E, F) = (A E) + (B D E) + (B C E F)

We can solve the given equation as

g (A, B, C, D, E, F) = AE + BDE + BCEF

= (A + BD + BCF) E

= (A + B (D + CF)) E

In NOR gate implementation, we use NOR gates at both input and output side. Observe the designed logic diagram below.

Chow says

Very useful

Sandipan banerjee says

Can you solve this using nor gate ONLY-

B'(CD)’+A’C’D

satyendra says

s.o.p expression is best suited with nand gate only.

k meher hasanth says

I want to enquire how to implement the A/B using logic gates

Sashikant says

Can u solve this boolean expression using nand gate f=A(B+CD)+BC’

peter busq says

this is great