Prev Problem
Next Problem

6. AND Gate

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

💡 Remember

  • The & operator in Verilog performs bitwise AND.
  • Output y is 1 only when both inputs are 1.
  • Synthesizes directly to a single AND gate in hardware.