wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Verilog TCL Quiz

Total questions: 21

Worksheet time: 11mins

Name
Class
Date
1.

What is the default value for reg data type

a)

0

b)

1

c)

x

d)

d

2.

In continuous assignment left hand side must be

a)

Net

b)

Reg

c)

Scalar or Vector Net 

d)

Scalar or Vector Net 

3.

If x=4 b1100 then x<<2 is

a)

4 b1000

b)

4 b0000

c)

4 b0011

d)

4 b0110

4.

#40 $finish indicates

a)

end of simulation time

b)

end of simulation after 40 time units 

c)

suspend simulation at 40 time units

d)

delay for 40 time units and then execute next line after $finish

5.

What do you mean by logic synthesis?

a)

RTL description is converted in terms of logic gates by the use of synthesis tool

b)

RTL description is simulated and the simulation waveforms are shown by synthesis tools

c)

RTL description is remodelled from behavioural to data flow modelling by synthesis tools

d)

RTL description is checked for any errors by synthesis tools

6.

what is the correct set of Verilog code to swap contents of two register with and without temporary registers.

a)

b)

c)

d)

7.

What is wrong with following piece of code

a)
  1. Nothing wrong

b)
  1. incorrect a and b can overflow as it is incremented in an infinite loop

c)
  1. Simulation may not advance since forever doesn't have any timing control

d)

A forever block cannot be used inside an initial block

8.

What is order of execution for below code?

a)

Zero delay control statement is executed first

b)

Zero delay is executed only after all other statements

are executed in that simulation time and order of zero

c)

delay statement is non deterministic

d)

Zero delay control statement is executed last

9.

Which is true about task and function

a)

Task and function contain always and initial blocks

b)

Task and function do not contain always and initial blocks

c)

Task and function do not contain behavioral statement

d)

Task and function can not have global variables called

10.

For the below code segment given below

a)

Values of a and b are swapped

b)

Values of a and b cannot be swapped 

c)

Values of a and b can be swapped depending on simulato

d)

Can t determine

11.

Give a Verilog statement that instantiates the below RTL_circuit, with the instance name RT1, so that x has a delay of 7 time units and y has a delay of 5 time units

a)

RTL_circuit #(7,5) RT1(y,x,a,b,c,d);

b)

RTL_circuit #(5,7) RT1(x,y,a,b,c,d);

c)

#(5,7) RTL_circuit RT1(y,x,a,b,c,d);

d)

RTL_circuit #(7,5) RT1(x,y,a,b,c,d);

12.

what is the output of the below code snippet

a)

0

b)

1

c)

Error

d)

X

13.

What is the value of signal "out" at the end of simulation

a)

1

b)

0

c)

X

d)

undeterministic

14.

Which of the following statements is true

a)

Both task and function can return value

b)
  1. Blocking  assignments are allowed in both task and functions

c)
  1. Delay, clock, always and initial blocks, @ can be used inside both tasks and function definitions

d)
  1. Both task and functions can be called inside definition of a function

15.
  1. What are the values of signals a and b at the end of 2 clock cycles

a)

a=1, b=0

b)

a=0, b=1

c)

a=0, b=0

d)

a=1, b=1

16.

Consider the following code followed by testbench, fill the missing dashes in testbench with appropriate option

a)

wire a,b,cin;

reg sum, cout;

b)
  1. Either  A or  B  can be used

c)

reg a,b,cin;

wire sum, cout;

d)

None of these

17.

What is the output printed with the below code snippet

a)

3

b)

2

c)

32

d)

[expr $a%$b]

18.

Which of the following code snippet is correct when you want to read the file “data.txt” line by line and save each line as a list element.

a)

set fh [open data.txt w]

set text [read $fh]

set data [split $text "\n"]

b)

set fh [open data.txt w+]

set text [read $fh]

set data [split $text "\n"]

c)

set fh [open data.txt w+]

set text [read $fh]

set data [append $text "\n"]

d)

set fh [open data.txt r]

set text [read $fh]

set data [append $text "\n"]

19.

What is printed on terminal from the below snippet of TCL code

a)
  1. the data is found

b)

Data not found

c)
  1. Syntax Error

d)
  1. No syntax error but does not print anything

20.

Which of the following is the correct way to use the “if” statement in Tcl to test whether a variable called “my_var” is equal to 10?

a)

if my_var = 10 { … }

b)

if {my_var = 10} { … }

c)

if (my_var == 10) { … }

d)

if [my_var == 10] { … }

21.

Which of the following is the correct way in Tcl to calculate the sum of two variables called “my_var1” and “my_var2” ans store output in variable called "sum"?

a)

set sum [expr my_var1 + my_var2]

b)

set sum = my_var1 + my_var2

c)

set sum expr my_var1 + my_var2

d)

set sum expr {my_var1 + my_var2}