Verilog Quiz



Verilog Quiz # 4

The first Verilog quiz covering first 20 chapters of the Tutorial.


Q1. 31. What is order of execution for below code

 module zero;
 reg a,b,c;
 //initial block with zero delay 
  initial begin  
     #0 a = 1;
     #0 b = 1;
     #0 c = 1;
     (" Zero delay control a= %b, b= %b, c=%b
",a,b,c);
  end
 
  //initial block without zero delay
  initial  c = 0;
 
  initial begin
     a = 0;
     b = 0;
     ("Non-zero delay control a= %b, b= %b, c=%b
",a,b,c);
  end
 
endmodule


A . Zero delay control statement is executed first
. Zero delay is executed only after all other statements

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

Q2. An event is triggered by symbol

A . =>
B . --->
C . @
D. None

Q3. Which construct is used to execute loop fixed number of times

A . repeat
B . while
C . forever
D. None

Q4. Analyse the code below and choose the right options
reg clock;
initial
begin
    clock = 1'b0;
    foever #10 clock = ~clock;
end


. The forever loop will execute the statement infinitely

A . without advancing simulation time
. Forever loop will execute the

B . statement infinitely and rest of the design is executed in simulation time
C . Timing control construct is optional in forever
D. None

Q5. Function has

A . Input,output and inout port as argument
B . Have one input argument only
C . Can have more than one input arguments
D. Can have both input or output as argument.

Q6. Task and function canít have

A . Registers
B . Time variables
C . Local variables
D. Wires

Q7. Which is true about task and function

A . Task and function contain always and initial blocks
. Task and function do not contain always and initial blocks

B . and called from initial and always blocks or other tasks
or function.
C . Task and function do not contain behavioral statement
D. None

Q8. Random number is generated by

A . $random
B . $rand
C . $strobe
D. None

Q9. Special parameters are defined in specify block by

A . defparam
B . specparam
C . parameter
D. none

Q10. Setup time is

A . Minimum time the data must arrive before active clock edge
B . Maximum time the data must arrive before active clock edge
C . Minimum time the data cannot change after active clock edge
D. None


Try other quizzes

Quiz 1

Quiz 2

Quiz 3

Quiz 4

Quiz 5

Quiz 6

Quiz 7

Quiz 8

Quiz 9