[Solved] : Question 135471

Develop a testbench for the following parity checker

module parity checker(
input [7:0] bitt,
output reg ans
);

integer count = 0;
integer i = 0;

always@(bitt)
begin
count = 0;
for(i=0; i<=7; i=i+1)
begin
if(bitt[i]==1)
count = count + 1;
end
if(count%2==0) //even parity
ans = 1;
else
ans = 0;

end

endmodule

Verify the testbench using the following numbers: 0, 5, 86, 111.

Type out your testbench code and verify that it works using a computer program (modelsim or EDA playground)


Expert Answer


Answer to : Question 135471

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?