'Read an integer number'

def readInteger(self, address, signed, nbits, endian):

    value = self.readBits(address, nbits, endian)
    if (signed and ((1 << (nbits - 1)) <= value)):
        value -= (1 << nbits)
    return value
