wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SystemVerilog Multiple Choice Questions

Total questions: 120

Worksheet time: 3600secs

Name
Class
Date
1.

Which statement best describes 2-state versus 4-state data types in SystemVerilog?

a)

4-state types model real values

b)

4-state types are only for strings

c)

2-state types model 0/1 only

d)

2-state types include X and Z

2.

In a UVM-style verification environment, which component primarily converts sequence items into pin-level activity on the DUT?

a)

Driver

b)

Monitor

c)

Scoreboard

d)

Sequencer

3.

Which SystemVerilog array type grows automatically when new elements are assigned with arbitrary non-consecutive indices?

a)

Static array

b)

Associative array

c)

Queue

d)

Dynamic array

4.

Which method returns the number of characters in a SystemVerilog string?

a)

count()

b)

size()

c)

len()

d)

length()

5.

What is the main difference between blocking (=) and non-blocking (<=) assignments in procedural logic?

a)

Non-blocking reads before write

b)

Blocking updates at time 0

c)

Non-blocking blocks next statement

d)

Blocking executes sequentially

6.

Which components typically observe DUT signals and convert them into transactions for checking?

a)

Sequencers

b)

Drivers

c)

Scoreboards

d)

Monitors

7.

Which of the following are integral data types in SystemVerilog? Select all that apply.

a)

real

b)

int

c)

byte

d)

bit

8.

Which array kind supports push_front(), push_back(), pop_front(), and pop_back()?

a)

Dynamic array

b)

Queue

c)

Static array

d)

Associative array

9.

Which string method converts a decimal text like "42" into an integer value?

a)

putc()

b)

atoi()

c)

atoreal()

d)

getc()

10.

What SystemVerilog feature declares a set of named values with type safety and predictable encoding?

a)

enum

b)

union

c)

typedef

d)

struct

11.

In an associative array, which method checks whether a given key is present?

a)

exists()

b)

contains()

c)

has()

d)

find()

12.

Which verification component compares DUT actual results against predicted results?

a)

Driver

b)

Scoreboard

c)

Monitor

d)

Environment

13.

Which statement about packed versus unpacked arrays is accurate?

a)

Packed affects bit-level layout

b)

Packed used only for queues

c)

Unpacked always dynamic sized

d)

Unpacked stored contiguously bits

14.

Which methods can iterate keys in an associative array? Select all that apply.

a)

sort()

b)

push_back()

c)

next()

d)

first()

15.

Which timing control waits for a named event to be triggered?

a)

repeat(4)

b)

posedge clk

c)

#5 delay

d)

@event_name

16.

Which component is responsible for generating stimulus sequences in a constrained-random environment?

a)

Sequencer

b)

Scoreboard

c)

DUT

d)

Monitor

17.

Which built-in method sorts elements of a dynamic array in ascending order by default?

a)

reverse()

b)

sort()

c)

unique()

d)

sum()

18.

Which SystemVerilog type represents double-precision floating-point numbers?

a)

real

b)

int

c)

bit

d)

shortint

19.

Which string method retrieves a character at a given index?

a)

substr()

b)

char()

c)

getc()

d)

putc()

20.

For non-blocking assignments inside an always_ff block, which behavior is correct regarding RHS and LHS timing?

a)

RHS sampled before LHS update

b)

LHS updates before RHS sample

c)

RHS ignored until next cycle

d)

RHS and LHS update immediately

