How do you plan to solve it?
module nand4_prim ( input a, input b, input c, input d, output y ); assign y = ~(a & b & c & d); endmodule