Prev Problem
Next Problem

4. NOT Gate

module top_module(input a, output y);
  assign y = ~a;
endmodule

💡 Remember

  • The ~ operator is the bitwise NOT (inversion).
  • Output y is always the logical opposite of input a.
  • Synthesizes to a single inverter gate in hardware.