Showing posts with label verilog. Show all posts
Showing posts with label verilog. Show all posts

What is a verilog test bench?

A verilog testbench is a module that instantiates a DUT (design module under test) and apply some stimulus to it as well as can have a mechanism to monitor and check output of DUT. A testbench usually have following template:
    module test_dut;
            // Declare Singals and Variables
            // Instantiate Design
            // Set initial value of stimulus
            // Apply stimulus
            // Observe Ouputs
            // Report pass/fail
     endmodule: test_dut

What is the difference between a vector an array in verilog?

It is quite common for new entrants into the world of verilog to get confused into vector and array. In simple terms a vector is a single element which could be 1 to n bit wide. For e.g.,

reg [7:0] temp; // where temp is vector of type reg and is 8 bit wide.
Note : while defining vectors index comes before identifier

Array as per definition in a collection of elements of same type. For e.g.,

int temp_array[11:0]; // an array of 12 elements of type int
Note : while declaring array, index comes after identifier

We can also declare an array of vectors. Let it be an 8 bit wide array of 4 bit vectors elements of type reg.
reg [3:0] temp_array_of_vectors[7:0];

What is sensitivity list?

Which will be Updated first ? Variable or signal?

Describe how blocking and non blocking statements get executed?

What is meant by inferring latches,how to avoid it?

What is difference between Verilog full case and parallel case?

Difference between $monitor,$display & $strobe?

What is delta simulation time?

Difference between inter statement and intra statement delay?

Write a verilog code to swap contents of two registers with and without a temporary register?

What is code coverage and what are the different types of code coverage that one does ?

What is the difference between compiled, interpreted, event based and cycle based simulators ?

What is the difference between transport and inertial delays ?

What is the difference between transport and inertial delays ?

What is the difference between tasks and functions ?

What is the difference between unary and logical operators ?

What is defparam used for ?

Write code for asynchronous reset D-Flip-Flop.

What is the difference between wire and reg data type ?