The approach is to design a simple NOT gate that outputs the logical negation of the input signal. Using a continuous assignment, the output y is assigned as the complement of input a using the bitwise NOT operator (~).
Code
/*Write your code here*/
module top_module(input a, output y);
assign y = ~a;
endmodule