Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 2.89 KB

chapter05.md

File metadata and controls

54 lines (36 loc) · 2.89 KB

Chapter 5 : Logical Circuits

Do you remember two logics NAND and NOR ? These logics are called Universal Logic, because in digital electronics, we make all other logics using these two logics! The smallest part of a logical circuit, is called a gate. each gate is a specific arrangement of transistors. For example, this is a NOT gate using MOSFET transistors :

Figure 1 - NOT Gate using transistors

I picked this picture from one of my old projects, and in this book, we won't use any transistor, we just use symbolic schematics of logic gates to design logical circuits!

The NAND

Although we can make all logics using NOR, I prefer using NAND. This is just my personal opinion, and after reading and understanding the previous chapter and this chapter, you can make all of these logics using NOR. This is what I call "The magic of boolean algebra". First, we need to know how NAND works! It works like a key with two switches, and when to switches are off, the output will be on! This is the simplest definition of NAND. When we want to show it on circuit, we use this shape :

Figure 2 - NAND Gate

A D-shaped thing with a bubble at the end. This is NAND! You know how it works, because you read the chapter four and you learned what are these functions!

NOT Gate

The NOT gate is another simple and basic gate, you need to know. It's built using a NAND Gate like this:

Figure 3 - NOT using NAND Gate

Did you see how it works? Yes! We simply connect two inputs of a NAND gate to a switch. The NOT gate in general, is represented like this :

Figure 4 - NOT Gate

AND Gate

As you remember from the previous chapter, we made NAND function by adding a NOT to AND. So, we know ~(~A) = A . This means we can add a NOT gate in output of NAND, and get AND function. Just like this :

Figure 5 - AND Gate using NOT and NAND

But in reallity, if you remove the bubble from NAND gate, you will have AND :

Figure 6 - AND Gate

OR Gate

This is the last of these gates! Yes, this is the last, because we will design exclusive logics in next chapters, so the OR gate is the last gate we will know here! If we apply two NOT gates in the inputs of a NAND gate, it'll become an OR gate. like this :

Figure 7 - OR using NAND and NOT

But, this is the actuall OR :

Figure 8 - OR Gate

Now, we're ready!

Actually, when you know how to represent logic gates, and you know how their functions work, you can design and implement logical circuits. A computer is much simpler than you think, and the hard part in design and implementation of a computer, is the correct usage and combination of logics. In next chapter, we design the simplest combinational circuits, and then we start desgining bigger ones.