// half adder component used in the multiplier module half_adder(a, b, s, cout); input a, b; output s, cout; assign s = a^b; assign cout = a&b; endmodule // full adder component used in the multiplier module full_adder(a, b, cin, s, cout); input a, b, cin; output s, cout; assign s = a^b^cin; assign cout = (a&b) | (b&cin) | (a&cin); endmodule // 3-bit by 3-bit unsigned multiplier module mult3(x, y, p); input [2:0] x, y; output [5:0] p; // internal nodes within the multiplier circuit wire t1, t2, t3, t4, t5, t6, t7; // structural description of the multiplier circuit assign p[0] = x[0]&y[0]; half_adder ha1(x[1]&y[0], x[0]&y[1], p[1], t1); half_adder ha2(x[2]&y[0], x[1]&y[1], t2, t3); full_adder fa1(t2, t1, x[0]&y[2], p[2], t4); full_adder fa2(x[2]&y[1], t3, x[1]&y[2], t5, t6); half_adder ha3(t5, t4, p[3], t7); full_adder fa3(x[2]&y[2], t6, t7, p[4], p[5]); endmodule