<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nic_b(msg):
 """Obtain NICb, navigation integrity category supplement-b Args: msg (string):
 28 bytes hexadecimal message string Returns: int: NICb number (0 or 1) """

    tc = typecode(msg)

    if tc < 9 or tc > 18:
        raise RuntimeError("%s: Not a airborne position message, expecting 8<TC<19" % msg)

    msgbin = common.hex2bin(msg)
    nic_b = int(msgbin[39])

    return nic_b