Prev Problem
Next Problem

5. OR Gate

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

💡 Remember

  • The | operator in Verilog performs bitwise OR.
  • Output y is 1 if either input is 1 or both are 1.
  • Synthesizes to a single OR gate in hardware.