There was a project on opencores for IEEE745 "floating point" in behavioral verilog.
you can understand it and implement it in SW
If you need to do it from the beginning you need to study the IEEE745 standard for floating point representation.
a very simple approach is to shift the offset and modify the mentessa with this shift until the two numbers have the same mentessa and do divide between the two offsets and then renormalize the result for correct representaation
you should also take care of special cases and special numbers representations.