Logo

System-verilog Questions Set 5:

Quiz Mode

Which of the following can be used as an Identifier in Verilog?

1
2
3
4

Solution:

Which of the following hardware description languages is more flexible?

1
2
3
4

Solution:

The Verilog code given below is for a:

1
2
3
4

Solution:

Given below is a structural description of a full adder.

1
2
3
4

Solution:

The force statement will override all other assignments made to the variable until it is released using the __________ keyword.

1
2
3
4

Solution:

Write a single-line Verilog statement to make the output out 1 if each bit of an 8-bit register in is 0.

1
2
3
4

Solution:

Declare a memory of size 1K, where each element is of 2 bytes.

1
2
3
4

Solution:

Match the given Verilog code to the correct description:

1
2
3
4

Solution:

For the given Verilog code for a 3-bit adder, complete the simulation log:

 

module adder(a,b,sum);
input [2:0] a,b;
output [3:0] sum;

assign sum = a + b;
$display("a = %b, b = %b, sum=%b", a,b,sum);
endmodule

Simulation Log:

 

a = 100, b = 111,
sum = ?

1
2
3
4

Solution:

Complete the below code such that the output is "b".

typedef enum bit [1:0] {a,b,c} alphabets;

module enum_alpha

alphabets alpha;

initial begin

alpha = alphabets'(0); // Initialize alpha to the first member of the enum

alpha = alphabets'(alpha + 1); // Increment alpha to the next member, which is 'b'

$display("%s", alpha.name); // Displays b

end

endmodule

1
2
3
4
5

Solution: