Saturday, June 22, 2013

Commenting in verilog

Like other programming languages verilog supports both single-line comment and block comment.

Single line comment starts with // and ends at the end of line.
    ...........
    #4 ;
    $display("%d",out) ; //prints value 
    //$finish ;
    end
    ............
In the above code the parts in green color italics are commented. As you can see its possible to comment single line here

    ............
    initial begin 
    /*clock = 0 ;
    reset = 1 ;*/
    in1=1 ; in2=2 ;
    ............
Now, this is block comment which enables to comment a block of data.

No comments:

Post a Comment