Can anyone pls help me to write a function to calculate the parity and generate 1 for even or 0 for odd parity under class in System verilog
This is one of the basic logical operators in Verilog; there is no need to create a function. I suggest you spend some time to study the SystemVerilog LRM more carefully.
Dave
In reply to dave_59:
Sure,Thanks.