# Lesson : Combinational Logic Circuits

In the previous lessons, we learned about the logic gate “AND”, “OR” and “NOT”. In this lesson, we will make combinational logic circuits using these logic gates and connecting them together in various way. We will also analyze a combinational logic circuits. Below, we have an example of one combinational logic circuit:

In this example, we have two 2-inputs “AND” gates and one two inputs “OR” gate connected together. The output of the “AND” gate on the top left is connected to the top input of the “AND” gate on the right. The output of the “OR” gate on the bottom left is connected to the bottom input of the “AND” gate on the right. Do note that two output can’t be connected together (most of the time but there are some exceptions which we won’t see here). This combinational logic circuit has 4 inputs and one output. We will see how to analyze this circuit but before, we will look at  a quick recap on how each logic gate behave.

“AND” gate

The “AND” logical operation produces a “High” output if all of its input are “1s”. If one or multiples of its inputs are “0s”, the output of the “AND” logic gate will be a zero.

For a 2-inputs “AND” gate, we have the following truth table:

$\begin{array}{c c|c} A & B & Output\\ \hline 0 & 0 & 0 \\ 0 & 1 & 0 \\ 1&0&0 \\ 1 & 1 & 1\end{array}$

“OR” gate

The “OR” logical operation produces a “Low” output if all of its input are “0s”. If one or multiples of its inputs are “1s”, the output of the “OR” logic gate will be a “1”.

For a 2-inputs “OR” gate, we have the following truth table:

$\begin{array}{c c|c} A & B & Output\\ \hline 0 & 0 & 0 \\ 0 & 1 & 1 \\ 1&0&1 \\ 1 & 1 & 1\end{array}$

“NOT” gate

The “NOT” gate is often called the inverting gate and will invert the input. If the input is Low “0”, the output is gonna be High “1”. If the input is High “1”, the output is gonna be Low “0”.

For the “NOT” gate, we have the following truth table:

$\begin{array}{c|c} Input & Output\\ \hline 0 & 1 \\ 1 & 0 \end{array}$

Example:

We will take the combinational circuit from Figure 1 but we are going to set A, B, C and D inputs to specific values (0 or 1). We will then see how to analyze the circuit. For our example A = 1, B = 1, C = 0 and D = 1 as shown on Figure 5. We want to find the resulting output (0 or 1) of this combinational logic circuit.

We are going to start with the “AND” gate in the top left. The “AND” gate produces a “High” or “1” at its output if all of its inputs are “1s”. In our case, all of its inputs are “1s” which mean the output of the top left “AND” gate is going to be “1”.

We are going to continue with the “OR” gate in the bottom left since we don’t have the value of one of the inputs of the right “AND” gate. We need to have all inputs value to be able to find the resulting output. The “OR” gate produces a “High” or “1” at its output if one of its inputs is a “1”. If all of its inputs are “0s”, the “OR” gate produces a “Low” or “0” at its output. In our case, one of its inputs is a “1” which mean the output of the bottom left “OR” gate is going to be “1”.

We are going to continue with the last gate. The “AND” gate on the right will produces a “High” or “1” at its output if all of its inputs are “1s”. In our case, all of its inputs are “1s” which mean the output of the right “AND” gate is going to be “1”.

We have analyzed one of the 16 possibilities (we have four inputs which means we have 2 exponent 4 possibilities) of this circuit. We can fill the truth table of this circuit but it will take some times. In later chapter, we will see that we can have a formula instead of a truth table to describe the circuit behavior. For this lesson, we will do the truth table by analyzing the circuit above just like we did. There are some shortcuts we can do to fill this table rapidly. This is the table we have to fill :

$\begin{array}{c c c c|c} A & B & C & D & Output\\ \hline 0 & 0 & 0 & 0 & ? \\ 0 & 0 & 0 & 1 & ? \\ 0 & 0 & 1 & 0 & ? \\ 0 & 0 & 1 & 1 & ? \\ 0 & 1 & 0 & 0 & ? \\ 0 & 1 & 0 & 1 & ? \\ 0 & 1 & 1 & 0 & ? \\ 0 & 1 & 1 & 1 & ? \\ 1 & 0 & 0 & 0 & ? \\ 1 & 0 & 0 & 1 & ? \\ 1 & 0 & 1 & 0 & ? \\ 1 & 0 & 1 & 1 & ? \\ 1 & 1 & 0 & 0 & ? \\ 1 & 1 & 0 & 1 & 1 \\ 1 & 1 & 1 & 0 & ? \\ 1 & 1 & 1 & 1 & ? \end{array}$

We already have one of the row filled because we have analyzed this inputs combination in our example. One things you might have notice is that we need to have two “1s” at the “AND” gate on the right to have an output “High” or “1”. For this to happen, the top left “AND” gate needs to have a “1” at its output. This is only possible if both inputs are “1s” on the top left “AND” gate which means that all row where either A or B is equals to 0 will result in an output “Low” or “0”. This gives us the following truth table :

$\begin{array}{c c c c|c} A & B & C & D & Output\\ \hline 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 1 & 0 \\ 0 & 1 & 1 & 0 & 0 \\ 0 & 1 & 1 & 1 & 0 \\ 1 & 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 1 & 0 \\ 1 & 0 & 1 & 0 & 0 \\ 1 & 0 & 1 & 1 & 0 \\ 1 & 1 & 0 & 0 & ? \\ 1 & 1 & 0 & 1 & 1 \\ 1 & 1 & 1 & 0 & ? \\ 1 & 1 & 1 & 1 & ? \end{array}$

In the last 3 possibilites we need to analyze, we know that the output of the top left “AND” gate is 1. We need to have two “1s” at the “AND” gate on the right to have an output “High” or “1”. For this to happen, the bottom left “OR” gate needs to have a “1” on either C or D to have an output “High” or “1” at the output of the “OR” gate. We can complete the rest of the table with this. If C or D is a “1”, the output of the circuit will be a 1 and if both C or D are “0s”, the output of the circuit will be a 0. This gives us the following truth table :

$\begin{array}{c c c c|c} A & B & C & D & Output\\ \hline 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 1 & 0 \\ 0 & 1 & 1 & 0 & 0 \\ 0 & 1 & 1 & 1 & 0 \\ 1 & 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 1 & 0 \\ 1 & 0 & 1 & 0 & 0 \\ 1 & 0 & 1 & 1 & 0 \\ 1 & 1 & 0 & 0 & 0 \\ 1 & 1 & 0 & 1 & 1 \\ 1 & 1 & 1 & 0 & 1 \\ 1 & 1 & 1 & 1 & 1 \end{array}$

We are done with this lesson on combinational circuit. The 3 next lessons are going to be a cheat sheet on this chapter and more example like this. The last lesson is going to be exercises similar to the example above. You will have to solve these exercises using what you learned in this chapter.