**Half Subtractor RTL Design & Verification:** Explain the truth table, B…
**Half Subtractor RTL Design & Verification:** Explain the truth table, Boolean expressions, and operation of a 1-bit **Half Subtractor**. Write synthesizable behavioral Verilog RTL code and its testbench.
Model answer
### 1. Working Principle & Truth Table A **Half Subtractor** subtracts single bit $B$ (subtrahend) from single bit $A$ (minuend), yielding $Difference$ and $Borrow$: {cc|cc} A & B & Difference (D) & Borrow (B_{out}) \\ \hline 0 & 0 & 0 & 0 \\ 0 & 1 & 1 & 1 \\ 1 & 0 & 1 & 0 \\ 1 & 1 & 0 & 0 ### 2. Boolean Expressions - $Difference = A \oplus B$ - $Borrow = \overline{A} \cdot B$ ### 3. Logic Schematic (CircuiTikZ) ### 4. Verilog RTL Implementation ### 5. Verilog Testbench