21.
SystemVerilog is standardized by which IEEE standard?
a)
IEEE 1076
b)
IEEE 1364
c)
IEEE 754
d)
IEEE 1800
22.
Which best describes SystemVerilog?
a)
A pure analog simulation language
b)
A PCB schematic editor
c)
A hardware description and verification language extending Verilog
d)
A software-only scripting language
23.
Why was SystemVerilog preferred over Verilog for complex testbenches?
a)
SV removes all timing constructs
b)
SV relies exclusively on gate-level descriptions
c)
SV is only for synthesis
d)
Complex testbenches are more like programming tasks; SV adds OOP, randomization, and assertions
24.
In verification, a testbench primarily does what?
a)
Synthesizes the DUT
b)
Generates layout of the DUT
c)
Applies stimulus to the DUT and checks results
d)
Performs RTL linting only
25.
Which SV component groups DUT I/O signals to simplify connections?
a)
Scoreboard
b)
Generator
c)
Monitor
d)
Interface
26.
Which component drives values onto DUT via tasks in the interface?
a)
Monitor
b)
Environment
c)
Scoreboard
d)
Driver
27.
Which component creates transactions to be driven to the DUT?
a)
Monitor
b)
Driver
c)
Generator
d)
Coverage
28.
Which component observes DUT outputs and sends them to the scoreboard?
a)
Driver
b)
Sequencer
c)
Monitor
d)
Interface
29.
Which component compares DUT output with reference model?
a)
Scoreboard
b)
Generator
c)
Driver
d)
Interface
30.
Which element configures and controls the verification environment?
a)
Driver
b)
Interface
c)
Test
d)
Monitor
31.
Which element provides flexibility and scalability to plug components?
a)
Monitor
b)
Scoreboard
c)
Sequencer
d)
Environment
32.
Which statement about nets in SV is true?
a)
Nets are only used inside classes
b)
Nets are always 4-state variables
c)
Nets store the last procedural assignment
d)
Nets do not store a value; value is determined by drivers
33.
Which statement about variables in SV is true?
a)
Variables cannot be synthesized
b)
Variables cannot be assigned in procedures
c)
Variables store a value from one assignment to the next
d)
Variables are resolved by multiple drivers
34.
Which is a 2-state type in SystemVerilog?
a)
reg
b)
wire
c)
logic
d)
bit
35.
Which are typical 2-state integer types?
a)
byte, shortint, int, longint (signed)
b)
integer and time
c)
real and shortreal
d)
logic and reg
36.
Which values can 4-state types represent?
a)
0 to 9 digits
b)
0, 1, X (unknown), Z (high-impedance)
c)
Only X and Z
d)
Only 0 and 1
37.
Which type is commonly used as a 4-state vector in SV?
a)
byte
b)
time
c)
shortreal
d)
logic
38.
What is the size of shortint?
a)
8-bit signed
b)
64-bit unsigned
c)
16-bit signed
d)
32-bit signed
39.
What is the size of int?
a)
8-bit signed
b)
64-bit signed
c)
16-bit signed
d)
32-bit signed
40.
What is the size of longint?
a)
64-bit signed
b)
32-bit unsigned
c)
16-bit signed
d)
8-bit signed
41.
What is the typical size of byte in SV?
a)
8-bit signed integer or ASCII character
b)
32-bit unsigned
c)
64-bit signed
d)
16-bit signed
42.
Which 4-state integral type is 32-bit signed?
a)
integer
b)
bit
c)
longint
d)
int
43.
Which 4-state integral type is 64-bit unsigned time value?
a)
longint
b)
byte
c)
shortint
d)
time
44.
Which maps to C 'double' and is 64-bit?
a)
realtime
b)
integer
c)
real
d)
shortreal
45.
Which maps to C 'float' and is 32-bit?
a)
byte
b)
shortreal
c)
real
d)
time
46.
Which type is used for simulation time and intervals?
a)
shortreal
b)
logic
c)
realtime
d)
bit
47.
What does 'void' indicate in SV functions?
a)
Function returns a time value
b)
Function returns a pointer
c)
Function returns X/Z
d)
Function does not return a value
48.
Strings in SV are:
a)
Fixed-length and non-indexable
b)
Only compile-time constants
c)
Dynamic and indexable; each character is a byte
d)
Always 4-state bits
49.
str.len() returns:
a)
String capacity
b)
ASCII code of first character
c)
Number of characters in the string
d)
Index of last non-zero char
50.
str.getc(i) returns:
a)
ASCII code of the i-th character
b)
Substring from i
c)
Character count up to i
d)
Lowercased character
51.
str.putc(i, c) does:
a)
Deletes i-th character
b)
Replaces the i-th character with c
c)
Converts to uppercase
d)
Inserts a character at end
52.
Which comparison is case-insensitive?
a)
str.icompare(s)
b)
str.substr(i,j)
c)
str.len()
d)
str.compare(s)
53.
Which method converts string to integer?
a)
str.atoi()
b)
str.atoreal()
c)
str.bintoa(i)
d)
str.hextoa(i)
54.
Which method interprets string as hexadecimal?
a)
str.atobin()
b)
str.itoa(i)
c)
str.atohex()
d)
str.hextoa(i)
55.
Which method stores ASCII decimal of i into str?
a)
str.atoi()
b)
str.bintoa(i)
c)
str.itoa(i)
d)
str.atoreal()
56.
Which operator concatenates strings?
a)
Str1 + Str2 (SV operator)
b)
Str1 & Str2
c)
Str1 || Str2
d)
{Str1, Str2}
57.
An event in SV is used for:
a)
Declaring arrays dynamically
b)
Synchronization between concurrent processes
c)
Formatting output strings
d)
Randomizing variables
58.
Blocking assignment operator is:
a)
=
b)
:=
c)
<=
59.
Non-blocking assignment operator is:
a)
=
b)
<=
c)
->
60.
Non-blocking assignments schedule updates to LHS:
a)
Only on posedge clock
b)
Immediately
c)
At start of simulation
d)
At end of the time-step
61.
Default enum values when unspecified are:
a)
Randomized at runtime
b)
1,2,3 starting at one
c)
0,1,2,... in declaration order
d)
Based on ASCII codes
62.
Which enum method returns number of elements?
a)
last()
b)
name()
c)
num()
d)
first()
63.
Which enum method returns string for current value?
a)
prev()
b)
num()
c)
next()
d)
name()
64.
Which enum method advances to next member?
a)
last()
b)
next()
c)
first()
d)
prev()
65.
An array in SV is a collection of:
a)
Mixed-type objects with names
b)
Variables of same type accessed via indices
c)
Modules
d)
Random values only
66.
Static arrays in SV:
a)
Require explicit new[] to allocate
b)
Have fixed size determined at compile time
c)
Are always packed
d)
Can only grow at runtime
67.
Packed dimensions are declared:
a)
With $ size
b)
After the identifier
c)
Inside a class only
d)
Before the identifier
68.
Unpacked dimensions are declared:
a)
Before the identifier
b)
Between type keywords
c)
After the identifier
d)
Using { } braces
69.
A one-dimensional packed array is also called:
a)
A dynamic array
b)
A vector
c)
A queue
d)
An associative array
70.
Which built-in returns number of elements in a packed vector?
a)
vector.len()
b)
size()
c)
num()
d)
$size(vector)
71.
Dynamic arrays are declared using:
a)
Associative index types
b)
Braces {} only
c)
$ size specifier
d)
Empty brackets [] and allocated with new[]
72.
Which dynamic array method returns current size?
a)
.len()
b)
.count()
c)
.num()
d)
.size()
73.
Which dynamic array method empties the array?
a)
.delete()
b)
.reset()
c)
.remove_all()
d)
.clear()
74.
Associative arrays allocate storage:
a)
Only when elements are used
b)
Only at compile time
c)
Never freed
d)
At declaration time
75.
Valid associative array declaration with string index:
a)
logic a_array[#]
b)
bit [31:0] a_array[string];
c)
byte a_array[$];
d)
int a_array[*];
76.
Which method checks if an index exists?
a)
exists(index)
b)
delete(index)
c)
num()
d)
first(var)
77.
Which method assigns first index to a variable?
a)
first(var)
b)
last(var)
c)
next(var)
d)
prev(var)
78.
Queues are declared with size:
a)
% for size
b)
[] empty for dynamic arrays
c)
* for associative arrays
d)
$ to denote variable size
79.
In queues, index 0 refers to:
a)
Second element
b)
Invalid element
c)
Last element
d)
First element
80.
In queues, index $ refers to:
a)
Queue size
b)
Last element
c)
Middle element
d)
First element
81.
Which method inserts at front?
a)
push_back(value)
b)
insert(index,value)
c)
pop_front()
d)
push_front(value)
82.
Which method removes and returns last element?
a)
push_back(value)
b)
delete(index)
c)
pop_back()
d)
pop_front()
83.
Which method returns number of items in a queue?
a)
len()
b)
num()
c)
size()
d)
count()
84.
A bounded queue example is:
a)
byte q[$:7];
b)
byte q[$];
c)
bit q[7:0]
d)
int q[*];
85.
Which locator method returns all elements matching expression?
a)
unique()
b)
find()
c)
find_first()
d)
find_index()
86.
Which locator method returns indices of matching elements?
a)
find_last()
b)
find()
c)
find_index()
d)
max()
87.
Which locator method returns first matching element?
a)
find_last()
b)
find_first_index()
c)
find_first()
d)
min()
88.
Which locator method returns last matching element?
a)
sum()
b)
find()
c)
find_last_index()
d)
find_last()
89.
Which locator method returns index of first match?
a)
find_first_index()
b)
rsort()
c)
find_index()
d)
find_last_index()
90.
Which locator method returns index of last match?
a)
find_last()
b)
find_last_index()
c)
find_first()
d)
reverse()
91.
Which method returns element with maximum value?
a)
unique()
b)
min()
c)
sort()
d)
max()
92.
Which method returns element with minimum value?
a)
max()
b)
rsort()
c)
min()
d)
unique_index()
93.
Which method returns elements with unique values?
a)
shuffle()
b)
sum()
c)
unique()
d)
unique_index()
94.
Which method returns indices of unique values?
a)
min()
b)
unique_index()
c)
reverse()
d)
find_index()
95.
Which method reverses order of elements?
a)
find()
b)
reverse()
c)
rsort()
d)
shuffle()
96.
Which method sorts in ascending order?
a)
reverse()
b)
shuffle()
c)
rsort()
d)
sort()
97.
Which method sorts in descending order?
a)
sort()
b)
max()
c)
reverse()
d)
rsort()
98.
Which method randomizes order of elements (no with-clause allowed)?
a)
sort()
b)
rsort()
c)
reverse()
d)
shuffle()
99.
Which reduction method returns sum of all elements?
a)
sum()
b)
and()
c)
product()
d)
xor()
100.
Which reduction method returns product of all elements?
a)
or()
b)
product()
c)
unique()
d)
sum()
101.
Which reduction method performs bitwise AND of all elements?
a)
xor()
b)
and()
c)
min()
d)
or()
102.
Which reduction method performs bitwise OR of all elements?
a)
or()
b)
xor()
c)
and()
d)
max()
103.
Which reduction method performs XOR of all elements?
a)
xor()
b)
reverse()
c)
and()
d)
sum()
104.
Which is a packed array declaration?
a)
int my_data[];
b)
bit my_data[$]
c)
logic [9:0] my_data;
d)
byte my_data[9:0];
105.
Which is an unpacked array declaration?
a)
int array1[$]
b)
bit [7:0][2:0] array1;
c)
bit [7:0] array1[2:0];
d)
logic [7:0]
106.
Which shows a two-dimensional packed array?
a)
byte my_data[3:0][7:0];
b)
bit my_data[$]
c)
bit [3:0][7:0] my_data;
d)
int my_data[];
107.
Which built-in iterates over all indices of an array?
a)
for(i in array)
b)
foreach (array[i])
c)
iterate(array)
d)
loop(array)
108.
Which statement assigns a 32'h value to a packed vector?
a)
my_data.push_back(32'hFACE_CAFE);
b)
my_data.delete();
c)
my_data.new[32];
d)
my_data = 32'hFACE_CAFE;
109.
Which converts string to real?
a)
str.bintoa(i)
b)
str.hextoa(i)
c)
str.atoreal()
d)
str.atoi()
110.
Which stores ASCII hex of i into str?
a)
str.octtoa(i)
b)
str.hextoa(i)
c)
str.bintoa(i)
d)
str.atohex()
111.
Which method replicates a string N times?
a)
Str<<N
b)
{N{Str}}
c)
Str*N
d)
Str.repeat(N)
112.
Setting duplicate enum values like red=0, green=0 leads to:
a)
Automatic renumbering
b)
Valid shadowing
c)
Runtime warning only
d)
Syntax error
113.
In enum datatype, if the index of the color blue is 4 and the yellow is declared after blue with no explicit value, then yellow becomes:
a)
0
b)
4
c)
5
d)
6
114.
Which expression concatenates an extra element at end of a queue?
a)
q = {q, new_item};
b)
q = q[1:$-1];
c)
q.pop_back();
d)
q.push_front(new_item);
115.
Which slice removes first and last elements from queue q?
a)
q = q[1:$-1];
b)
q = q[$:0];
c)
q.delete(0,$);
d)
q = q[0:$];
116.
delete(index) on associative array does:
a)
Converts to dynamic array
b)
Deletes entry at index (or all if no index)
c)
Clears only first element
d)
Sorts the keys
117.
Array locator methods like find() require:
a)
A class method only
b)
Clocking block
c)
No condition allowed
d)
with clause with item/x to specify condition
118.
In non-blocking, RHS is captured and LHS updated:
a)
Before any blocking statements
b)
Only at end of simulation
c)
Immediately per statement
d)
After evaluating all non-blocking in the time-step
119.
Which built-in displays time?
a)
$display
b)
$size
c)
$time
d)
$random
120.
Which statement triggers an event?
a)
<-@my_event
b)
<= my_event
c)
@(my_event)
d)
-> my_event