Complete the code to declare a module named 'and_gate'.
module [1] (input a, input b, output y); endmoduleThe module name must match the intended design, here 'and_gate'.
Complete the code to assign the AND of inputs 'a' and 'b' to output 'y'.
assign y = a [1] b;The AND operation in Verilog uses the '&' operator.
Fix the error in the module declaration by completing the blank.
module and_gate(input a, input b, output [1]);The output port name must match the one used in the module, here 'y'.
Fill both blanks to complete the module instantiation of 'and_gate' with signals 'in1', 'in2', and 'out'.
and_gate [1] (.a([2]), .b(in2), .y(out));
'inst1' is the instance name and 'in1' is connected to port 'a'.
Fill all three blanks to complete a module that outputs the OR of inputs 'a' and 'b' to 'y'.
module or_gate(input [1], input [2], output [3]); assign y = a | b; endmodule
The inputs are 'a' and 'b', and the output is 'y' as used in the assign statement.
