In reply to Spriyada29:
It very hard to follow what you want to do when you do not understand SystemVerilog and you are trying to code in SystemVerilog. Can you explain what operation you want to perform with using SV code? The post the latest code you have and give an example of what the input and output to the function should be.