**Q1. (A) Implement the following Boolean function using only NAND logic gates: $f(a,b,c)=a\cdot b'+b\cdot c$**
The correct equation is *$f(a,b,c)=\textrm{NAND}(\textrm{NAND}(a,\textrm{NAND}(b,b)), \textrm{NAND}(b,c))$.* The circuit diagram is: ![[Midterm Question 1 Answer Circuit Diagram.png]]
> [!note] From ChatGPT
> The NAND gate equivalents for NOT, AND, and OR are:
> $\overline x=\textrm{NAND}(x,x)=(x\cdot x)'$.
> $x\cdot y=\textrm{NAND}(\textrm{NAND}(x,y),\textrm{NAND}(x,y))=((x\cdot y)'\cdot(x\cdot y)')'$.
> $x+y=\textrm{NAND}(\overline x,\overline y)=((x\cdot x)'\cdot(y\cdot y)')'$.
>
> Starting from the most basic term, which in this case is $b'$, you convert them to NAND gates using these equivalencies.
^6f0ce0
**Q(2). Write the optimized Boolean function for $f(x_1,x_2,x_3,x_4)=\sum m(0,2,4,5,7,8,9,15)$**
...
**Q(3). (A) Optimize the following Boolean function: $f(a,b,c)=b\cdot c+a'\cdot b\cdot c'+a'\cdot b'\cdot c'+b\cdot c'$**
...
**(B) Generate and optimize Sum-of-Product (SOP) from the following truth table:**
| $A$ | $B$ | $C$ | $F$ |
| --- | --- | --- | --- |
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
...