Connecting ports by ordered list or by name
- For user-created lower-level components, the port connection is defined by the module declaration¡¯s port list order.
module half_adder (co, sum, a, b);
- Therefore for the first half_adder :
- The ports are connected by ordered list
- The order of the port connection does matter
- co -> c1, sum -> s1, a -> a, b -> b
- For the second half_adder:
- The ports are connected by name
- The order of the port connection does not matter
- a -> s1, b -> cin, sum -> fsum, co ->c2
module full_adder(fco, fsum, cin, a, b);
half_adder u1(c1, s1, a, b);
half_adder u2(.a(s1), .b(cin),