def METHOD_NAME(self, v, nbit_expo, nbit_frac):
    v = float(v)  # 64-bit float
    h = v.hex()
    n = len(h)
    st = n
    for ii in range(n):
        if h[ii] == "x":
            st = ii + 1
        if h[ii] == "p":
            ed = ii + 1
    is_zero = h[st] == "0"
    #
    if is_zero:
        return "0" * (1 + nbit_expo + nbit_frac)
    else:
        s = "1" if h[0] == "-" else "0"
        e = int(h[ed:]) + int(2 ** (nbit_expo - 1) + 2**nbit_expo)
        e = bin(e)[3:]  # 0b1xxxxxxx
        fh = h[st + 2 : ed - 1]
        fb = self.hex2bin_str(fh)
        f = fb[0:nbit_frac]
        return s + e + f