63. Functions and Tasks Basics

Question.7

What is the value of y after execution ?

reg [3:0] y = 0;

task double; 
    begin
        y = y * 2;
    end
endtask

task add_and_double(input [3:0] val);
    begin
        y = y + val;
        double();
    end
endtask

initial add_and_double(4'd3);

 

Need Help? Refer to the Quick Guide below

Select Answer