def set(self, value: int):
        """
        Set the immediate to a value. This function checks if the value is valid and will raise an
        :class:`InvalidImmediateException` if it doesn't.

        :param value: Value to set the immediate to
        :type value: int

        :raises InvalidImmediateException: value does not match immediate
        """
        if not isinstance(value, int):
            raise self.exception("{} is not an integer".format(value))
        if self.lsb0 and self.value % 2 == 1:
            raise self.exception("{} not power of two".format(value))
        if not self.signed and value < 0:
            raise self.exception("{} cannot be negative".format(value))
        if value < self.min() or value > self.max():
            raise self.exception("{} not in allowed range {}-{}".format(value, self.min(), self.max()))

        self.value = value
def set ( self , value : int ) : if not isinstance ( value , int ) : raise self . exception ( "{} is not an integer" . format ( value ) ) if self . lsb0 and self . value % 2 == 1 : raise self . exception ( "{} not power of two" . format ( value ) ) if not self . signed and value < 0 : raise self . exception ( "{} cannot be negative" . format ( value ) ) if value < self . min ( ) or value > self . max ( ) : raise self . exception ( "{} not in allowed range {}-{}" . format ( value , self . min ( ) , self . max ( ) ) ) self . value = value
Set the immediate to a value. This function checks if the value is valid and will raise an
        :class:`InvalidImmediateException` if it doesn't.

        :param value: Value to set the immediate to
        :type value: int

        :raises InvalidImmediateException: value does not match immediate