 In this video, we're going to show the procedure to derive a circuit from a given Boolean expression. We start the example with this given Boolean expression, x times y plus z prime. From this Boolean expression, we can immediately derive the truth table by exercising all possible eight combinations of the values of x, y, and z. Those values will obtain this column over here, which is the output or the result of evaluating this Boolean expression. Now, suppose that instead of being given the Boolean expression, you're only given the truth table, and you're requested to implement a digital circuit that replicates the behavior specified by this table. So one possibility is to use what we call the canonical representation sum of products. The sum of product representation of this truth table over here requires us to create a product for each row in the truth table that has a value 1 in the output column. And this product needs to be a Boolean expression that returns 1 when these symbols over here specifically have this combination. So this row over here will translate into the product x prime, y prime, c prime. This row will be x prime, y c prime. This row that has a 1 as well would be x, y prime, c prime. This row will be x, y, z prime. And the last row, which is the last one with a 1 here, will give us x, y, and z. So so far, what we have done is derived from this expression, the truth table, and from the truth table, the sum of products. Now if we look carefully, this sum of products is already telling us one possible circuit we can implement with this. We can represent or produce the value of each of these products as a 3 input AND gate. So we have 1, 2, 3, 4, 5 of these products, so we're going to create 1, 2, 3, 4, and 5 inputs gates. Each one of these will implement the conjunction or the product of these sum of products. And then at the end what we're going to do is the result of each one of these gates will be fed as an input in an OR gate connected the way it is done here. So this will be the output of all circuits. What remains to be connected then is each of the 3 inputs of these AND gates. But as we can see, for each one of them, we're going to have a connection to either a symbol or its negation. So one possibility is to say, well, we're going to have the input x here, but also we are going to negate this value to create x bar. The same thing for y, we're going to generate y, but also the negation of y, and finally z, and the negation of z. So this trick over here allows me to access both the value of my symbol and the value of its negation. Now the trick here is the following. We go by one on these gates and we decide how to connect either of these six signals, the correct three signals to the right AND gate. Let's start from the last term and we know here that we have to connect x, y, and z. So what we do is we take this first input x and connect it like this. The second one will be y, so we connect it like this, and the third one will be z, and we connect it like this. So with these three connections, we have replicated this product, which itself is feeding into this overall sum. We do exactly the same for the previous AND, in this case it's x, y, and z prime. So x I simply connected like this, y I connected like this, but now z prime, rather than connected to this line, which is z, I have to bring the value of this signal all the way down here and connect it like this. This product over here contains x, y prime, z prime. So we will connect x like this, y prime we need to bring down the line of this inverter. And z prime we already have it here, so we connected it like this. This term over here is x prime, y, z prime. So the first thing we do is we connect this to x prime, which brings it down like this. The second one is y, we connect it like this, and the third one is z prime, which we have it right here. And finally this term is x prime, y prime, z prime, which means I have to connect the three inputs of this gate to the three lines that come out of the inverters. So this is the result. This is the digital circuit derived from the Boolean expression. Now let's summarize the process. We started with the expression, we obtained the truth table. With the truth table we know how to obtain a canonical representation, which is the sum of products, and this sum of product corresponds almost one to one with the structure of this circuit. The only thing that we have used is gates with arbitrary number of inputs. So in this case, since the function has three input variables, all these AND gates will have three inputs. AND, the overall OR, or the final OR that we connect all of them has as many inputs as terms or products are in our SOP representation. Now once we have that, we can closely look at what happened here. We started with this expression, let's call it E1, and then we derive this other expression, which is E2. Now these two expressions, E1 and E2, they represent exactly the same function, therefore they are equivalent. We can write here that E1 is equivalent to E2. Now from E2, we derive this circuit. But if we look closely at this expression here, we also have the possibility of deriving a circuit looking at this expression. This expression can be represented as this. X times Y is an AND gate, and this AND gate has a disjunction or an OR with Z prime, but Z prime is this. So here we have that from the expression to we derive this circuit, but from the first expression we derive this other digital circuit. Now these two circuits are also equivalent. In other words, no matter which combination we set both circuits at the inputs, they will give us exactly the same output. Therefore these two circuits are also equivalent. And this is a great example to show the wide variety of possibilities that you have to implement a circuit from a given Boolean expression. If you resort only to the truth table, using the sum of products is one possibility to come up with a circuit. However, certain functions, if you manipulate the results accordingly and you apply simplification rules, some of the functions can be represented in Boolean expressions that are much more compact. And these Boolean expressions that are much more compact, very likely, like it is in this case, will produce a much more compact circuit. Now if we take into account that these digital gates occupy a space in a chip, and these digital gates sometimes are slower than others, especially those that have more than two inputs, then what we have is this circuit over here is preferred over this one because it occupies less space and probably is also faster. And this is at the bottom of the optimizations that digital designers have to deal with when they are facing a problem. And these are not as simple as this one with a three-input function, but four functions that have maybe 10, 15, or 10s or hundreds of inputs, and they have to produce the most compact Boolean representation such that the circuit occupies the least amount of space and works as fast as possible.