What I Built
- Logic gates: NOT, AND, OR, XOR, MUX, DMUX, NOT16, AND16, OR16, MUX16, OR8WAY, MUX4WAY16, MUX8WAY16, DMUX4WAY, DMUX8WAY with HDL.
How I Solved
- Derive boolean formulas with truth tables and SOP(Sum of Products).
- Apply double negative and De Morgan's law to make it simple to use NAND.
- Use already-built logic gates to build another logic gates(Mux16, Mux8way16, etc.)
Example : XOR Gate
| A | B | OUT |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
From the truth table, the output is 1 for (A, B) = (0, 1) and (1, 0).
Hence, the Sum of Products (SOP) expression is:
A XOR B = A̅B + AB̅
= ¬¬(A̅B + AB̅)
= ¬(¬(A̅B) · ¬(AB̅))
= NAND(NAND(A̅, B), NAND(A, B̅))
What I learned
- The overall process of building other logic gates from NAND gates.
- What mux and dmux are and how to build multi-input logic gates.
Why NAND is amazing
Reflection
Since this chapter was just a repetition of a simple process - Derive a boolean formula using SOP, apply De Morgan's law to use NAND, and connect already-built logic gates - It was not as hard as I expected. (But it was pretty hard when I was building Mux4way16, Dmux4way, etc, since I was not familiar with them at all)
And it was really fascinating experience building logic gates one by one only using NAND. Once I realized that NAND(a, a) == NOT(a), it felt like a chain reaction, because ideas for other logic gates started to follow naturally. For example, AND can be built by applying NAND first and then negating its output with another NAND. Once you can build AND, you can also build OR gate since you can use De Morgan's law and double negative. How amazing!
But in next chapter, I'm going to build HalfAdder, FullAdder, Add16, Inc16 and ALU that looks way harder than chapter 1(I already read a PDF file about next chapter already). Still, I think I can handle it since next chapter will also be about connecting logic gates properly.
So far, so good!