def hexToBin(hexStr, numOfBits):
    """Converts hex string to binary

    :param hexStr: Hex value in string format
    :type hexStr: str
    :param numOfBits: Number of bits to convert
    :type numOfBits: int

    :return: bits representing the hex values
    """
    return bin(int(hexStr, 16))[2:].zfill(numOfBits)
