I want to convert fractional part - kfrac in the below task to binary. I tried to use the $realtobits system task, but this will compromise on the precision as I will need only 5 bits starting from LSB out of 64 bits. So, what's the best way to convert it to binary in SV?
target_res = $urandom_range(200,45);
k = (rterm_target - inductor_res) * 8/(target_res - inductor_res);
kint = $rtoi(k);
kfrac = k - kint;
$display("Kint :: %d, Kfrac :: %f, K :: %f", kint, kfrac, k);