Complete the code to declare a module named 'adder'.
module [1] (input a, input b, output sum);The module name must be 'adder' to define the adder block.
Complete the code to instantiate the 'adder' module inside 'top_module'.
adder [1] (.a(a), .b(b), .sum(sum));
The instance name 'u_adder' is a common convention for module instances.
Fix the error in the module declaration by completing the blank.
module top_module([1] a, input b, output sum);The port list must start with the keyword 'input' before the signals.
Fill both blanks to complete the hierarchical instantiation and connection.
module top_module(input a, input b, output sum); wire [1]; adder [2] (.a(a), .b(b), .sum([1])); assign sum = [1]; endmodule
The wire 'sum_wire' connects the adder output, and 'u_adder' is the instance name.
Fill all three blanks to create a hierarchical design with two adders connected.
module top_module(input a, input b, input c, output sum); wire [1], [2]; adder [3] (.a(a), .b(b), .sum([1])); adder u_adder2 (.a([1]), .b(c), .sum([2])); assign sum = [2]; endmodule
'sum1' and 'sum2' are wires connecting the two adders, and 'u_adder1' is the first adder instance.
