Connecting ports by ordered list
- For Verilog gate primitives, the
first port on the port list is the output, followed by the inputs.
- <gate_name>
- #delay - OPTIONAL
- 2 time unit for the and gate
- 4 time unit for the xor gate
- <instance_name> - OPTIONAL
- u1 for the and gate
- u2 for the xor gate
- (port_list)
- (co, a, b) - (output, input, input)
- (sum, a, b) - (output, input, input)
module half_adder (co, sum, a, b);
and #and_delay u1(co, a, b);
xor #xor_delay u2(sum, a, b);