title: How to pass value to `define N
body: <p>I am using iverilog simulator and I want to pass value to N during compilation. Which command I need to use and can anyone help me with the usage of `define. </p>
  
  <pre><code>`define N
  
  module Nbcd(A, B ,S);
   input [N*4-1:0] A,B;
   output[N*4-1:0] S;
  
  genvar i;
    generate
     for(i=0; i&lt;=N-1; i=i+1)
        bcd (.A(A[4*i+3:i*4]),
             .B(B[4*i+3:i*4]).
             .S(S[4*i+3:i*4])
            );
    endgenerate
  endmodule
  </code></pre>
  
  <p>Testbench</p>
  
  <pre><code>module Nbcd();
    reg [N*4-1:0] A,B;
    wire [N*4-1:0] S;
    integer i;
  
    Nbcd U1 (.A(A),.B(B),.S(S));
  
    initial begin
      for (i=o; i&lt;=N-1; i=i+1)
        begin
          A=i;
          b=i+1;        
      end
  endmodule  
  </code></pre>