Convert fraction to binary in SV

In reply to nimitz_class:

It would help to show the declarations of all variables and include a set of example values you are expecting.