wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SystemVerilog Quiz

Total questions: 8

Worksheet time: 17mins

Name
Class
Date
1.

Which of the following is a correct way to declare an enum in SystemVerilog?

a)

enum {IDLE, RUN, STOP} mode;

b)

enum int {IDLE, RUN, STOP};

c)

typedef enum {IDLE, RUN, STOP} mode_t; mode_t mode;

d)

enum = {IDLE, RUN, STOP} mode;

2.

What will be the default integer value assigned to the first member of an enum if not explicitly defined?

a)

-1

b)

0

c)

1

d)

Undefined

3.

Consider the following enum: typedef enum int {RED = 2, GREEN, BLUE} color_t; What is the value of BLUE?

a)

2

b)

3

c)

4

d)

It will cause an error

4.

Coefficient of autonomous LFSR is c[4:1] = 1001. What is the output after 3rd clock cycle if initial data is 0001?

4 lines
5.

For the following code segment, What is the final value of variable "c" integer a, b, c; initial begin a = 55; b = 10; c = 5; a = b * c; b = a - 25; c = a + b; end

4 lines
6.

For the following code segment indicate, Raising edges of the clock will appear at times ____,_____, ____,______.

4 lines
7.

If the 8-bit variable "data" declared as "reg [7:0] data" is initialized to 8'b10011001, what will be its value after execution of the following code segment? always @(posedge clock) begin data =data >>>1; data[0] = data[7]; end

4 lines
8.

In the given code, statement 2 will executed at

initial begin

#5 x = 1'b0; // statement 1

#15 y = 1'b1; // statement 2

end

4 lines