Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Identify the error in the below system verilog code and rectify it class transaction; bit [ 3 1 : 0 ] data; int id; endclass

Identify the error in the below system verilog code and rectify it
class transaction;
bit [31:0] data;
int id;
endclass
function void transaction::display();
$display("data =%0d and id =%0d", data, id);
endfunction
task transaction::delay();
#50;
$display("Time =%0.0t, delayed data =%0d", $time, data);
endtask
module class_example;
transaction tr;
initial begin
tr.data =100;
tr.id =1;
tr.display();
tr.delay();
end
endmodule

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions