How do you plan to solve it?
Take the Boolean equation, break it down in the circuit and directly implement it by instantiating.
// ============================================================
// Basic Gates (given)
// ============================================================
module and_gate(input a, b, output y);
assign y = a & b;
endmodule
module or_gate(input a, b, output y);
// write code here for or gate
assign y = a | b;
endmodule
module not_gate(input a, output y);
// write code here for not gate
assign y = ~a;
endmodule
// ============================================================
// XOR Gate
// ============================================================
module xor_gate (
input a, b,
output y
);
// TODO: declare intermediate wires
wire and_o_0, and_o_1;
wire not_o_0, not_o_1;
// TODO: instantiate required gates
not_gate DUT0 (.a(a),
.y(not_o_0)
);
not_gate DUT1 (.a(b),
.y(not_o_1)
);
and_gate DUT2 (.a(a),
.b(not_o_1),
.y(and_o_0)
);
and_gate DUT3 (.a(b),
.b(not_o_0),
.y(and_o_1)
);
or_gate DUT4 (.a(and_o_0),
.b(and_o_1),
.y(y)
);
endmodule