LightControl with inputs switch1 and switch2 and output lightassign statement to continuously set light to 1 only when both switch1 and switch2 are 1light for given inputs in a testbenchLightControl with inputs switch1 and switch2 and output lightassign statement to continuously set light to 1 only when both switch1 and switch2 are 1light for given inputs in a testbenchLightControl with inputs switch1 and switch2 and output light. Declare all ports as type wire.Start by declaring the module and its ports exactly as specified.
LightControl module, add an assign statement that sets light to the logical AND of switch1 and switch2.Use the assign keyword followed by the output and the expression.
TestLightControl that declares reg variables switch1 and switch2, and a wire light. Instantiate LightControl inside it.Declare reg for inputs and wire for output. Instantiate the module with named port connections.
TestLightControl module, add an initial block that sets switch1 and switch2 to 0 and 1 in all combinations with 10 time unit delays. Use $display to print the values of switch1, switch2, and light after each change.Use an initial block with delays and $display to show the output for each input combination.
What is the main purpose of the assign statement in Verilog?
assignassign statement is used to drive wires continuously with logic expressions.assign drives wires continuously = B [OK]Which of the following is the correct syntax for a continuous assignment in Verilog?
?
assign out = expression;= correctly. Options B, C, and D use invalid operators for assignment.Given the code below, what is the value of out when a=1 and b=0?
wire a, b, out; assign out = a | b;
out is assigned the OR of a and b.a=1 and b=0, 1 | 0 = 1.Identify the error in the following Verilog code snippet:
wire a, b, out; assign out = a & b
a & b, causing syntax error.How would you use the assign statement to create a 2-input XOR gate output out from inputs a and b?
^ and produces 1 when inputs differ.assign out = a ^ b; to continuously assign XOR result.Pass the test and this pattern moves unknown