OR Gate And XOR Gate In Computers

 All things in all posts will help you visualize about the way that computers work generally. Note that it is not the real structure of modern computers, but the way that modern computers work is nearly the same as in my posts. I am sure that if you understand about the way that computers work in my posts, you will easy to learn about all fields of computer afterward. Thank you !!!

We learned about NAND, AND and NOT gates in previous posts. These are important gates in computers. But, all of them are built from NAND gates, so NAND gate is the most basic gate. Now, we will learn to build other gates that are building blocks for many important structures in a computer's CPU (central processing unit).

Firstly, we will learn the way to build an OR gate. This gate will be formed by a combination of NOT gate and NAND gate. You learned about NOT gate and NAND gate in previous posts, so let’s look at the diagram below to understand about this OR gate:

In the diagram, you can see that the OR gate is built from two NOT gates (eventually is built from NAND gates) and one NAND gate. From the diagram above, we can have a truth table that represent all possibilities of inputs (“a” and “b”) as:

Because of having two inputs, we can have four possibilities for them. Likewise, with three inputs, you know that we will have eight possibilities. This thing I mentioned in a previous post. Now, we will find out the rule of OR gate. As you can see, if one or both inputs are “on” (represented by “1”), the output will be “on”. If both inputs are “off” (represented by “0”), the output will be “off”.

From the truth table, you can see that the OR gate will be “on” when it has at least one input at state of “on”. This is true for more inputs (three, four,...), you can try it. But, the diagram and truth table above is so complicated, so we will abstract it into a simpler diagram for OR gate. Look at the diagram below:

The diagram above is a simple version of OR gate. As with other structures, we always build structures completely, then abstract them to simple building blocks and build larger structures easily without unnecessary details. We did similar things to RAM in previous posts from NAND gates. Now, we do similar things with OR gate and OR gate will be applied to build the CPU of computers.

To build the CPU of computers, not only OR gates are needed, we also need another type of gate that is XOR gate (Exclusive OR gate). In the truth table of the OR gate, you can see that at least one input is “on” (both inputs or one inputs), the output is “on”. But in the XOR gate, the output is “on” when and only when one in two inputs is “on”. If both inputs are “on” or “off”, the output will be “off”. Let’s look at the diagram below to see the structure and truth table of a XOR gate:

As with OR gate, we built the structure of XOR gate but it is complicated. So, we will abstract it to a simpler diagram and use it as building blocks for constructing larger structures. Look at the simpler diagram and truth table of XOR gate below:

Now, we learned four gates that are built from NAND gates. We do not use NAND gates only because we will create very complicated structures by using very very many NAND gates. So, we build other gates from NAND gates, then symbolize them and use them in building structures. The structures will become simpler and do not lose the correctness of logic circuits.

Let’s review all four gates that we are learned in all my posts:

Thanks for reading and see you later!!!

Đăng nhận xét

0 Nhận xét