class documentation

class WarrenMethods: (source)

View In Hierarchy

Methods as suggested in book. Hackers Delight.

Static Method max_and Upper bound of result of ANDing 2-intervals.
Static Method max_or Upper bound of result of ORing 2-intervals.
Static Method max_xor Upper bound of result of XORing 2-intervals.
Static Method min_and Lower bound of result of ANDing 2-intervals.
Static Method min_or Lower bound of result of ORing 2-intervals.
Static Method min_xor Lower bound of result of XORing 2-intervals.
@staticmethod
def max_and(a, b, c, d, w): (source)

Upper bound of result of ANDing 2-intervals. :param a: Lower bound of first interval :param b: Upper bound of first interval :param c: Lower bound of second interval :param d: Upper bound of second interval :param w: bit width :return: Upper bound of ANDing 2-intervals

@staticmethod
def max_or(a, b, c, d, w): (source)

Upper bound of result of ORing 2-intervals. :param a: Lower bound of first interval :param b: Upper bound of first interval :param c: Lower bound of second interval :param d: Upper bound of second interval :param w: bit width :return: Upper bound of ORing 2-intervals

@staticmethod
def max_xor(a, b, c, d, w): (source)

Upper bound of result of XORing 2-intervals. :param a: Lower bound of first interval :param b: Upper bound of first interval :param c: Lower bound of second interval :param d: Upper bound of second interval :param w: bit width :return: Upper bound of XORing 2-intervals

@staticmethod
def min_and(a, b, c, d, w): (source)

Lower bound of result of ANDing 2-intervals. :param a: Lower bound of first interval :param b: Upper bound of first interval :param c: Lower bound of second interval :param d: Upper bound of second interval :param w: bit width :return: Lower bound of ANDing 2-intervals

@staticmethod
def min_or(a, b, c, d, w): (source)

Lower bound of result of ORing 2-intervals. :param a: Lower bound of first interval :param b: Upper bound of first interval :param c: Lower bound of second interval :param d: Upper bound of second interval :param w: bit width :return: Lower bound of ORing 2-intervals

@staticmethod
def min_xor(a, b, c, d, w): (source)

Lower bound of result of XORing 2-intervals. :param a: Lower bound of first interval :param b: Upper bound of first interval :param c: Lower bound of second interval :param d: Upper bound of second interval :param w: bit width :return: Lower bound of XORing 2-intervals