byucc.jhdl.base
Class BV

java.lang.Object
  extended byjava.lang.Number
      extended bybyucc.jhdl.base.BV
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
ConstBV

public class BV
extends java.lang.Number
implements java.lang.Cloneable, java.io.Serializable

Copyright (c) 1999-2000 Brigham Young University. All rights reserved. Reproduction in whole or in part in any form or medium without express permission of Brigham Young University is prohibited.

General Description

This class defines a structure that represents legal values for wires. Each BitVector (BV) has both a width and a value. In addition, a variety of methods are provided for manipulation of BVs.

Constructors

In general, the constructors are of the form: BV(width, value [, sign_ext]).
width must be a positive integer, or a BVException is thrown.
value can be a boolean, byte, char, short, int, long, low-endian int[] (that is, the least significant bits are in slot [0]), String, BigInteger, or BV. If value is wider than width, only the least significant bits will be used; if width is wider, the most significant bits will be set according to sign_ext.
sign_ext can be ZERO_PAD or SIGN_EXT, constants inherited by extending Cell. ZERO_PAD will set all bits beyond those provided to 0, SIGN_EXT will set all extra bits to the value of the most significant bit provided. When not provided, default behavior of the constructors is to ZERO_PAD.

String constructors have some minor differences. width may be the constant DETERMINE_FROM_STRING, or it may be omitted in which case it defaults to DETERMINE_FROM_STRING. This constant will set the width according to the number of bits per character of binary, octal, or hexadecimal strings, or to the minimum number of bits needed for a decimal string to be represented in 2's-complement. The String will be parsed as a decimal string unless prefixed with "0b" for binary, "0o" for octal, or "0x" for hexadecimal, but is not case sensitive. If a String is decimal, it is explicitly signed by the presence or absence of '-' at the beginning of the string, and in that case the flag sign_ext has no meaning. Whitespace in the string is ignored. If a String cannot be parsed, a NumberFormatException is thrown.

Additionally, the constructor BV(BV vector) is valid, simply cloning the vector. The constructors BV(BV bv1, BV bv2 [, BV bv3 [, BV bv4]]) and BV(BV[] array) concatenate the given BVs, with the first one listed providing the least significant bits. The constructor BV(int width) creates a BV with value 0. The constructor BV() creates a BV with width 1 and value 0. The constructor BV(Wire w) creates a BV with the width of the wire and value 0.

Instance modification:

Once a BV has been constructed, it can be modified directly with the method setValue([width,] value [, sign_ext]). Here, the parameters behave the same as in the constructors, except that width is optional and value required. If width is not specified, the BV does not change in width from its previous value, even when value is a String. In order to have different type signatures, setValue(int, boolean) treats the int as the value and the boolean as the sign_ext parameter - in order to interpret the int as the width and set a boolean value, a second boolean for sign_ext must be included.

The width of a BV can be modified by setWidth(width [, sign_ext]). If width is greater than the prior width, the new bits are set according to sign_ext, defaulting to ZERO_PAD if not specified. Also, setWidth(Wire w [, sign_ext]) sets the width to that of the wire argument.

Additionally, the methods setValue(BV bv1, BV bv2 [, BV bv3 [, BV bv4]]) and setValue(BV[] array) concatenate the given BVs, with the first one providing the least significant bits of the new BV.

Operations:

All operator methods are static, and return a BV. Each operator is of the form: operator([width, ] arglist [, output]).
When width is specified, the output will be that width, otherwise, it will be the width of output or the default as determined by the operation. When output is specified, it is modified to get the result of the operation, and is returned for chaining or nesting operations. When output is not specified, a new BV is created with the result and returned, available for assignment.
Caution should be excercised in assigning output to a variable when output is specified, because multiple references to the same BV could lead to data corruption.

See the individual operations for information on default width, and for the syntax of arglist. In general, arglist is a single BV for unary operators, and two BVs for binary.

Most operations also have an optional sign_ext flag as the last argument. In general, this flag determines whether an operation will be signed or unsigned, and whether the arguments and result will be sign-extended or zero-padded. See the operation in question to determine the behavior of the method with or without the use of this flag, when it is supported.

Arithmetic operators include add, incr (increment), sub, decr (decrement), abs (absolute value), negate, mult (multiply), div (divide), mod (modulus), pow (exponentiation), max, and min. Note that pow takes an int, not a BV, as the argument for the exponent, and that illegal math operations, like division by 0, throw an ArithmeticException.

Boolean operators include and, or, not, xor, nand, nor, xnor. Shift operators include shiftRight, shiftLeft, barrelShiftRight, and barrelShiftLeft. Note that the shift operations take an int, not a BV, as the argument for shift amount, and that a negative shift amount simply shifts in the opposite direction. The operator reverse simply reverses the bit order from most to least significant.

Comparison methods:

These instance methods return a boolean for comparison to 0: negative, positive, zero. equals(Object obj) overrides Object.equals for strict equality (both width and value are identical), and is accompanied by hashCode() to allow HashTables of BVs. signum returns -1 if the value is negative, 0 if it is zero, or 1 if it is positive, as a 2's-complement number. compare(BV bv2 [, sign_ext]) returns -1 if the bound instance is less than the argument, 0 if equal, and 1 if greater, with sign_ext determining whether the comparisons are signed or unsigned.

In addition, the following comparison methods exist in both an instance (where the bound reference is compared to the first argument) and a static (where the first argument is compared to the second) version, returning true if and only if the relation is satisfied: lt (less than), gt (greater than), lteq (less than or equal), gteq (greater than or equal), eq (equal in value, not necessarily width), and neq (not equal). Again, the presence of the optional flag sign_ext determines whether to perform signed or unsigned comparison.

Accessor methods:

The method stringBitWidth(String, [boolean]) returns the minimum number of bits needed to represent the string as a BV, either including or ignoring leading 0 bits in the string.

The following instance methods allow read access to the width and arbitrary portions of the value: getWidth, getBit, upperBits, lowerBits, and range. In addition, these instance methods allow write access to an arbitrary subset of an existing BV: setBit, setBits, clearBit, clearBits, toggleBit, toggleBits, and setRange. See the individual methods for more information on the argument types, but the return value is the updated BV except for getBit. In general, attempts to access bits out of the boundaries of the width will throw a BVException.

Further methods for obtaining information about a BV are getLSBOn, getMSBOff, getLSBOn, getLSBOff, getOnCount, and getOffCount. Also, the method clone() overrides that of Object, and returns a clone as type Object.

Conversion methods:

The following methods override Number, and provide a way to convert a BV to native types (although the conversion may lose precision): byteValue, shortValue, intValue, longValue, floatValue, and doubleValue.

These methods also convert a BV to various types, and accept the optional argument sign_ext of whether or not to sign-extend smaller BVs into the return type: toBoolean, toByte, toShort, toChar, toInt, toLong, toArray (a low-endian int[], where the lsb is in slot [0]). Formatted String conversion is provided with toBinaryString, toDecimalString, and toHexString.

The method toString overrides Object, and displays the width of the BV inside parentheses, before the value in hexadecimal, spaced every 8 characters for legibility.

Version:
$Revision: 3.8 $
Author:
Eric Blake
See Also:
Serialized Form

Field Summary
protected static int BYTE_MASK
          Mask the size of bytes within ints.
static int DETERMINE_FROM_STRING
          Set the width according to the number of bits required to represent the String.
protected static long INT_MASK
          Mask the size of ints within longs.
protected  boolean is_signed
          Shows if the BV is signed or unsigned
protected static int SHORT_MASK
          Mask the size of shorts within ints.
static boolean SIGN_EXT
          Set any bits beyond those provided to the value of the most significant bit provided.
static boolean SIGNED
          Perform a mathematical operation by treating the arguments as signed.
static boolean UNSIGNED
          Perform a mathematical operation by treating the arguments as unsigned.
protected  int[] value
          The value, low-endian (bits 31:0 in slot [0]).
protected  int width
          The width of the BV
static boolean ZERO_PAD
          Set any bits beyond those provided to 0.
 
Constructor Summary
BV()
          Creates an unsigned BV of width 1 and value 0.
BV(java.math.BigInteger value)
          Creates an unsigned BV of width value.bitLength() from the BigInteger.
BV(BV vector)
          Creates a BV of identical width (short for (BV)clone()).
BV(BV[] bv_array)
          Creates a BV by concatenating the given BVs, with the BV in slot 0 providing the least significant bits.
BV(BV bv1, BV bv2)
          Creates a BV by concatenating the given BVs, with the first argument providing the least significant bits.
BV(BV bv1, BV bv2, BV bv3)
          Creates a BV by concatenating the given BVs, with the first argument providing the least significant bits.
BV(BV bv1, BV bv2, BV bv3, BV bv4)
          Creates a BV by concatenating the given BVs, with the first argument providing the least significant bits.
BV(int width)
          Creates an unsigned BV of specified width and value 0.
BV(int width, java.math.BigInteger value)
          Creates an unsigned BV of arbitrary width, with zero-padding as necessary.
BV(int width, java.math.BigInteger value, boolean sign_ext)
          Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as indicated by sign_ext.
BV(int width, boolean value)
          Creates an unsigned BV of arbitrary width, set to true (1) or false (0).
BV(int width, boolean value, boolean sign_ext)
          Creates a BV of arbitrary width, set to true or false.
BV(int width, BV vector)
          Creates a BV of arbitrary width, with zero-padding or sign extension as determined by the signed flag of the original BV.
BV(int width, BV vector, boolean sign_ext)
          Creates a BV of arbitrary width, with appropriate sign extension and setting the signed flag of the new BV as indicated by sign_ext.
BV(int width, byte value)
          Creates an unsigned BV of arbitrary width, with zero-padding as necessary.
BV(int width, byte value, boolean sign_ext)
          Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as necessary.
BV(int width, char value)
          Creates an unsigned BV of arbitrary width, with zero-padding as necessary.
BV(int width, char value, boolean sign_ext)
          Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as necessary.
BV(int width, int value)
          Creates a BV of arbitrary width, with zero-padding as necessary.
BV(int width, int[] value)
          Creates a BV of arbitrary width, with zero-padding as necessary.
BV(int width, int[] value, boolean sign_ext)
          Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as necessary.
BV(int width, int value, boolean sign_ext)
          Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as necessary.
BV(int width, long value)
          Creates a BV of arbitrary width, with zero-padding as necessary.
BV(int width, long value, boolean sign_ext)
          Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as necessary.
BV(int width, short value)
          Creates a BV of arbitrary width, with zero-padding as necessary.
BV(int width, short value, boolean sign_ext)
          Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as necessary.
BV(int width, java.lang.String value)
          Creates an unsigned BV of arbitrary width, with zero-padding as necessary.
BV(int width, java.lang.String value, boolean sign_ext)
          Creates a BV of arbitrary width, with appropriate sign extension as necessary.
BV(java.lang.String value)
          Creates an unsigned BV of width DETERMINE_FROM_STRING.
BV(Wire w)
          Creates an unsigned BV with value 0 and width of the wire argument.
 
Method Summary
static BV abs(BV in)
          Returns a new BV with the absolute value of the argument, with default width.
static BV abs(BV in, BV out)
          Changes the value of out to the absolute value of the argument, with default width.
static BV abs(int width, BV in)
          Returns a new BV with the absolute value of the argument, with specified width.
static BV abs(int width, BV in, BV out)
          Changes the value of out to the absolute value of the argument, with specified width.
static BV add(BV in1, BV in2)
          Returns a new BV containing the sum of in1 and in2 with default width.
static BV add(BV in1, BV in2, boolean sign_ext)
          Returns a new BV containing the sum of in1 and in2 with default width.
static BV add(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV containing the sum of in1 and in2 with default width.
static BV add(BV in1, BV in2, BV out)
          Changes value of out to the sum of in1 and in2, keeping existing width.
static BV add(BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the sum of in1 and in2, keeping existing width.
static BV add(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the sum of in1 and in2, keeping existing width.
static BV add(int width, BV in1, BV in2)
          Returns a new BV containing the sum of in1 and in2 with specified width.
static BV add(int width, BV in1, BV in2, boolean sign_ext)
          Returns a new BV containing the sum of in1 and in2 with specified width.
static BV add(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV containing the sum of in1 and in2 with specified width.
static BV add(int width, BV in1, BV in2, BV out)
          Changes value of out to the sum of in1 and in2, resizing out to specified width.
static BV add(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the sum of in1 and in2, resizing out to specified width.
static BV add(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the sum of in1 and in2, resizing out to specified width.
static BV and(BV in1, BV in2)
          Returns boolean and of the two arguments, with default width.
static BV and(BV in1, BV in2, boolean sign_ext)
          Returns boolean and of the two arguments, with default width.
static BV and(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns boolean and of the two arguments, with default width.
static BV and(BV in1, BV in2, BV out)
          Changes value of out to the boolean and of the two arguments, with original width.
static BV and(BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the boolean and of the two arguments, with original width.
static BV and(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the boolean and of the two arguments, with original width.
static BV and(int width, BV in1, BV in2)
          Returns boolean and of the two arguments, with specified width.
static BV and(int width, BV in1, BV in2, boolean sign_ext)
          Returns boolean and of the two arguments, with specified width.
static BV and(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns boolean and of the two arguments, with specified width.
static BV and(int width, BV in1, BV in2, BV out)
          Changes value of out to the boolean and of the two arguments, with specified width.
static BV and(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the boolean and of the two arguments, with specified width.
static BV and(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the boolean and of the two arguments, with specified width.
static BV barrelShiftLeft(BV in, int amt)
          Barrel shifts the BV left (moves bits from left end to the right) by amt places.
static BV barrelShiftLeft(BV in, int amt, BV out)
          Barrel shifts the BV left (moves bits from left end to the right) by amt places.
static BV barrelShiftRight(BV in, int amt)
          Barrel shifts the BV right (moves bits from right end to the left) by amt places.
static BV barrelShiftRight(BV in, int amt, BV out)
          Barrel shifts the BV right (moves bits from right end to the left) by amt places.
 byte byteValue()
          Returns the least significant 8 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.
 BV clearBit(int pos)
          Clears value of bit in given position to 0.
 BV clearBits(int upper, int lower)
          Clears value of a range of bits to 0.
 java.lang.Object clone()
          Returns a clone of this.
 int compare(BV bv2)
          Returns integer representing relation between two bit vectors, default is sign extension if signed flag is set.
 int compare(BV bv2, boolean sign_ext)
          Returns integer representing relation between two bit vectors, according to sign_ext.
static int compare(BV bv1, BV bv2)
          Returns integer representing relation between two bit vectors, default of sign extension.
static int compare(BV bv1, BV bv2, boolean sign_ext)
          Returns integer representing relation between two bit vectors, according to sign_ext.
static int compare(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
          Returns integer representing relation between two bit vectors, according to sign_ext.
static BV decr(BV in)
          Returns a new BV with value 1 less than in and default width.
static BV decr(BV in, boolean sign_ext)
          Returns a new BV with value 1 less than in and default width.
static BV decr(BV in, BV out)
          Changes the value of out to be one more than the value of in.
static BV decr(BV in, BV out, boolean sign_ext)
          Changes the value of out to be one more than the value of in.
static BV decr(int width, BV in)
          Returns a new BV with value 1 less than in and default width.
static BV decr(int width, BV in, boolean sign_ext)
          Returns a new BV with value 1 less than in and default width.
static BV decr(int width, BV in, BV out)
          Changes the value of out to be one more than the value of in.
static BV decr(int width, BV in, BV out, boolean sign_ext)
          Changes the value of out to be one more than the value of in.
static BV div(BV in1, BV in2)
          Returns a new BV containing the quotient of in1 and in2 with default width.
static BV div(BV in1, BV in2, boolean sign_ext)
          Returns a new BV containing the quotient of in1 and in2 with default width.
static BV div(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV containing the quotient of in1 and in2 with default width.
static BV div(BV in1, BV in2, BV out)
          Changes value of out to the quotient of in1 and in2, keeping existing width.
static BV div(BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the quotient of in1 and in2, keeping existing width.
static BV div(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the quotient of in1 and in2, keeping existing width.
static BV div(int width, BV in1, BV in2)
          Returns a new BV containing the quotient of in1 and in2 with specified width.
static BV div(int width, BV in1, BV in2, boolean sign_ext)
          Returns a new BV containing the quotient of in1 and in2 with specified width.
static BV div(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV containing the quotient of in1 and in2 with specified width.
static BV div(int width, BV in1, BV in2, BV out)
          Changes value of out to the quotient of in1 and in2, resizing out to specified width.
static BV div(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the quotient of in1 and in2, resizing out to specified width.
static BV div(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the quotient of in1 and in2, resizing out to specified width.
 double doubleValue()
          Returns the closest double to the integral value of the BV.
 boolean eq(BV bv2)
          Returns true iff this == bv2.
 boolean eq(BV bv2, boolean sign_ext)
          Returns true iff this == bv2.
static boolean eq(BV bv1, BV bv2)
          Returns true iff bv1 == bv2.
static boolean eq(BV bv1, BV bv2, boolean sign_ext)
          Returns true iff bv1 == bv2.
static boolean eq(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
          Returns true iff bv1 == bv2.
 boolean equals(java.lang.Object obj)
          Returns true iff obj is equivalent to this.
 float floatValue()
          Returns the closest float to the integral value of the BV.
 boolean getBit(int pos)
          Returns value of bit in given position.
 boolean getIsSigned()
          Retrieves the current status of the signed flag of the BV.
 int getLSBOff()
          Returns the position of the first zero bit, starting from the least significant position.
static int getLSBOff(BV bv)
          Returns the position of the first zero bit, starting from the least significant position.
 int getLSBOn()
          Returns the position of the first non-zero bit, starting from the least significant position.
static int getLSBOn(BV bv)
          Returns the position of the first non-zero bit, starting from the least significant position.
 int getMSBOff()
          Returns the position of the first zero bit, starting from the most significant position.
static int getMSBOff(BV bv)
          Returns the position of the first zero bit, starting from the most significant position.
 int getMSBOn()
          Returns the position of the first non-zero bit, starting from the most significant position.
static int getMSBOn(BV bv)
          Returns the position of the first non-zero bit, starting from the most significant position.
 int getOffCount()
          Returns a count of the number of bits that are currently 0.
static int getOffCount(BV bv)
          Returns a count of the number of bits that are currently 0.
 int getOnCount()
          Returns a count of the number of bits that are currently 1.
static int getOnCount(BV bv)
          Returns a count of the number of bits that are currently 1.
 int getWidth()
          Retrieves the width of the BV.
 boolean gt(BV bv2)
          Returns true iff this > bv2.
 boolean gt(BV bv2, boolean sign_ext)
          Returns true iff this > bv2.
static boolean gt(BV bv1, BV bv2)
          Returns true iff bv1 > bv2.
static boolean gt(BV bv1, BV bv2, boolean sign_ext)
          Returns true iff bv1 > bv2.
static boolean gt(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
          Returns true iff bv1 > bv2.
 boolean gteq(BV bv2)
          Returns true iff this >= bv2.
 boolean gteq(BV bv2, boolean sign_ext)
          Returns true iff this >= bv2.
static boolean gteq(BV bv1, BV bv2)
          Returns true iff bv1 >= bv2.
static boolean gteq(BV bv1, BV bv2, boolean sign_ext)
          Returns true iff bv1 >= bv2.
static boolean gteq(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
          Returns true iff bv1 >= bv2.
 int hashCode()
          Returns a hash of this.
static BV incr(BV in)
          Returns a new BV with value 1 greater than in and default width.
static BV incr(BV in, boolean sign_ext)
          Returns a new BV with value 1 greater than in and default width.
static BV incr(BV in, BV out)
          Changes the value of out to be one more than the value of in.
static BV incr(BV in, BV out, boolean sign_ext)
          Changes the value of out to be one more than the value of in.
static BV incr(int width, BV in)
          Returns a new BV with value 1 greater than in and specified width.
static BV incr(int width, BV in, boolean sign_ext)
          Returns a new BV with value 1 greater than in and default width.
static BV incr(int width, BV in, BV out)
          Changes the value of out to be one more than the value of in.
static BV incr(int width, BV in, BV out, boolean sign_ext)
          Changes the value of out to be one more than the value of in.
protected  BV initFromString(int width, java.lang.String value, boolean sign_ext)
           
protected  boolean initWidth(int width)
           
 int intValue()
          Returns the least significant 32 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.
 long longValue()
          Returns the least significant 64 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.
 BV lowerBits(int amount)
          Returns a BV that has the present value and width of the specified amount of the least significant bits of this.
 BV lowerBits(int amount, BV out)
          Changes given BV to have the present value and width of the specified amount of the least significant bits of this.
 boolean lt(BV bv2)
          Returns true iff this < bv2.
 boolean lt(BV bv2, boolean sign_ext)
          Returns true iff this < bv2.
static boolean lt(BV bv1, BV bv2)
          Returns true iff bv1 < bv2.
static boolean lt(BV bv1, BV bv2, boolean sign_ext)
          Returns true iff bv1 < bv2.
static boolean lt(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
          Returns true iff bv1 < bv2.
 boolean lteq(BV bv2)
          Returns true iff this <= bv2.
 boolean lteq(BV bv2, boolean sign_ext)
          Returns true iff this <= bv2.
static boolean lteq(BV bv1, BV bv2)
          Returns true iff bv1 <= bv2.
static boolean lteq(BV bv1, BV bv2, boolean sign_ext)
          Returns true iff bv1 <= bv2.
static boolean lteq(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
          Returns true iff bv1 <= bv2.
static void main(java.lang.String[] argv)
           
static BV max(BV in1, BV in2)
          Returns a new BV with the maximum value of the two arguments, with default width.
static BV max(BV in1, BV in2, boolean sign_ext)
          Returns a new BV with the maximum value of the two arguments, with default width.
static BV max(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV with the maximum value of the two arguments, with default width.
static BV max(BV in1, BV in2, BV out)
          Changes the value of out to the maximum value of the two arguments, with default width.
static BV max(BV in1, BV in2, BV out, boolean sign_ext)
          Changes the value of out to the maximum value of the two arguments, with default width.
static BV max(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes the value of out to the maximum value of the two arguments, with default width.
static BV max(int width, BV in1, BV in2)
          Returns a new BV with the maximum value of the two arguments, with specified width.
static BV max(int width, BV in1, BV in2, boolean sign_ext)
          Returns a new BV with the maximum value of the two arguments, with specified width.
static BV max(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV with the maximum value of the two arguments, with specified width.
static BV max(int width, BV in1, BV in2, BV out)
          Changes the value of out to the maximum value of the two arguments, with specified width.
static BV max(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes the value of out to the maximum value of the two arguments, with specified width.
static BV max(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes the value of out to the maximum value of the two arguments, with specified width.
static BV min(BV in1, BV in2)
          Returns a new BV with the minimum value of the two arguments, with default width.
static BV min(BV in1, BV in2, boolean sign_ext)
          Returns a new BV with the minimum value of the two arguments, with default width.
static BV min(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV with the minimum value of the two arguments, with default width.
static BV min(BV in1, BV in2, BV out)
          Changes the value of out to the minimum value of the two arguments, with default width.
static BV min(BV in1, BV in2, BV out, boolean sign_ext)
          Changes the value of out to the minimum value of the two arguments, with default width.
static BV min(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes the value of out to the minimum value of the two arguments, with default width.
static BV min(int width, BV in1, BV in2)
          Returns a new BV with the minimum value of the two arguments, with specified width.
static BV min(int width, BV in1, BV in2, boolean sign_ext)
          Returns a new BV with the minimum value of the two arguments, with specified width.
static BV min(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV with the minimum value of the two arguments, with specified width.
static BV min(int width, BV in1, BV in2, BV out)
          Changes the value of out to the minimum value of the two arguments, with specified width.
static BV min(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes the value of out to the minimum value of the two arguments, with specified width.
static BV min(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes the value of out to the minimum value of the two arguments, with specified width.
static BV mod(BV in1, BV in2)
          Returns a new BV containing the modulus of in1 and in2 with default width.
static BV mod(BV in1, BV in2, boolean sign_ext)
          Returns a new BV containing the modulus of in1 and in2 with default width.
static BV mod(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV containing the modulus of in1 and in2 with default width.
static BV mod(BV in1, BV in2, BV out)
          Changes value of out to the modulus of in1 and in2, keeping existing width.
static BV mod(BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the modulus of in1 and in2, keeping existing width.
static BV mod(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the modulus of in1 and in2, keeping existing width.
static BV mod(int width, BV in1, BV in2)
          Returns a new BV containing the modulus of in1 and in2 with specified width.
static BV mod(int width, BV in1, BV in2, boolean sign_ext)
          Returns a new BV containing the modulus of in1 and in2 with specified width.
static BV mod(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV containing the modulus of in1 and in2 with specified width.
static BV mod(int width, BV in1, BV in2, BV out)
          Changes value of out to the modulus of in1 and in2, resizing out to specified width.
static BV mod(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the modulus of in1 and in2, resizing out to specified width.
static BV mod(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the modulus of in1 and in2, resizing out to specified width.
static BV mult(BV in1, BV in2)
          Returns a new BV containing the product of in1 and in2 with default width.
static BV mult(BV in1, BV in2, boolean sign_ext)
          Returns a new BV containing the product of in1 and in2 with default width.
static BV mult(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV containing the product of in1 and in2 with default width.
static BV mult(BV in1, BV in2, BV out)
          Changes value of out to the product of in1 and in2, keeping existing width.
static BV mult(BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the product of in1 and in2, keeping existing width.
static BV mult(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the product of in1 and in2, keeping existing width.
static BV mult(int width, BV in1, BV in2)
          Returns a new BV containing the product of in1 and in2 with specified width.
static BV mult(int width, BV in1, BV in2, boolean sign_ext)
          Returns a new BV containing the product of in1 and in2 with specified width.
static BV mult(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV containing the product of in1 and in2 with specified width.
static BV mult(int width, BV in1, BV in2, BV out)
          Changes value of out to the product of in1 and in2, resizing out to specified width.
static BV mult(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the product of in1 and in2, resizing out to specified width.
static BV mult(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the product of in1 and in2, resizing out to specified width.
static BV multUpper(BV in1, BV in2)
          Returns a new BV containing the product of in1 and in2 with default width.
static BV multUpper(BV in1, BV in2, boolean sign_ext)
          Returns a new BV containing the product of in1 and in2 with default width.
static BV multUpper(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV containing the product of in1 and in2 with default width.
static BV multUpper(BV in1, BV in2, BV out)
          Changes value of out to the product of in1 and in2, keeping existing width.
static BV multUpper(BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the product of in1 and in2, keeping existing width.
static BV multUpper(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the product of in1 and in2, keeping existing width.
static BV multUpper(int width, BV in1, BV in2)
          Returns a new BV containing the product of in1 and in2 with specified width.
static BV multUpper(int width, BV in1, BV in2, boolean sign_ext)
          Returns a new BV containing the product of in1 and in2 with specified width.
static BV multUpper(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV containing the product of in1 and in2 with specified width.
static BV multUpper(int width, BV in1, BV in2, BV out)
          Changes value of out to the product of in1 and in2, resizing out to specified width.
static BV multUpper(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the product of in1 and in2, resizing out to specified width.
static BV multUpper(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the product of in1 and in2, resizing out to specified width.
static BV nand(BV in1, BV in2)
          Returns boolean nand of the two arguments, with default width.
static BV nand(BV in1, BV in2, boolean sign_ext)
          Returns boolean nand of the two arguments, with default width.
static BV nand(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns boolean nand of the two arguments, with default width.
static BV nand(BV in1, BV in2, BV out)
          Changes value of out to the boolean nand of the two arguments, with original width.
static BV nand(BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the boolean nand of the two arguments, with original width.
static BV nand(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the boolean nand of the two arguments, with original width.
static BV nand(int width, BV in1, BV in2)
          Returns boolean nand of the two arguments, with specified width.
static BV nand(int width, BV in1, BV in2, boolean sign_ext)
          Returns boolean nand of the two arguments, with specified width.
static BV nand(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns boolean nand of the two arguments, with specified width.
static BV nand(int width, BV in1, BV in2, BV out)
          Changes value of out to the boolean nand of the two arguments, with specified width.
static BV nand(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the boolean nand of the two arguments, with specified width.
static BV nand(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the boolean nand of the two arguments, with specified width.
static BV negate(BV in)
          Returns a new BV containing the negation of in (in 2's complement) with default width.
static BV negate(BV in, boolean sign_ext)
          Returns a new BV containing the negation of in (in 2's complement) with default width.
static BV negate(BV in, BV out)
          Returns the BV out, with value modified to be the negation of in.
static BV negate(BV in, BV out, boolean sign_ext)
          Returns the BV out, with value modified to be the negation of in.
static BV negate(int width, BV in)
          Returns a new BV containing the negation of in with specified width.
static BV negate(int width, BV in, boolean sign_ext)
          Returns a new BV containing the negation of in with specified width.
static BV negate(int width, BV in, BV out)
          Returns the BV out, with value the negation of in and specified width.
static BV negate(int width, BV in, BV out, boolean sign_ext)
          Returns the BV out, with value the negation of in and specified width.
 boolean negative()
          Returns true if negative when interpreted as a 2's-complement number if signed flag set, otherwise returns false.
 boolean negative(boolean is_Signed)
          Returns true if negative when interpreted as a 2's-complement number, otherwise returns false.
static boolean negative(BV bv)
          Returns true if negative when interpreted as a 2's-complement number if signed flag set, otherwise returns false.
 boolean neq(BV bv2)
          Returns true iff this != bv2.
 boolean neq(BV bv2, boolean sign_ext)
          Returns true iff this != bv2.
static boolean neq(BV bv1, BV bv2)
          Returns true iff bv1 != bv2.
static boolean neq(BV bv1, BV bv2, boolean sign_ext)
          Returns true iff bv1 != bv2.
static boolean neq(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
          Returns true iff bv1 != bv2.
static BV nor(BV in1, BV in2)
          Returns boolean nor of the two arguments, with default width.
static BV nor(BV in1, BV in2, boolean sign_ext)
          Returns boolean nor of the two arguments, with default width.
static BV nor(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns boolean nor of the two arguments, with default width.
static BV nor(BV in1, BV in2, BV out)
          Changes value of out to the boolean nor of the two arguments, with original width.
static BV nor(BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the boolean nor of the two arguments, with original width.
static BV nor(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the boolean nor of the two arguments, with original width.
static BV nor(int width, BV in1, BV in2)
          Returns boolean nor of the two arguments, with specified width.
static BV nor(int width, BV in1, BV in2, boolean sign_ext)
          Returns boolean nor of the two arguments, with specified width.
static BV nor(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns boolean nor of the two arguments, with specified width.
static BV nor(int width, BV in1, BV in2, BV out)
          Changes value of out to the boolean nor of the two arguments, with specified width.
static BV nor(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the boolean nor of the two arguments, with specified width.
static BV nor(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the boolean nor of the two arguments, with specified width.
static BV not(BV in)
          Returns boolean not (the inverse) of the argument, with default width.
static BV not(BV in, boolean sign_ext)
          Returns boolean not of the argument, with default width.
static BV not(BV in, BV out)
          Changes value of out to the boolean not of the argument, with original width.
static BV not(BV in, BV out, boolean sign_ext)
          Changes value of out to the boolean not of the argument, with original width.
static BV not(int width, BV in)
          Returns boolean not of the argument, with specified width.
static BV not(int width, BV in, boolean sign_ext)
          Returns boolean not of the argument, with specified width.
static BV not(int width, BV in, BV out)
          Changes value of out to the boolean not of the argument, with specified width.
static BV not(int width, BV in, BV out, boolean sign_ext)
          Changes value of out to the boolean not of the argument, with specified width.
static BV or(BV in1, BV in2)
          Returns boolean or of the two arguments, with default width.
static BV or(BV in1, BV in2, boolean sign_ext)
          Returns boolean or of the two arguments, with default width.
static BV or(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns boolean or of the two arguments, with default width.
static BV or(BV in1, BV in2, BV out)
          Changes value of out to the boolean or of the two arguments, with original width.
static BV or(BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the boolean or of the two arguments, with original width.
static BV or(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the boolean or of the two arguments, with original width.
static BV or(int width, BV in1, BV in2)
          Returns boolean or of the two arguments, with specified width.
static BV or(int width, BV in1, BV in2, boolean sign_ext)
          Returns boolean or of the two arguments, with specified width.
static BV or(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns boolean or of the two arguments, with specified width.
static BV or(int width, BV in1, BV in2, BV out)
          Changes value of out to the boolean or of the two arguments, with specified width.
static BV or(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the boolean or of the two arguments, with specified width.
static BV or(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the boolean or of the two arguments, with specified width.
 boolean positive()
          Returns true if positive when interpreted as a 2's-complement number.
 boolean positive(boolean is_Signed)
          Returns true if positive when interpreted as a 2's-complement number.
static boolean positive(BV bv)
          Returns true if positive when interpreted as a 2's-complement number.
static BV pow(BV in, int amt)
          Returns the value of the BV raised to the amt power, with default width.
static BV pow(BV in, int amt, boolean sign_ext)
          Returns the value of the BV raised to the amt power, with default width.
static BV pow(BV in, int amt, BV out)
          Changes out to the value of in raised to the amt power, keeping width of out.
static BV pow(BV in, int amt, BV out, boolean sign_ext)
          Changes out to the value of in raised to the amt power, keeping width of out.
static BV pow(int width, BV in, int amt)
          Returns the value of the BV raised to the amt power, with specified width.
static BV pow(int width, BV in, int amt, boolean sign_ext)
          Returns the value of the BV raised to the amt power, with specified width.
static BV pow(int width, BV in, int amt, BV out)
          Changes out to the value of in raised to the amt power, with specified width.
static BV pow(int width, BV in, int amt, BV out, boolean sign_ext)
          Changes out to the value of in raised to the amt power, with specified width.
 BV range(int upper, int lower)
          Returns a BV that has the present value of the specified range of this.
 BV range(int upper, int lower, BV out)
          Returns a BV that has the present value of the specified range of this.
static BV reverse(BV in)
          Reverses the order of the bits from most to least significant.
static BV reverse(BV in, BV out)
          Reverses the order of the bits from most to least significant.
 BV setBit(int pos)
          Sets value of bit in given position to 1.
 BV setBit(int pos, boolean value)
          Sets value of bit in given position to 1 if value is true, to 0 if value is false.
 BV setBits(int upper, int lower)
          Sets value of a range of bits to 1.
 BV setBits(int upper, int lower, boolean value)
          Sets value of a range of bits to 1 if value is true, to 0 if value is false.
 BV setIsSigned(boolean is_signed)
          Sets value of signed flag of the BV.
 BV setRange(int lower, BV in)
          Sets the range of the BV starting at lower to the value of the argument, stopping at either the most significant bit of the argument or the instance.
 BV setRange(int upper, int lower, BV in)
          Sets the given range of the BV to the value of the argument, taking the least significant portion of the argument or extending it according to the signed flag as needed.
 BV setRange(int upper, int lower, BV in, boolean sign_ext)
          Sets the given range of the BV to the value of the argument, taking the least significant portion of the argument or extending it according to sign_ext as needed.
 BV setValue(java.math.BigInteger value)
          Sets value of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(java.math.BigInteger value, boolean sign_ext)
          Sets value of BV, with appropriate sign extension as necessary.
 BV setValue(boolean value)
          Sets value of BV to true (1) or false (0) if signed flag indicated unsigned, otherwise if it's signed true (-1) or false (0).
 BV setValue(boolean value, boolean sign_ext)
          Sets value of BV to true or false.
 BV setValue(BV vector)
          Sets value of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(BV[] bv_array)
          Sets value and width of BV to the concatenation of the arguments, with the BV in array slot 0 providing the least significant bits.
 BV setValue(BV vector, boolean sign_ext)
          Sets value of BV, with appropriate sign extension as necessary.
 BV setValue(BV bv1, BV bv2)
          Sets value and width of BV to the concatenation of the arguments, with the first argument providing the least significant bits.
 BV setValue(BV bv1, BV bv2, BV bv3)
          Sets value and width of BV to the concatenation of the arguments, with the first argument providing the least significant bits.
 BV setValue(BV bv1, BV bv2, BV bv3, BV bv4)
          Sets value and width of BV to the concatenation of the arguments, with the first argument providing the least significant bits.
 BV setValue(byte value)
          Sets value of BV, with zero-padding or sign extension as indicated by the signed flag.
 BV setValue(byte value, boolean sign_ext)
          Sets value of BV, with appropriate sign extension as necessary.
 BV setValue(char value)
          Sets value of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(char value, boolean sign_ext)
          Sets value of BV, with appropriate sign extension as necessary.
 BV setValue(int value)
          Sets value of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(int[] value)
          Sets value of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(int[] value, boolean sign_ext)
          Sets value of BV, with appropriate sign extension as necessary.
 BV setValue(int width, java.math.BigInteger value)
          Sets value and width of BV, with zero-padding or sign extension as determined by signed flag.
 BV setValue(int width, java.math.BigInteger value, boolean sign_ext)
          Sets value and width of BV, with appropriate sign exension as necessary.
 BV setValue(int value, boolean sign_ext)
          Sets value of BV, with appropriate sign extension as necessary.
 BV setValue(int width, boolean value, boolean sign_ext)
          Sets width and value of BV to true or false.
 BV setValue(int width, BV vector)
          Sets value and width of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(int width, BV vector, boolean sign_ext)
          Sets value and width of BV, with appropriate sign exension as necessary.
 BV setValue(int width, byte value)
          Sets value and width of BV, with zero-padding or sign extension as indicated by the signed flag.
 BV setValue(int width, byte value, boolean sign_ext)
          Sets value and width of BV, with appropriate sign exension as necessary.
 BV setValue(int width, char value)
          Sets value and width of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(int width, char value, boolean sign_ext)
          Sets value and width of BV, with appropriate sign exension as necessary.
 BV setValue(int width, int value)
          Sets value and width of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(int width, int[] value)
          Sets value and width of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(int width, int[] value, boolean sign_ext)
          Sets value and width of BV, with appropriate sign exension as necessary.
 BV setValue(int width, int value, boolean sign_ext)
          Sets value and width of BV, with appropriate sign exension as necessary.
 BV setValue(int width, long value)
          Sets value and width of BV, with zero-padding or sign extension as determinted by the signed flag.
 BV setValue(int width, long value, boolean sign_ext)
          Sets value and width of BV, with appropriate sign exension as necessary.
 BV setValue(int width, short value)
          Sets value and width of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(int width, short value, boolean sign_ext)
          Sets value and width of BV, with appropriate sign exension as necessary.
 BV setValue(int width, java.lang.String value)
          Sets value and width of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(int width, java.lang.String value, boolean sign_ext)
          Sets value and width of BV, with appropriate sign exension as necessary.
 BV setValue(long value)
          Sets value of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(long value, boolean sign_ext)
          Sets value of BV, with appropriate sign extension as necessary.
 BV setValue(short value)
          Sets value of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(short value, boolean sign_ext)
          Sets value of BV, with appropriate sign extension as necessary.
 BV setValue(java.lang.String value)
          Sets value of BV, with zero-padding or sign extension as determined by the signed flag.
 BV setValue(java.lang.String value, boolean sign_ext)
          Sets value of BV, with appropriate sign extension as necessary.
 BV setWidth(int width)
          Sets width of BV, with appropriate zero-padding or sign extension as determined by the signed flag.
 BV setWidth(int width, boolean sign_ext)
          Sets width of BV, with appropriate sign extension as necessary.
 BV setWidth(Wire w)
          Sets width of BV to match width of wire argument with zero-padding or sign extension as determined by the signed flag.
 BV setWidth(Wire w, boolean sign_ext)
          Sets width of BV to match width of wire argument, sign extension as specified.
static BV shiftLeft(BV in, int amt)
          Returns the value of the BV shifted left by amt places, with default width.
static BV shiftLeft(BV in, int amt, boolean sign_ext)
          Returns the value of the BV shifted left by amt places, with default width.
static BV shiftLeft(BV in, int amt, BV out)
          Changes out to the value of in shifted left by amt places, keeping width of out.
static BV shiftLeft(BV in, int amt, BV out, boolean sign_ext)
          Changes out to the value of in shifted left by amt places, keeping width of out.
static BV shiftLeft(int width, BV in, int amt)
          Returns the value of the BV shifted left by amt places, with specified width.
static BV shiftLeft(int width, BV in, int amt, boolean sign_ext)
          Returns the value of the BV shifted left by amt places, with specified width.
static BV shiftLeft(int width, BV in, int amt, BV out)
          Changes out to the value of in shifted left by amt places, with specified width.
static BV shiftLeft(int width, BV in, int amt, BV out, boolean sign_ext)
          Changes out to the value of in shifted left by amt places, with specified width.
static BV shiftRight(BV in, int amt)
          Returns the value of the BV shifted right by amt places, with default width.
static BV shiftRight(BV in, int amt, boolean sign_ext)
          Returns the value of the BV shifted right by amt places, with default width.
static BV shiftRight(BV in, int amt, BV out)
          Changes out to the value of in shifted right by amt places, keeping width of out.
static BV shiftRight(BV in, int amt, BV out, boolean sign_ext)
          Changes out to the value of in shifted right by amt places, keeping width of out.
static BV shiftRight(int width, BV in, int amt)
          Returns the value of the BV shifted right by amt places, with specified width.
static BV shiftRight(int width, BV in, int amt, boolean sign_ext)
          Returns the value of the BV shifted right by amt places, with specified width.
static BV shiftRight(int width, BV in, int amt, BV out)
          Changes out to the value of in shifted right by amt places, with specified width.
static BV shiftRight(int width, BV in, int amt, BV out, boolean sign_ext)
          Changes out to the value of in shifted right by amt places, with specified width.
 short shortValue()
          Returns the least significant 16 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.
 int signum()
          Returns the signum of the value.
static int signum(BV bv)
          Returns the signum of the value.
static int stringBitWidth(java.lang.String str)
          Returns the width that DETERMINE_FROM_STRING will use for the given string
static int stringBitWidth(java.lang.String str, boolean ignore_zeroes)
          Returns the number of bits needed to represent the given string If ignore_zeroes is false, this is equivalent to the width using DETERMINE_FROM_STRING in the constructor; if true, it is the position of the first non-zero bit
static BV sub(BV in1, BV in2)
          Returns a new BV containing the difference of in1 and in2 with default width.
static BV sub(BV in1, BV in2, boolean sign_ext)
          Returns a new BV containing the difference of in1 and in2 with default width.
static BV sub(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV containing the difference of in1 and in2 with default width.
static BV sub(BV in1, BV in2, BV out)
          Changes value of out to the difference of in1 and in2, keeping existing width.
static BV sub(BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the difference of in1 and in2, keeping existing width.
static BV sub(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the difference of in1 and in2, keeping existing width.
static BV sub(int width, BV in1, BV in2)
          Returns a new BV containing the difference of in1 and in2 with specified width.
static BV sub(int width, BV in1, BV in2, boolean sign_ext)
          Returns a new BV containing the difference of in1 and in2 with specified width.
static BV sub(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns a new BV containing the difference of in1 and in2 with specified width.
static BV sub(int width, BV in1, BV in2, BV out)
          Changes value of out to the difference of in1 and in2, resizing out to specified width.
static BV sub(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the difference of in1 and in2, resizing out to specified width.
static BV sub(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the difference of in1 and in2, resizing out to specified width.
 int[] toArray()
          Returns the value as a low-endian int[] (ie.
 int[] toArray(boolean sign_ext)
          Returns the value as an int[] (ie.
 java.math.BigInteger toBigInteger()
          Returns the value as a BigInteger, with zero padding or sign-extended as indicated by the signed flag.
 java.math.BigInteger toBigInteger(boolean sign_ext)
          Returns the value as a BigInteger, with appropriate sign extension.
 java.lang.String toBinaryString()
          Returns value of BV as a straight binary string, no leading 0's.
 java.lang.String toBinaryString(boolean print_leading_zeroes)
          Returns value of BV as a straight binary string, with leading 0's iff flag is true.
 boolean toBoolean()
          Returns true if the BV is non-zero.
 BV[] toBVArray(int bv_size)
          Returns the value as a low-endian BV[] (ie.
 BV[] toBVArray(int bv_size, boolean sign_ext)
          Returns the value as an BV[] (ie.
 byte toByte()
          Returns the least significant 8 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.
 byte toByte(boolean sign_ext)
          Returns the least significant 8 bits of the BV, with appropriate sign extension.
 char toChar()
          Returns the least significant 16 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.
 char toChar(boolean sign_ext)
          Returns the least significant 16 bits of the BV, with appropriate sign extension.
 java.lang.String toDecimalString()
          Returns value of BV interpreted as a 2's-complement number iff signed flag is set.
 java.lang.String toDecimalString(boolean signed)
          Returns value of BV as a decimal string, no leading 0's, interpreted as a 2's-complement number iff flag is true.
 BV toggleBit(int pos)
          Toggles value of bit in given position between 1 and 0, and returns its new value.
 BV toggleBits(int upper, int lower)
          Toggles value of each bit in a range between 1 and 0.
 java.lang.String toHexString()
          Returns value of BV as a straight hexadecimal string, with leading 0's iff signed flag is set.
 java.lang.String toHexString(boolean print_leading_zeroes)
          Returns value of BV as a straight hexadecimal string, with leading 0's iff flag is true.
 int toInt()
          Returns the least significant 32 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.
 int toInt(boolean sign_ext)
          Returns the least significant 32 bits of the BV, with appropriate sign extension.
 long toLong()
          Returns the least significant 64 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.
 long toLong(boolean sign_ext)
          Returns the least significant 64 bits of the BV, with appropriate sign extension.
 short toShort()
          Returns the least significant 16 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.
 short toShort(boolean sign_ext)
          Returns the least significant 16 bits of the BV, with appropriate sign extension.
 java.lang.String toString()
          Displays a BV as "(width bits)0xvalue", where value is in hexadecimal, and separated by spaces every 8 characters for legibility.
 java.lang.String toString(int radix)
          Returns value of BV as a string of specified radix.
 BV upperBits(int amount)
          Returns a BV that has the present value and width of the specified amount of the most significant bits of this.
 BV upperBits(int amount, BV out)
          Changes given BV to have the present value and width of the specified amount of the most significant bits of this.
protected  boolean verify()
           
static BV xnor(BV in1, BV in2)
          Returns boolean xnor of the two arguments, with default width.
static BV xnor(BV in1, BV in2, boolean sign_ext)
          Returns boolean xnor of the two arguments, with default width.
static BV xnor(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns boolean xnor of the two arguments, with default width.
static BV xnor(BV in1, BV in2, BV out)
          Changes value of out to the boolean xnor of the two arguments, with original width.
static BV xnor(BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the boolean xnor of the two arguments, with original width.
static BV xnor(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the boolean xnor of the two arguments, with original width.
static BV xnor(int width, BV in1, BV in2)
          Returns boolean xnor of the two arguments, with specified width.
static BV xnor(int width, BV in1, BV in2, boolean sign_ext)
          Returns boolean xnor of the two arguments, with specified width.
static BV xnor(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns boolean xnor of the two arguments, with specified width.
static BV xnor(int width, BV in1, BV in2, BV out)
          Changes value of out to the boolean xnor of the two arguments, with specified width.
static BV xnor(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the boolean xnor of the two arguments, with specified width.
static BV xnor(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the boolean xnor of the two arguments, with specified width.
static BV xor(BV in1, BV in2)
          Returns boolean xor of the two arguments, with default width.
static BV xor(BV in1, BV in2, boolean sign_ext)
          Returns boolean xor of the two arguments, with default width.
static BV xor(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns boolean xor of the two arguments, with default width.
static BV xor(BV in1, BV in2, BV out)
          Changes value of out to the boolean xor of the two arguments, with original width.
static BV xor(BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the boolean xor of the two arguments, with original width.
static BV xor(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the boolean xor of the two arguments, with original width.
static BV xor(int width, BV in1, BV in2)
          Returns boolean xor of the two arguments, with specified width.
static BV xor(int width, BV in1, BV in2, boolean sign_ext)
          Returns boolean xor of the two arguments, with specified width.
static BV xor(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
          Returns boolean xor of the two arguments, with specified width.
static BV xor(int width, BV in1, BV in2, BV out)
          Changes value of out to the boolean xor of the two arguments, with specified width.
static BV xor(int width, BV in1, BV in2, BV out, boolean sign_ext)
          Changes value of out to the boolean xor of the two arguments, with specified width.
static BV xor(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
          Changes value of out to the boolean xor of the two arguments, with specified width.
 boolean zero()
          Returns true if the value is 0.
static boolean zero(BV bv)
          Returns true if the value is 0.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

width

protected int width
The width of the BV


value

protected int[] value
The value, low-endian (bits 31:0 in slot [0]). Internally, unused bits in the top slot have no guarantee as to value; see #fixExtraBits(boolean)


is_signed

protected boolean is_signed
Shows if the BV is signed or unsigned


ZERO_PAD

public static final boolean ZERO_PAD
Set any bits beyond those provided to 0.

See Also:
Constant Field Values

SIGN_EXT

public static final boolean SIGN_EXT
Set any bits beyond those provided to the value of the most significant bit provided.

See Also:
Constant Field Values

DETERMINE_FROM_STRING

public static final int DETERMINE_FROM_STRING
Set the width according to the number of bits required to represent the String.

See Also:
Constant Field Values

UNSIGNED

public static final boolean UNSIGNED
Perform a mathematical operation by treating the arguments as unsigned.

See Also:
Constant Field Values

SIGNED

public static final boolean SIGNED
Perform a mathematical operation by treating the arguments as signed.

See Also:
Constant Field Values

BYTE_MASK

protected static final int BYTE_MASK
Mask the size of bytes within ints.

See Also:
Constant Field Values

SHORT_MASK

protected static final int SHORT_MASK
Mask the size of shorts within ints.

See Also:
Constant Field Values

INT_MASK

protected static final long INT_MASK
Mask the size of ints within longs.

See Also:
Constant Field Values
Constructor Detail

BV

public BV()
Creates an unsigned BV of width 1 and value 0.


BV

public BV(int width)
Creates an unsigned BV of specified width and value 0.

Parameters:
width - The width of the vector.

BV

public BV(Wire w)
Creates an unsigned BV with value 0 and width of the wire argument.

Parameters:
w - The wire to determine width from.

BV

public BV(int width,
          boolean value)
Creates an unsigned BV of arbitrary width, set to true (1) or false (0).

Parameters:
width - The width of the vector.
value - The value of the vector.

BV

public BV(int width,
          boolean value,
          boolean sign_ext)
Creates a BV of arbitrary width, set to true or false. When value is true, ZERO_PAD sets only the least significant bit, SIGN_EXT sets all bits and sets the signed flag.

Parameters:
width - The width of the vector.
value - The value of the vector.
sign_ext - Either ZERO_PAD or SIGN_EXT.

BV

public BV(int width,
          byte value)
Creates an unsigned BV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the vector.
value - Up to 8 bits of the vector.

BV

public BV(int width,
          byte value,
          boolean sign_ext)
Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as necessary.

Parameters:
width - The width of the vector.
value - Up to 8 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.

BV

public BV(int width,
          char value)
Creates an unsigned BV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the vector.
value - Up to 16 bits of the value.

BV

public BV(int width,
          char value,
          boolean sign_ext)
Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as necessary.

Parameters:
width - The width of the vector.
value - Up to 16 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.

BV

public BV(int width,
          short value)
Creates a BV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the vector.
value - Up to 16 bits of the value.

BV

public BV(int width,
          short value,
          boolean sign_ext)
Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as necessary.

Parameters:
width - The width of the vector.
value - Up to 16 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.

BV

public BV(int width,
          int value)
Creates a BV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the vector.
value - Up to 32 bits of the value.

BV

public BV(int width,
          int value,
          boolean sign_ext)
Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as necessary.

Parameters:
width - The width of the vector.
value - Up to 32 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.

BV

public BV(int width,
          long value)
Creates a BV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the vector.
value - Up to 64 bits of the value.

BV

public BV(int width,
          long value,
          boolean sign_ext)
Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as necessary.

Parameters:
width - The width of the vector.
value - Up to 64 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.

BV

public BV(int width,
          int[] value)
Creates a BV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the vector.
value - An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).

BV

public BV(int width,
          int[] value,
          boolean sign_ext)
Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as necessary.

Parameters:
width - The width of the vector.
value - An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).
sign_ext - Either ZERO_PAD or SIGN_EXT.

BV

public BV(BV vector)
Creates a BV of identical width (short for (BV)clone()).

Parameters:
vector - The original BV.

BV

public BV(BV bv1,
          BV bv2)
Creates a BV by concatenating the given BVs, with the first argument providing the least significant bits. The result will have the signed flag set to unsigned.

Parameters:
bv1 - The least significant bits.
bv2 - The next bits.

BV

public BV(BV bv1,
          BV bv2,
          BV bv3)
Creates a BV by concatenating the given BVs, with the first argument providing the least significant bits. The result will have the signed flag set to unsigned.

Parameters:
bv1 - The least significant bits.
bv2 - The next bits.
bv3 - The next bits.

BV

public BV(BV bv1,
          BV bv2,
          BV bv3,
          BV bv4)
Creates a BV by concatenating the given BVs, with the first argument providing the least significant bits. The result will have the signed flag set to unsigned.

Parameters:
bv1 - The least significant bits.
bv2 - The next bits.
bv3 - The next bits.
bv4 - The next bits.

BV

public BV(BV[] bv_array)
Creates a BV by concatenating the given BVs, with the BV in slot 0 providing the least significant bits. The result will have the signed flag set to unsigned.

Parameters:
bv_array - The array of BVs, least significant bits in slot 0.
Throws:
BVException - if the array contains only null pointers.

BV

public BV(int width,
          BV vector)
Creates a BV of arbitrary width, with zero-padding or sign extension as determined by the signed flag of the original BV.

Parameters:
width - The width of the new vector.
vector - Original BV.

BV

public BV(int width,
          BV vector,
          boolean sign_ext)
Creates a BV of arbitrary width, with appropriate sign extension and setting the signed flag of the new BV as indicated by sign_ext.

Parameters:
width - The width of the new vector.
vector - Original BV.
sign_ext - Either ZERO_PAD or SIGN_EXT.

BV

public BV(java.lang.String value)
Creates an unsigned BV of width DETERMINE_FROM_STRING. A negative string will create a positive integer with the same bit pattern

Parameters:
value - The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
Throws:
java.lang.NumberFormatException - if the string cannot be parsed as a valid number

BV

public BV(int width,
          java.lang.String value)
Creates an unsigned BV of arbitrary width, with zero-padding as necessary. For width of DETERMINE_FROM_STRING, if the string is binary, octal, or hexadecimal, the vector is (bits per digit)*(digits) wide, and if the string is decimal, the vector is the minimum number of bits for a 2's-complement representation, given by ceil(log2(this < 0 ? -this : this + 1)) + 1.

Parameters:
width - The width of the new vector.
value - The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
Throws:
java.lang.NumberFormatException - if the string cannot be parsed as a valid number

BV

public BV(int width,
          java.lang.String value,
          boolean sign_ext)
Creates a BV of arbitrary width, with appropriate sign extension as necessary. For width of DETERMINE_FROM_STRING, if the string is binary, octal, or hexadecimal, the vector is (bits per digit)*(digits) wide, and if the string is decimal, the vector is the minimum number of bits for a 2's-complement representation, given by ceil(log2(this < 0 ? -this : this + 1)) + 1. The signed flag will be set as indicated by sign_ext.

Parameters:
width - The width of the new vector.
value - The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Throws:
java.lang.NumberFormatException - if the string cannot be parsed as a valid number

BV

public BV(java.math.BigInteger value)
Creates an unsigned BV of width value.bitLength() from the BigInteger.

Parameters:
value - The BigInteger to parse.

BV

public BV(int width,
          java.math.BigInteger value)
Creates an unsigned BV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the new vector.
value - The BigInteger to parse.

BV

public BV(int width,
          java.math.BigInteger value,
          boolean sign_ext)
Creates a BV of arbitrary width, with appropriate sign extension and signed flag set as indicated by sign_ext.

Parameters:
width - The width of the new vector.
value - The String to parse.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Method Detail

setValue

public BV setValue(boolean value)
Sets value of BV to true (1) or false (0) if signed flag indicated unsigned, otherwise if it's signed true (-1) or false (0).

Parameters:
value - The value of the vector.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(boolean value,
                   boolean sign_ext)
Sets value of BV to true or false. When value is true, ZERO_PAD sets only the least significant bit, SIGN_EXT sets all bits.

Parameters:
value - The value of the vector.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   boolean value,
                   boolean sign_ext)
Sets width and value of BV to true or false. When value is true, ZERO_PAD sets only the least significant bit, SIGN_EXT sets all bits.

Parameters:
width - New width of BV.
value - The value of the vector.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(byte value)
Sets value of BV, with zero-padding or sign extension as indicated by the signed flag.

Parameters:
value - Up to 8 bits of the vector.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(byte value,
                   boolean sign_ext)
Sets value of BV, with appropriate sign extension as necessary.

Parameters:
value - Up to 8 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   byte value)
Sets value and width of BV, with zero-padding or sign extension as indicated by the signed flag.

Parameters:
width - New width of BV.
value - Up to 8 bits of the value.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   byte value,
                   boolean sign_ext)
Sets value and width of BV, with appropriate sign exension as necessary.

Parameters:
width - New width of BV.
value - Up to 8 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(char value)
Sets value of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
value - Up to 16 bits of the value.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(char value,
                   boolean sign_ext)
Sets value of BV, with appropriate sign extension as necessary.

Parameters:
value - Up to 16 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   char value)
Sets value and width of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
width - New width of BV.
value - Up to 16 bits of the value.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   char value,
                   boolean sign_ext)
Sets value and width of BV, with appropriate sign exension as necessary.

Parameters:
width - New width of BV.
value - Up to 16 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(short value)
Sets value of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
value - Up to 16 bits of the value.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(short value,
                   boolean sign_ext)
Sets value of BV, with appropriate sign extension as necessary.

Parameters:
value - Up to 16 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   short value)
Sets value and width of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
width - New width of BV.
value - Up to 16 bits of the value.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   short value,
                   boolean sign_ext)
Sets value and width of BV, with appropriate sign exension as necessary.

Parameters:
width - New width of BV.
value - Up to 16 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int value)
Sets value of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
value - Up to 32 bits of the value.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int value,
                   boolean sign_ext)
Sets value of BV, with appropriate sign extension as necessary. NOTE: This does not set the width according to the int and the value according to the boolean. For that functionality, @see setValue(int, boolean, boolean).

Parameters:
value - Up to 32 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   int value)
Sets value and width of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
width - New width of BV.
value - Up to 32 bits of the value.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   int value,
                   boolean sign_ext)
Sets value and width of BV, with appropriate sign exension as necessary.

Parameters:
width - New width of BV.
value - Up to 32 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(long value)
Sets value of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
value - Up to 64 bits of the value.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(long value,
                   boolean sign_ext)
Sets value of BV, with appropriate sign extension as necessary.

Parameters:
value - Up to 64 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   long value)
Sets value and width of BV, with zero-padding or sign extension as determinted by the signed flag.

Parameters:
width - New width of BV.
value - Up to 64 bits of the value.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   long value,
                   boolean sign_ext)
Sets value and width of BV, with appropriate sign exension as necessary.

Parameters:
width - New width of BV.
value - Up to 64 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int[] value)
Sets value of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
value - An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int[] value,
                   boolean sign_ext)
Sets value of BV, with appropriate sign extension as necessary.

Parameters:
value - An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   int[] value)
Sets value and width of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
width - New width of BV.
value - An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   int[] value,
                   boolean sign_ext)
Sets value and width of BV, with appropriate sign exension as necessary.

Parameters:
width - New width of BV.
value - An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(BV vector)
Sets value of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
vector - Original BV.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(BV bv1,
                   BV bv2)
Sets value and width of BV to the concatenation of the arguments, with the first argument providing the least significant bits. Signed flag will be set to unsigned.

Parameters:
bv1 - The least significant bits.
bv2 - The next bits.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(BV bv1,
                   BV bv2,
                   BV bv3)
Sets value and width of BV to the concatenation of the arguments, with the first argument providing the least significant bits. Signed flag will be set to unsigned.

Parameters:
bv1 - The least significant bits.
bv2 - The next bits.
bv3 - The next bits.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(BV bv1,
                   BV bv2,
                   BV bv3,
                   BV bv4)
Sets value and width of BV to the concatenation of the arguments, with the first argument providing the least significant bits. Signed flag will be set to unsigned.

Parameters:
bv1 - The least significant bits.
bv2 - The next bits.
bv3 - The next bits.
bv4 - The next bits.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(BV[] bv_array)
Sets value and width of BV to the concatenation of the arguments, with the BV in array slot 0 providing the least significant bits. Signed flag will be set to unsigned.

Parameters:
bv_array -
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - if the array contains only null pointers.

setValue

public BV setValue(BV vector,
                   boolean sign_ext)
Sets value of BV, with appropriate sign extension as necessary.

Parameters:
vector - Original BV.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   BV vector)
Sets value and width of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
width - New width of BV.
vector - Original BV.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   BV vector,
                   boolean sign_ext)
Sets value and width of BV, with appropriate sign exension as necessary.

Parameters:
width - New width of BV.
vector - Original BV.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(java.lang.String value)
Sets value of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
value - The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
Returns:
this, to allow chaining or nesting of operations.
Throws:
java.lang.NumberFormatException - if the string cannot be parsed as a valid number

setValue

public BV setValue(java.lang.String value,
                   boolean sign_ext)
Sets value of BV, with appropriate sign extension as necessary.

Parameters:
value - The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Throws:
java.lang.NumberFormatException - if the string cannot be parsed as a valid number

setValue

public BV setValue(int width,
                   java.lang.String value)
Sets value and width of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
width - New width of BV.
value - The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
Returns:
this, to allow chaining or nesting of operations.
Throws:
java.lang.NumberFormatException - if the string cannot be parsed as a valid number

setValue

public BV setValue(int width,
                   java.lang.String value,
                   boolean sign_ext)
Sets value and width of BV, with appropriate sign exension as necessary.

Parameters:
width - New width of BV.
value - The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
java.lang.NumberFormatException - if the string cannot be parsed as a valid number

setValue

public BV setValue(java.math.BigInteger value)
Sets value of BV, with zero-padding or sign extension as determined by the signed flag.

Parameters:
value - The BigInteger to parse.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(java.math.BigInteger value,
                   boolean sign_ext)
Sets value of BV, with appropriate sign extension as necessary.

Parameters:
value - The BigInteger to parse.
sign_ext - Either ZERO_PAD or SIGN_EXT.

setValue

public BV setValue(int width,
                   java.math.BigInteger value)
Sets value and width of BV, with zero-padding or sign extension as determined by signed flag.

Parameters:
width - New width of BV.
value - The BigInteger to parse.
Returns:
this, to allow chaining or nesting of operations.

setValue

public BV setValue(int width,
                   java.math.BigInteger value,
                   boolean sign_ext)
Sets value and width of BV, with appropriate sign exension as necessary.

Parameters:
width - New width of BV.
value - The BigInteger to parse.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

setWidth

public BV setWidth(int width)
Sets width of BV, with appropriate zero-padding or sign extension as determined by the signed flag.

Parameters:
width - The new width of the BV.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - if width is not positive.

setWidth

public BV setWidth(int width,
                   boolean sign_ext)
Sets width of BV, with appropriate sign extension as necessary.

Parameters:
width - The new width of the BV.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - if width is not positive.

setWidth

public BV setWidth(Wire w)
Sets width of BV to match width of wire argument with zero-padding or sign extension as determined by the signed flag.

Parameters:
w - The wire to determine width from.
Returns:
this, to allow chaining or nesting of operations.

setWidth

public BV setWidth(Wire w,
                   boolean sign_ext)
Sets width of BV to match width of wire argument, sign extension as specified.

Parameters:
w - The wire to determine width from.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.

negate

public static BV negate(BV in)
Returns a new BV containing the negation of in (in 2's complement) with default width. Default width for negate() is the width of the argument, and default sign behavior is to sign extend the argument to the return width before negation. Signed flag is set on returned value. BV.negate(a) is counterpart to Java's -a.

Parameters:
in - the argument.
Returns:
-in, allows chaining or nesting of operations.

negate

public static BV negate(int width,
                        BV in)
Returns a new BV containing the negation of in with specified width. Signed flag is set on returned value.

Parameters:
width - the width to set the result to.
in - the argument.
Returns:
-in, allows chaining or nesting of operations.

negate

public static BV negate(BV in,
                        BV out)
Returns the BV out, with value modified to be the negation of in. Signed flag is set on out. BV.negate(b, a) corresponds to Java's a = -b.

Parameters:
in - the argument.
out - the location to store the result.
Returns:
out = -in, allows chaining or nesting of operations.

negate

public static BV negate(int width,
                        BV in,
                        BV out)
Returns the BV out, with value the negation of in and specified width. Signed flag is set on out.

Parameters:
width - the width to set the result to.
in - the argument.
out - the location to store the result.
Returns:
out = -in, allows chaining or nesting of operations.

negate

public static BV negate(BV in,
                        boolean sign_ext)
Returns a new BV containing the negation of in (in 2's complement) with default width. Setting sign_ext to ZERO_PAD overrides default behavior, and pads extra bits of shorter arguments to width of the result before negation. Signed flag is set on returned value.

Parameters:
in - the argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
-in, allows chaining or nesting of operations.

negate

public static BV negate(int width,
                        BV in,
                        boolean sign_ext)
Returns a new BV containing the negation of in with specified width.

Parameters:
width - the width to set the result to.
in - the argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
-in, allows chaining or nesting of operations.

negate

public static BV negate(BV in,
                        BV out,
                        boolean sign_ext)
Returns the BV out, with value modified to be the negation of in.

Parameters:
in - the argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = -in, allows chaining or nesting of operations.

negate

public static BV negate(int width,
                        BV in,
                        BV out,
                        boolean sign_ext)
Returns the BV out, with value the negation of in and specified width.

Parameters:
width - the width to set the result to.
in - the argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = -in, allows chaining or nesting of operations.

abs

public static BV abs(BV in)
Returns a new BV with the absolute value of the argument, with default width. Default width for abs() is the width of the argument, there is no flag as abs() only works on signed numbers.

Parameters:
in - the argument.
Returns:
in < 0 ? -in : in, allows chaining or nesting of operations.

abs

public static BV abs(int width,
                     BV in)
Returns a new BV with the absolute value of the argument, with specified width.

Parameters:
width - the width to set the result to.
in - the argument.
Returns:
in < 0 ? -in : in, allows chaining or nesting of operations.

abs

public static BV abs(BV in,
                     BV out)
Changes the value of out to the absolute value of the argument, with default width.

Parameters:
in - the argument.
out - the location to store the result.
Returns:
out = in < 0 ? -in : in, allows chaining or nesting of operations.

abs

public static BV abs(int width,
                     BV in,
                     BV out)
Changes the value of out to the absolute value of the argument, with specified width.

Parameters:
width - the width to set the result to.
in - the argument.
out - the location to store the result.
Returns:
out = in < 0 ? -in : in, allows chaining or nesting of operations.

max

public static BV max(BV in1,
                     BV in2)
Returns a new BV with the maximum value of the two arguments, with default width. Default width for max() is the width of the argument that is returned, and default sign behavior is signed comparison if either is signed and sign extending or zero padding shorter arguments according to the signed flag to the specified width before the comparison. If the two values are equal, the first argument is returned.

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
in1 >= in2 ? in1 : in2, allows chaining or nesting of operations.

max

public static BV max(int width,
                     BV in1,
                     BV in2)
Returns a new BV with the maximum value of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
in1 >= in2 ? in1 : in2, allows chaining or nesting of operations.

max

public static BV max(BV in1,
                     BV in2,
                     BV out)
Changes the value of out to the maximum value of the two arguments, with default width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
in1 >= in2 ? in1 : in2, allows chaining or nesting of operations.

max

public static BV max(int width,
                     BV in1,
                     BV in2,
                     BV out)
Changes the value of out to the maximum value of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
in1 >= in2 ? in1 : in2, allows chaining or nesting of operations.

max

public static BV max(BV in1,
                     BV in2,
                     boolean sign_ext)
Returns a new BV with the maximum value of the two arguments, with default width. Setting sign_ext to ZERO_PAD overrides default behavior, doing unsigned comparison to determine the maximum value. Setting sign_ext to SIGN_EXT will sign extend both values.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 >= in2 ? in1 : in2, allows chaining or nesting of operations.

max

public static BV max(BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns a new BV with the maximum value of the two arguments, with default width. Setting sign_ext to ZERO_PAD overrides default behavior for that argument, treating it as an unsigned value to determine the maximum value. Setting it to SIGN_EXT will treat it as a signed value.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 >= in2 ? in1 : in2, allows chaining or nesting of operations.

max

public static BV max(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext)
Returns a new BV with the maximum value of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 >= in2 ? in1 : in2, allows chaining or nesting of operations.

max

public static BV max(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns a new BV with the maximum value of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT for the second argument.
Returns:
in1 >= in2 ? in1 : in2, allows chaining or nesting of operations.

max

public static BV max(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes the value of out to the maximum value of the two arguments, with default width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT both arguments.
Returns:
in1 >= in2 ? in1 : in2, allows chaining or nesting of operations.

max

public static BV max(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes the value of out to the maximum value of the two arguments, with default width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT the second argument.
Returns:
in1 >= in2 ? in1 : in2, allows chaining or nesting of operations.

max

public static BV max(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes the value of out to the maximum value of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT both arguments.
Returns:
in1 >= in2 ? in1 : in2, allows chaining or nesting of operations.

max

public static BV max(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes the value of out to the maximum value of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT the second argument.
Returns:
in1 >= in2 ? in1 : in2, allows chaining or nesting of operations.

min

public static BV min(BV in1,
                     BV in2)
Returns a new BV with the minimum value of the two arguments, with default width. Default width for min() is the width of the argument that is returned, and default sign behavior is signed comparison if either is signed and sign extending or zero padding according to the signed flags. If the two values are equal, the first argument is returned.

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
in1 <= in2 ? in1 : in2, allows chaining or nesting of operations.

min

public static BV min(int width,
                     BV in1,
                     BV in2)
Returns a new BV with the minimum value of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
in1 <= in2 ? in1 : in2, allows chaining or nesting of operations.

min

public static BV min(BV in1,
                     BV in2,
                     BV out)
Changes the value of out to the minimum value of the two arguments, with default width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
in1 <= in2 ? in1 : in2, allows chaining or nesting of operations.

min

public static BV min(int width,
                     BV in1,
                     BV in2,
                     BV out)
Changes the value of out to the minimum value of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
in1 <= in2 ? in1 : in2, allows chaining or nesting of operations.

min

public static BV min(BV in1,
                     BV in2,
                     boolean sign_ext)
Returns a new BV with the minimum value of the two arguments, with default width. Setting sign_ext to ZERO_PAD overrides default behavior, doing unsigned comparison to determine the minimum value.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT both arguments.
Returns:
in1 <= in2 ? in1 : in2, allows chaining or nesting of operations.

min

public static BV min(BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns a new BV with the minimum value of the two arguments, with default width. Setting sign_ext to ZERO_PAD overrides default behavior, doing unsigned comparison to determine the minimum value.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT teh second argument.
Returns:
in1 <= in2 ? in1 : in2, allows chaining or nesting of operations.

min

public static BV min(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext)
Returns a new BV with the minimum value of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 <= in2 ? in1 : in2, allows chaining or nesting of operations.

min

public static BV min(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns a new BV with the minimum value of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 <= in2 ? in1 : in2, allows chaining or nesting of operations.

min

public static BV min(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes the value of out to the minimum value of the two arguments, with default width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT used for both arguments.
Returns:
in1 <= in2 ? in1 : in2, allows chaining or nesting of operations.

min

public static BV min(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes the value of out to the minimum value of the two arguments, with default width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT for the second argument.
Returns:
in1 <= in2 ? in1 : in2, allows chaining or nesting of operations.

min

public static BV min(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes the value of out to the minimum value of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 <= in2 ? in1 : in2, allows chaining or nesting of operations.

min

public static BV min(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes the value of out to the minimum value of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 <= in2 ? in1 : in2, allows chaining or nesting of operations.

add

public static BV add(BV in1,
                     BV in2)
Returns a new BV containing the sum of in1 and in2 with default width. Default width for add() is 1 + the larger width of its two arguments, to allow for overflow, and default sign behavior is to sign-extend or zero pad arguments according to the signed flags to the width of the result before adding. BV.add(a, b) is counterpart to Java's a + b.

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
in1 + in2, allows chaining or nesting of operations.

add

public static BV add(int width,
                     BV in1,
                     BV in2)
Returns a new BV containing the sum of in1 and in2 with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
in1 + in2, allows chaining or nesting of operations

add

public static BV add(BV in1,
                     BV in2,
                     BV out)
Changes value of out to the sum of in1 and in2, keeping existing width. BV.add(a, b, a) corresponds to Java's a += b. BV.add(b, c, a) corresponds to Java's a = b + c.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
out = in1 + in2, allows chaining or nesting of operations

add

public static BV add(int width,
                     BV in1,
                     BV in2,
                     BV out)
Changes value of out to the sum of in1 and in2, resizing out to specified width.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
out = in1 + in2, allows chaining or nesting of operations

add

public static BV add(BV in1,
                     BV in2,
                     boolean sign_ext)
Returns a new BV containing the sum of in1 and in2 with default width. Setting sign_ext to ZERO_PAD overrides default behavior, zero-padding shorter arguments to the width of the result before adding.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT, used for both arguments.
Returns:
in1 + in2, allows chaining or nesting of operations

add

public static BV add(BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns a new BV containing the sum of in1 and in2 with default width. Setting sign_ext to ZERO_PAD overrides default behavior, zero-padding shorter arguments to the width of the result before adding.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
in1 + in2, allows chaining or nesting of operations

add

public static BV add(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext)
Returns a new BV containing the sum of in1 and in2 with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 + in2, allows chaining or nesting of operations

add

public static BV add(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns a new BV containing the sum of in1 and in2 with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
in1 + in2, allows chaining or nesting of operations

add

public static BV add(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the sum of in1 and in2, keeping existing width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT used for both arguments.
Returns:
out = in1 + in2, allows chaining or nesting of operations

add

public static BV add(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the sum of in1 and in2, keeping existing width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
out = in1 + in2, allows chaining or nesting of operations

add

public static BV add(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the sum of in1 and in2, resizing out to specified width.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 + in2, allows chaining or nesting of operations

add

public static BV add(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the sum of in1 and in2, resizing out to specified width.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 + in2, allows chaining or nesting of operations

incr

public static BV incr(BV in)
Returns a new BV with value 1 greater than in and default width. Default width for incr() is the width of in, and default sign-extension behavior follows the signed flag. BV.incr(a) corresponds to Java's a + 1.

Parameters:
in - the BV to increment.
Returns:
in + 1, allows chaining or nesting of operations.

incr

public static BV incr(int width,
                      BV in)
Returns a new BV with value 1 greater than in and specified width.

Parameters:
width - the width to set the result to.
in - the BV to increment.
Returns:
in + 1, allows chaining or nesting of operations.

incr

public static BV incr(BV in,
                      BV out)
Changes the value of out to be one more than the value of in. BV.incr(a, a) corresponds to Java's a++.

Parameters:
in - the BV to increment.
out - the BV to store the result in.
Returns:
out = in + 1, allows chaining or nesting of operations.

incr

public static BV incr(int width,
                      BV in,
                      BV out)
Changes the value of out to be one more than the value of in.

Parameters:
width - the width to set the result to.
in - the BV to increment.
out - the BV to store the result in.
Returns:
out = in + 1, allows chaining or nesting of operations.

incr

public static BV incr(BV in,
                      boolean sign_ext)
Returns a new BV with value 1 greater than in and default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter argument to width of the result before incrementing. Signed flag of result will be set according to sign_ext.

Parameters:
in - the BV to increment.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in + 1, allows chaining or nesting of operations.

incr

public static BV incr(int width,
                      BV in,
                      boolean sign_ext)
Returns a new BV with value 1 greater than in and default width.

Parameters:
width - the width to set the result to.
in - the BV to increment.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in + 1, allows chaining or nesting of operations.

incr

public static BV incr(BV in,
                      BV out,
                      boolean sign_ext)
Changes the value of out to be one more than the value of in.

Parameters:
in - the BV to increment.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in + 1, allows chaining or nesting of operations.

incr

public static BV incr(int width,
                      BV in,
                      BV out,
                      boolean sign_ext)
Changes the value of out to be one more than the value of in.

Parameters:
width - the width to set the result to.
in - the BV to increment.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in + 1, allows chaining or nesting of operations.

sub

public static BV sub(BV in1,
                     BV in2)
Returns a new BV containing the difference of in1 and in2 with default width. Default width for sub() is 1 + the larger width of its two arguments, to allow for overflow, and default sign behavior is to zero-pad or sign-extend arguments as determined by the signed flags to the width of the result before subtracting. BV.sub(a, b) is counterpart to Java's a - b.

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
in1 - in2, allows chaining or nesting of operations.

sub

public static BV sub(int width,
                     BV in1,
                     BV in2)
Returns a new BV containing the difference of in1 and in2 with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
in1 - in2, allows chaining or nesting of operations

sub

public static BV sub(BV in1,
                     BV in2,
                     BV out)
Changes value of out to the difference of in1 and in2, keeping existing width. BV.sub(a, b, a) corresponds to Java's a -= b. BV.sub(b, c, a) corresponds to Java's a = b - c.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
out = in1 - in2, allows chaining or nesting of operations

sub

public static BV sub(int width,
                     BV in1,
                     BV in2,
                     BV out)
Changes value of out to the difference of in1 and in2, resizing out to specified width.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
out = in1 - in2, allows chaining or nesting of operations

sub

public static BV sub(BV in1,
                     BV in2,
                     boolean sign_ext)
Returns a new BV containing the difference of in1 and in2 with default width. Setting sign_ext to ZERO_PAD overrides default behavior, zero-padding shorter arguments to the width of the result before subtracting.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 - in2, allows chaining or nesting of operations

sub

public static BV sub(BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns a new BV containing the difference of in1 and in2 with default width. Setting sign_ext to ZERO_PAD overrides default behavior, zero-padding shorter arguments to the width of the result before subtracting.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
in1 - in2, allows chaining or nesting of operations

sub

public static BV sub(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext)
Returns a new BV containing the difference of in1 and in2 with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 - in2, allows chaining or nesting of operations

sub

public static BV sub(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns a new BV containing the difference of in1 and in2 with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
in1 - in2, allows chaining or nesting of operations

sub

public static BV sub(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the difference of in1 and in2, keeping existing width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 - in2, allows chaining or nesting of operations

sub

public static BV sub(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the difference of in1 and in2, keeping existing width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
out = in1 - in2, allows chaining or nesting of operations

sub

public static BV sub(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the difference of in1 and in2, resizing out to specified width.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 - in2, allows chaining or nesting of operations

sub

public static BV sub(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the difference of in1 and in2, resizing out to specified width.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
out = in1 - in2, allows chaining or nesting of operations

decr

public static BV decr(BV in)
Returns a new BV with value 1 less than in and default width. Default width for decr() is the width of in, and default sign-extension behavior is ZERO_PAD or SIGN_EXT as determined by signed flag. BV.decr(a) corresponds to Java's a - 1.

Parameters:
in - the BV to decrement.
Returns:
in - 1, allows chaining or nesting of operations.

decr

public static BV decr(int width,
                      BV in)
Returns a new BV with value 1 less than in and default width.

Parameters:
width - the width to set the result to.
in - the BV to decrement.
Returns:
in - 1, allows chaining or nesting of operations.

decr

public static BV decr(BV in,
                      BV out)
Changes the value of out to be one more than the value of in. BV.decr(a, a) corresponds to Java's a--.

Parameters:
in - the BV to decrement.
out - the BV to store the result in.
Returns:
out = in - 1, allows chaining or nesting of operations.

decr

public static BV decr(int width,
                      BV in,
                      BV out)
Changes the value of out to be one more than the value of in.

Parameters:
width - the width to set the result to.
in - the BV to decrement.
out - the BV to store the result in.
Returns:
out = in - 1, allows chaining or nesting of operations.

decr

public static BV decr(BV in,
                      boolean sign_ext)
Returns a new BV with value 1 less than in and default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter argument to width of the result before decrementing.

Parameters:
in - the BV to decrement.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in - 1, allows chaining or nesting of operations.

decr

public static BV decr(int width,
                      BV in,
                      boolean sign_ext)
Returns a new BV with value 1 less than in and default width.

Parameters:
width - the width to set the result to.
in - the BV to decrement.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in - 1, allows chaining or nesting of operations.

decr

public static BV decr(BV in,
                      BV out,
                      boolean sign_ext)
Changes the value of out to be one more than the value of in.

Parameters:
in - the BV to decrement.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in - 1, allows chaining or nesting of operations.

decr

public static BV decr(int width,
                      BV in,
                      BV out,
                      boolean sign_ext)
Changes the value of out to be one more than the value of in.

Parameters:
width - the width to set the result to.
in - the BV to decrement.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in - 1, allows chaining or nesting of operations.

mult

public static BV mult(BV in1,
                      BV in2)
Returns a new BV containing the product of in1 and in2 with default width. Default width for mult() is the sum of the widths of its two arguments, to allow for the largest possible result, and default sign behavior is to perform signed multiplication if either has the signed flag set, and to sign-extend any result that is narrower than default. BV.mult(a, b) is counterpart to Java's a * b.

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
in1 * in2, allows chaining or nesting of operations.

mult

public static BV mult(int width,
                      BV in1,
                      BV in2)
Returns a new BV containing the product of in1 and in2 with specified width. As in Java, if the resulting width is smaller than the complete product, the least significant bits are returned.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
in1 * in2, allows chaining or nesting of operations
See Also:
multUpper(width, in1, in2)

mult

public static BV mult(BV in1,
                      BV in2,
                      BV out)
Changes value of out to the product of in1 and in2, keeping existing width. As in Java, if the width of out is smaller than the complete product, the least significant bits are returned. BV.mult(a, b, a) corresponds to Java's a *= b. BV.mult(b, c, a) corresponds to Java's a = b * c.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
out = in1 * in2, allows chaining or nesting of operations
See Also:
multUpper(in1, in2, out)

mult

public static BV mult(int width,
                      BV in1,
                      BV in2,
                      BV out)
Changes value of out to the product of in1 and in2, resizing out to specified width. As in Java, if the width of out is smaller than the complete product, the least significant bits are returned.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
out = in1 * in2, allows chaining or nesting of operations
See Also:
multUpper(width, in1, in2, out)

mult

public static BV mult(BV in1,
                      BV in2,
                      boolean sign_ext)
Returns a new BV containing the product of in1 and in2 with default width. Setting sign_ext to ZERO_PAD overrides default behavior, performing unsigned multiplication, and hence zero-padding any bits of the result wider than default.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 * in2, allows chaining or nesting of operations

mult

public static BV mult(BV in1,
                      BV in2,
                      boolean sign_ext1,
                      boolean sign_ext2)
Returns a new BV containing the product of in1 and in2 with default width. Setting sign_ext to ZERO_PAD overrides default behavior, performing unsigned multiplication, and hence zero-padding any bits of the result wider than default.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
in1 * in2, allows chaining or nesting of operations

mult

public static BV mult(int width,
                      BV in1,
                      BV in2,
                      boolean sign_ext)
Returns a new BV containing the product of in1 and in2 with specified width. As in Java, if the resulting width is smaller than the complete product, the least significant bits are returned.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 * in2, allows chaining or nesting of operations
See Also:
multUpper(width, in1, in2, sign_ext)

mult

public static BV mult(int width,
                      BV in1,
                      BV in2,
                      boolean sign_ext1,
                      boolean sign_ext2)
Returns a new BV containing the product of in1 and in2 with specified width. As in Java, if the resulting width is smaller than the complete product, the least significant bits are returned.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for second argument.
Returns:
in1 * in2, allows chaining or nesting of operations
See Also:
multUpper(width, in1, in2, sign_ext)

mult

public static BV mult(BV in1,
                      BV in2,
                      BV out,
                      boolean sign_ext)
Changes value of out to the product of in1 and in2, keeping existing width. As in Java, if the width of out is smaller than the complete product, the least significant bits are returned.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 * in2, allows chaining or nesting of operations
See Also:
multUpper(in1, in2, out, sign_ext)

mult

public static BV mult(BV in1,
                      BV in2,
                      BV out,
                      boolean sign_ext1,
                      boolean sign_ext2)
Changes value of out to the product of in1 and in2, keeping existing width. As in Java, if the width of out is smaller than the complete product, the least significant bits are returned.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
out = in1 * in2, allows chaining or nesting of operations
See Also:
multUpper(in1, in2, out, sign_ext)

mult

public static BV mult(int width,
                      BV in1,
                      BV in2,
                      BV out,
                      boolean sign_ext)
Changes value of out to the product of in1 and in2, resizing out to specified width. As in Java, if the width of out is smaller than the complete product, the least significant bits are returned.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 * in2, allows chaining or nesting of operations
See Also:
multUpper(width, in1, in2, out, sign_ext)

mult

public static BV mult(int width,
                      BV in1,
                      BV in2,
                      BV out,
                      boolean sign_ext1,
                      boolean sign_ext2)
Changes value of out to the product of in1 and in2, resizing out to specified width. As in Java, if the width of out is smaller than the complete product, the least significant bits are returned.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
out = in1 * in2, allows chaining or nesting of operations
See Also:
multUpper(width, in1, in2, out, sign_ext)

multUpper

public static BV multUpper(BV in1,
                           BV in2)
Returns a new BV containing the product of in1 and in2 with default width. Default width for mult() is the sum of the widths of its two arguments, to allow for the largest possible result, and default sign behavior is to perform signed multiplication, and to sign-extend any result that is wider than default. BV.multUpper(a, b) is identical to BV.mult(a, b).

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
in1 * in2, allows chaining or nesting of operations.

multUpper

public static BV multUpper(int width,
                           BV in1,
                           BV in2)
Returns a new BV containing the product of in1 and in2 with specified width. Unlike Java, if the resulting width is smaller than the complete product, the most significant bits are returned.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
in1 * in2, allows chaining or nesting of operations
See Also:
mult(width, in1, in2)

multUpper

public static BV multUpper(BV in1,
                           BV in2,
                           BV out)
Changes value of out to the product of in1 and in2, keeping existing width. Unlike Java, if the width of out is smaller than the complete product, the most significant bits are returned. BV.mult(a, b, a) is similar to Java's a *= b. BV.mult(b, c, a) is similar to Java's a = b * c.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
out = in1 * in2, allows chaining or nesting of operations
See Also:
mult(in1, in2, out)

multUpper

public static BV multUpper(int width,
                           BV in1,
                           BV in2,
                           BV out)
Changes value of out to the product of in1 and in2, resizing out to specified width. Unlike Java, if the width of out is smaller than the complete product, the most significant bits are returned.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
out = in1 * in2, allows chaining or nesting of operations
See Also:
mult(width, in1, in2, out)

multUpper

public static BV multUpper(BV in1,
                           BV in2,
                           boolean sign_ext)
Returns a new BV containing the product of in1 and in2 with default width. Setting sign_ext to ZERO_PAD overrides default behavior, performing unsigned multiplication, and hence zero-padding any bits of the result wider than default.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 * in2, allows chaining or nesting of operations

multUpper

public static BV multUpper(BV in1,
                           BV in2,
                           boolean sign_ext1,
                           boolean sign_ext2)
Returns a new BV containing the product of in1 and in2 with default width. Setting sign_ext to ZERO_PAD overrides default behavior, performing unsigned multiplication, and hence zero-padding any bits of the result wider than default.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
in1 * in2, allows chaining or nesting of operations

multUpper

public static BV multUpper(int width,
                           BV in1,
                           BV in2,
                           boolean sign_ext)
Returns a new BV containing the product of in1 and in2 with specified width. Unlike Java, if the resulting width is smaller than the complete product, the most significant bits are returned.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 * in2, allows chaining or nesting of operations
See Also:
mult(width, in1, in2, sign_ext)

multUpper

public static BV multUpper(int width,
                           BV in1,
                           BV in2,
                           boolean sign_ext1,
                           boolean sign_ext2)
Returns a new BV containing the product of in1 and in2 with specified width. Unlike Java, if the resulting width is smaller than the complete product, the most significant bits are returned.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
in1 * in2, allows chaining or nesting of operations
See Also:
mult(width, in1, in2, sign_ext)

multUpper

public static BV multUpper(BV in1,
                           BV in2,
                           BV out,
                           boolean sign_ext)
Changes value of out to the product of in1 and in2, keeping existing width. Unlike Java, if the width of out is smaller than the complete product, the most significant bits are returned.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 * in2, allows chaining or nesting of operations
See Also:
mult(in1, in2, out, sign_ext)

multUpper

public static BV multUpper(BV in1,
                           BV in2,
                           BV out,
                           boolean sign_ext1,
                           boolean sign_ext2)
Changes value of out to the product of in1 and in2, keeping existing width. Unlike Java, if the width of out is smaller than the complete product, the most significant bits are returned.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
out = in1 * in2, allows chaining or nesting of operations
See Also:
mult(in1, in2, out, sign_ext)

multUpper

public static BV multUpper(int width,
                           BV in1,
                           BV in2,
                           BV out,
                           boolean sign_ext)
Changes value of out to the product of in1 and in2, resizing out to specified width. Unlike Java, if the width of out is smaller than the complete product, the most significant bits are returned.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 * in2, allows chaining or nesting of operations
See Also:
mult(width, in1, in2, out, sign_ext)

multUpper

public static BV multUpper(int width,
                           BV in1,
                           BV in2,
                           BV out,
                           boolean sign_ext1,
                           boolean sign_ext2)
Changes value of out to the product of in1 and in2, resizing out to specified width. Unlike Java, if the width of out is smaller than the complete product, the most significant bits are returned.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
out = in1 * in2, allows chaining or nesting of operations
See Also:
mult(width, in1, in2, out, sign_ext)

div

public static BV div(BV in1,
                     BV in2)
Returns a new BV containing the quotient of in1 and in2 with default width. Default width for div() is the 1 + the width of in1, to allow for signed division by -1, and default sign behavior is to perform signed division if either argument has the signed flag set, and to sign-extend any result that is wider than default. BV.div(a, b) is counterpart to Java's a / b.

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
in1 / in2, allows chaining or nesting of operations.
Throws:
java.lang.ArithmeticException - if in2 is 0.

div

public static BV div(int width,
                     BV in1,
                     BV in2)
Returns a new BV containing the quotient of in1 and in2 with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
in1 / in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

div

public static BV div(BV in1,
                     BV in2,
                     BV out)
Changes value of out to the quotient of in1 and in2, keeping existing width. BV.div(a, b, a) corresponds to Java's a /= b. BV.div(b, c, a) corresponds to Java's a = b / c.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
out = in1 / in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

div

public static BV div(int width,
                     BV in1,
                     BV in2,
                     BV out)
Changes value of out to the quotient of in1 and in2, resizing out to specified width.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
out = in1 / in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

div

public static BV div(BV in1,
                     BV in2,
                     boolean sign_ext)
Returns a new BV containing the quotient of in1 and in2 with default width. Setting sign_ext to ZERO_PAD overrides default behavior, performing unsigned division, and hence zero-padding any bits of the result wider than default.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 / in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

div

public static BV div(BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns a new BV containing the quotient of in1 and in2 with default width. Setting sign_ext to ZERO_PAD overrides default behavior, performing unsigned division, and hence zero-padding any bits of the result wider than default.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
in1 / in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

div

public static BV div(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext)
Returns a new BV containing the quotient of in1 and in2 with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 / in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

div

public static BV div(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns a new BV containing the quotient of in1 and in2 with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
in1 / in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

div

public static BV div(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the quotient of in1 and in2, keeping existing width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 / in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

div

public static BV div(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the quotient of in1 and in2, keeping existing width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
out = in1 / in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

div

public static BV div(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the quotient of in1 and in2, resizing out to specified width.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 / in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

div

public static BV div(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the quotient of in1 and in2, resizing out to specified width.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for the second argument.
Returns:
out = in1 / in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

mod

public static BV mod(BV in1,
                     BV in2)
Returns a new BV containing the modulus of in1 and in2 with default width. Default width for mod() is the width of in2, and default sign behavior if either has the signed flag set is to perform signed modulus (following the rules of Java), and to sign-extend any result that is wider than default. BV.mod(a, b) is counterpart to Java's a % b.

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
in1 % in2, allows chaining or nesting of operations.
Throws:
java.lang.ArithmeticException - if in2 is 0.

mod

public static BV mod(int width,
                     BV in1,
                     BV in2)
Returns a new BV containing the modulus of in1 and in2 with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
in1 % in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

mod

public static BV mod(BV in1,
                     BV in2,
                     BV out)
Changes value of out to the modulus of in1 and in2, keeping existing width. BV.mod(a, b, a) corresponds to Java's a %= b. BV.mod(b, c, a) corresponds to Java's a = b % c.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
out = in1 % in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

mod

public static BV mod(int width,
                     BV in1,
                     BV in2,
                     BV out)
Changes value of out to the modulus of in1 and in2, resizing out to specified width.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
Returns:
out = in1 % in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

mod

public static BV mod(BV in1,
                     BV in2,
                     boolean sign_ext)
Returns a new BV containing the modulus of in1 and in2 with default width. Setting sign_ext to ZERO_PAD overrides default behavior, performing unsigned modulus, and hence zero-padding any bits of the result wider than default.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 % in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

mod

public static BV mod(BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns a new BV containing the modulus of in1 and in2 with default width. Setting sign_ext to ZERO_PAD overrides default behavior, performing unsigned modulus, and hence zero-padding any bits of the result wider than default.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 % in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

mod

public static BV mod(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext)
Returns a new BV containing the modulus of in1 and in2 with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 % in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

mod

public static BV mod(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns a new BV containing the modulus of in1 and in2 with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 % in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

mod

public static BV mod(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the modulus of in1 and in2, keeping existing width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 % in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

mod

public static BV mod(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the modulus of in1 and in2, keeping existing width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 % in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

mod

public static BV mod(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the modulus of in1 and in2, resizing out to specified width.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 % in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

mod

public static BV mod(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the modulus of in1 and in2, resizing out to specified width.

Parameters:
width - the width to set out to.
in1 - the first argument.
in2 - the second argument.
out - the location to store the result.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 % in2, allows chaining or nesting of operations
Throws:
java.lang.ArithmeticException - if in2 is 0.

pow

public static BV pow(BV in,
                     int amt)
Returns the value of the BV raised to the amt power, with default width. Default width for pow() is the width of the BV argument * amt, or the original width if amt is 0, and default sign behavior is to follow the signed flag and treat the BV as a signed number or unsigned accordingly. BV.pow(a, 1) corresponds to Java's Math.pow(a, 1).

Parameters:
in - the argument to exponentiate.
amt - the power to raise the argument by.
Returns:
in ** amt, allows chaining or nesting of operations.
Throws:
java.lang.ArithmeticException - if in2 < 0.

pow

public static BV pow(int width,
                     BV in,
                     int amt)
Returns the value of the BV raised to the amt power, with specified width.

Parameters:
width - the width to set the result to.
in - the argument to exponentiate.
amt - the power to raise the argument by.
Returns:
in ** amt, allows chaining or nesting of operations.
Throws:
java.lang.ArithmeticException - if in2 < 0.

pow

public static BV pow(BV in,
                     int amt,
                     BV out)
Changes out to the value of in raised to the amt power, keeping width of out.

Parameters:
in - the argument to exponentiate.
amt - the power to raise the argument by.
out - the BV to store the result in.
Returns:
in ** amt, allows chaining or nesting of operations.
Throws:
java.lang.ArithmeticException - if in2 < 0.

pow

public static BV pow(int width,
                     BV in,
                     int amt,
                     BV out)
Changes out to the value of in raised to the amt power, with specified width.

Parameters:
width - the width to set the result to.
in - the argument to exponentiate.
amt - the power to raise the argument by.
out - the BV to store the result in.
Returns:
in ** amt, allows chaining or nesting of operations.
Throws:
java.lang.ArithmeticException - if in2 < 0.

pow

public static BV pow(BV in,
                     int amt,
                     boolean sign_ext)
Returns the value of the BV raised to the amt power, with default width. Setting sign_ext to ZERO_PAD overrides default behavior, treating the argument as a positive number, and hence zero-padding.

Parameters:
in - the argument to exponentiate.
amt - the power to raise the argument by.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in ** amt, allows chaining or nesting of operations.
Throws:
java.lang.ArithmeticException - if in2 < 0.

pow

public static BV pow(int width,
                     BV in,
                     int amt,
                     boolean sign_ext)
Returns the value of the BV raised to the amt power, with specified width.

Parameters:
width - the width to set the result to.
in - the argument to exponentiate.
amt - the power to raise the argument by.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in ** amt, allows chaining or nesting of operations.
Throws:
java.lang.ArithmeticException - if in2 < 0.

pow

public static BV pow(BV in,
                     int amt,
                     BV out,
                     boolean sign_ext)
Changes out to the value of in raised to the amt power, keeping width of out.

Parameters:
in - the argument to exponentiate.
amt - the power to raise the argument by.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in ** amt, allows chaining or nesting of operations.
Throws:
java.lang.ArithmeticException - if in2 < 0.

pow

public static BV pow(int width,
                     BV in,
                     int amt,
                     BV out,
                     boolean sign_ext)
Changes out to the value of in raised to the amt power, with specified width.

Parameters:
width - the width to set the result to.
in - the argument to exponentiate.
amt - the power to raise the argument by.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in ** amt, allows chaining or nesting of operations.
Throws:
java.lang.ArithmeticException - if in2 < 0.

and

public static BV and(BV in1,
                     BV in2)
Returns boolean and of the two arguments, with default width. Default width for and() is the width of the larger argument, and default sign behavior is to zero-pad or sign extend according to the signed flag the bits from shorter argument to the width of the result. BV.and(a, b) corresponds to Java's a & b.

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
in1 & in2, allows chaining or nesting of operations.

and

public static BV and(int width,
                     BV in1,
                     BV in2)
Returns boolean and of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
in1 & in2, allows chaining or nesting of operations.

and

public static BV and(BV in1,
                     BV in2,
                     BV out)
Changes value of out to the boolean and of the two arguments, with original width. BV.and(b, c, a) corresponds to Java's a = b & c. BV.and(a, b, a) corresponds to Java's a &= b.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
Returns:
out = in1 & in2, allows chaining or nesting of operations.

and

public static BV and(int width,
                     BV in1,
                     BV in2,
                     BV out)
Changes value of out to the boolean and of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
Returns:
out = in1 & in2, allows chaining or nesting of operations.

and

public static BV and(BV in1,
                     BV in2,
                     boolean sign_ext)
Returns boolean and of the two arguments, with default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter arguments to the length of the result before and-ing.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 & in2, allows chaining or nesting of operations.

and

public static BV and(BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns boolean and of the two arguments, with default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter arguments to the length of the result before and-ing.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 & in2, allows chaining or nesting of operations.

and

public static BV and(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext)
Returns boolean and of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 & in2, allows chaining or nesting of operations.

and

public static BV and(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns boolean and of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 & in2, allows chaining or nesting of operations.

and

public static BV and(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the boolean and of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 & in2, allows chaining or nesting of operations.

and

public static BV and(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the boolean and of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 & in2, allows chaining or nesting of operations.

and

public static BV and(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the boolean and of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 & in2, allows chaining or nesting of operations.

and

public static BV and(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the boolean and of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 & in2, allows chaining or nesting of operations.

or

public static BV or(BV in1,
                    BV in2)
Returns boolean or of the two arguments, with default width. Default width for or() is the width of the larger argument, and default sign behavior is to zero-pad or sign extend bits from shorter argument according to the signed flag to the width of the result. BV.or(a, b) corresponds to Java's a | b.

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
in1 | in2, allows chaining or nesting of operations.

or

public static BV or(int width,
                    BV in1,
                    BV in2)
Returns boolean or of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
in1 | in2, allows chaining or nesting of operations.

or

public static BV or(BV in1,
                    BV in2,
                    BV out)
Changes value of out to the boolean or of the two arguments, with original width. BV.or(b, c, a) corresponds to Java's a = b | c. BV.or(a, b, a) corresponds to Java's a |= b.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
Returns:
out = in1 | in2, allows chaining or nesting of operations.

or

public static BV or(int width,
                    BV in1,
                    BV in2,
                    BV out)
Changes value of out to the boolean or of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
Returns:
out = in1 | in2, allows chaining or nesting of operations.

or

public static BV or(BV in1,
                    BV in2,
                    boolean sign_ext)
Returns boolean or of the two arguments, with default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter arguments to the length of the result before or-ing.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 | in2, allows chaining or nesting of operations.

or

public static BV or(BV in1,
                    BV in2,
                    boolean sign_ext1,
                    boolean sign_ext2)
Returns boolean or of the two arguments, with default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter arguments to the length of the result before or-ing.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 | in2, allows chaining or nesting of operations.

or

public static BV or(int width,
                    BV in1,
                    BV in2,
                    boolean sign_ext)
Returns boolean or of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 | in2, allows chaining or nesting of operations.

or

public static BV or(int width,
                    BV in1,
                    BV in2,
                    boolean sign_ext1,
                    boolean sign_ext2)
Returns boolean or of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 | in2, allows chaining or nesting of operations.

or

public static BV or(BV in1,
                    BV in2,
                    BV out,
                    boolean sign_ext)
Changes value of out to the boolean or of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 | in2, allows chaining or nesting of operations.

or

public static BV or(BV in1,
                    BV in2,
                    BV out,
                    boolean sign_ext1,
                    boolean sign_ext2)
Changes value of out to the boolean or of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 | in2, allows chaining or nesting of operations.

or

public static BV or(int width,
                    BV in1,
                    BV in2,
                    BV out,
                    boolean sign_ext)
Changes value of out to the boolean or of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 | in2, allows chaining or nesting of operations.

or

public static BV or(int width,
                    BV in1,
                    BV in2,
                    BV out,
                    boolean sign_ext1,
                    boolean sign_ext2)
Changes value of out to the boolean or of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 | in2, allows chaining or nesting of operations.

xor

public static BV xor(BV in1,
                     BV in2)
Returns boolean xor of the two arguments, with default width. Default width for xor() is the width of the larger argument, and default sign behavior is to zero-pad or sign extend bits from shorter argument as determined by the signed flag to the width of the result. BV.xor(a, b) corresponds to Java's a ^ b.

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
in1 ^ in2, allows chaining or nesting of operations.

xor

public static BV xor(int width,
                     BV in1,
                     BV in2)
Returns boolean xor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
in1 ^ in2, allows chaining or nesting of operations.

xor

public static BV xor(BV in1,
                     BV in2,
                     BV out)
Changes value of out to the boolean xor of the two arguments, with original width. BV.xor(b, c, a) corresponds to Java's a = b ^ c. BV.xor(a, b, a) corresponds to Java's a ^= b.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
Returns:
out = in1 ^ in2, allows chaining or nesting of operations.

xor

public static BV xor(int width,
                     BV in1,
                     BV in2,
                     BV out)
Changes value of out to the boolean xor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
Returns:
out = in1 ^ in2, allows chaining or nesting of operations.

xor

public static BV xor(BV in1,
                     BV in2,
                     boolean sign_ext)
Returns boolean xor of the two arguments, with default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter arguments to the length of the result before xor-ing.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 ^ in2, allows chaining or nesting of operations.

xor

public static BV xor(BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns boolean xor of the two arguments, with default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter arguments to the length of the result before xor-ing.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 ^ in2, allows chaining or nesting of operations.

xor

public static BV xor(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext)
Returns boolean xor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 ^ in2, allows chaining or nesting of operations.

xor

public static BV xor(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns boolean xor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
in1 ^ in2, allows chaining or nesting of operations.

xor

public static BV xor(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the boolean xor of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 ^ in2, allows chaining or nesting of operations.

xor

public static BV xor(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the boolean xor of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 ^ in2, allows chaining or nesting of operations.

xor

public static BV xor(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the boolean xor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 ^ in2, allows chaining or nesting of operations.

xor

public static BV xor(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the boolean xor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = in1 ^ in2, allows chaining or nesting of operations.

not

public static BV not(BV in)
Returns boolean not (the inverse) of the argument, with default width. Default width for not() is the width of the argument, and default sign behavior is to zero-pad or sign extend extra bits as determined by the signed flag to make the argument as wide as the result. BV.not(a) corresponds to Java's ~a.

Parameters:
in - the argument.
Returns:
~in, allows chaining or nesting of operations.

not

public static BV not(int width,
                     BV in)
Returns boolean not of the argument, with specified width.

Parameters:
width - the width to set the result to.
in - the argument.
Returns:
~in, allows chaining or nesting of operations.

not

public static BV not(BV in,
                     BV out)
Changes value of out to the boolean not of the argument, with original width. BV.not(b, a) corresponds to Java's a = ~b.

Parameters:
in - the argument.
out - the BV to store the result in.
Returns:
out = ~in, allows chaining or nesting of operations.

not

public static BV not(int width,
                     BV in,
                     BV out)
Changes value of out to the boolean not of the argument, with specified width.

Parameters:
width - the width to set the result to.
in - the argument.
out - the BV to store the result in.
Returns:
out = ~in, allows chaining or nesting of operations.

not

public static BV not(BV in,
                     boolean sign_ext)
Returns boolean not of the argument, with default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter arguments to the length of the result before inverting.

Parameters:
in - the argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
~in, allows chaining or nesting of operations.

not

public static BV not(int width,
                     BV in,
                     boolean sign_ext)
Returns boolean not of the argument, with specified width.

Parameters:
width - the width to set the result to.
in - the argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
~in, allows chaining or nesting of operations.

not

public static BV not(BV in,
                     BV out,
                     boolean sign_ext)
Changes value of out to the boolean not of the argument, with original width.

Parameters:
in - the argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~in, allows chaining or nesting of operations.

not

public static BV not(int width,
                     BV in,
                     BV out,
                     boolean sign_ext)
Changes value of out to the boolean not of the argument, with specified width.

Parameters:
width - the width to set the result to.
in - the argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~in, allows chaining or nesting of operations.

nand

public static BV nand(BV in1,
                      BV in2)
Returns boolean nand of the two arguments, with default width. Default width for nand() is the width of the larger argument, and default sign behavior is to zero-pad or sign extend bits from shorter argument as determined from signed flag to the width of the result.

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
~(in1 & in2), allows chaining or nesting of operations.

nand

public static BV nand(int width,
                      BV in1,
                      BV in2)
Returns boolean nand of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
~(in1 & in2), allows chaining or nesting of operations.

nand

public static BV nand(BV in1,
                      BV in2,
                      BV out)
Changes value of out to the boolean nand of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
Returns:
out = ~(in1 & in2), allows chaining or nesting of operations.

nand

public static BV nand(int width,
                      BV in1,
                      BV in2,
                      BV out)
Changes value of out to the boolean nand of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
Returns:
out = ~(in1 & in2), allows chaining or nesting of operations.

nand

public static BV nand(BV in1,
                      BV in2,
                      boolean sign_ext)
Returns boolean nand of the two arguments, with default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter arguments to the length of the result before nand-ing.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
~(in1 & in2), allows chaining or nesting of operations.

nand

public static BV nand(BV in1,
                      BV in2,
                      boolean sign_ext1,
                      boolean sign_ext2)
Returns boolean nand of the two arguments, with default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter arguments to the length of the result before nand-ing.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
~(in1 & in2), allows chaining or nesting of operations.

nand

public static BV nand(int width,
                      BV in1,
                      BV in2,
                      boolean sign_ext)
Returns boolean nand of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
~(in1 & in2), allows chaining or nesting of operations.

nand

public static BV nand(int width,
                      BV in1,
                      BV in2,
                      boolean sign_ext1,
                      boolean sign_ext2)
Returns boolean nand of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
~(in1 & in2), allows chaining or nesting of operations.

nand

public static BV nand(BV in1,
                      BV in2,
                      BV out,
                      boolean sign_ext)
Changes value of out to the boolean nand of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~(in1 & in2), allows chaining or nesting of operations.

nand

public static BV nand(BV in1,
                      BV in2,
                      BV out,
                      boolean sign_ext1,
                      boolean sign_ext2)
Changes value of out to the boolean nand of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~(in1 & in2), allows chaining or nesting of operations.

nand

public static BV nand(int width,
                      BV in1,
                      BV in2,
                      BV out,
                      boolean sign_ext)
Changes value of out to the boolean nand of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~(in1 & in2), allows chaining or nesting of operations.

nand

public static BV nand(int width,
                      BV in1,
                      BV in2,
                      BV out,
                      boolean sign_ext1,
                      boolean sign_ext2)
Changes value of out to the boolean nand of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~(in1 & in2), allows chaining or nesting of operations.

nor

public static BV nor(BV in1,
                     BV in2)
Returns boolean nor of the two arguments, with default width. Default width for nor() is the width of the larger argument, and default sign behavior is to zero-pad or sign extend bits from shorter argument as determined by the signed flag to the width of the result.

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
~(in1 | in2), allows chaining or nesting of operations.

nor

public static BV nor(int width,
                     BV in1,
                     BV in2)
Returns boolean nor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
~(in1 | in2), allows chaining or nesting of operations.

nor

public static BV nor(BV in1,
                     BV in2,
                     BV out)
Changes value of out to the boolean nor of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
Returns:
out = ~(in1 | in2), allows chaining or nesting of operations.

nor

public static BV nor(int width,
                     BV in1,
                     BV in2,
                     BV out)
Changes value of out to the boolean nor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
Returns:
out = ~(in1 | in2), allows chaining or nesting of operations.

nor

public static BV nor(BV in1,
                     BV in2,
                     boolean sign_ext)
Returns boolean nor of the two arguments, with default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter arguments to the length of the result before nor-ing.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
~(in1 | in2), allows chaining or nesting of operations.

nor

public static BV nor(BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns boolean nor of the two arguments, with default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter arguments to the length of the result before nor-ing.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
~(in1 | in2), allows chaining or nesting of operations.

nor

public static BV nor(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext)
Returns boolean nor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
~(in1 | in2), allows chaining or nesting of operations.

nor

public static BV nor(int width,
                     BV in1,
                     BV in2,
                     boolean sign_ext1,
                     boolean sign_ext2)
Returns boolean nor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
~(in1 | in2), allows chaining or nesting of operations.

nor

public static BV nor(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the boolean nor of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~(in1 | in2), allows chaining or nesting of operations.

nor

public static BV nor(BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the boolean nor of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~(in1 | in2), allows chaining or nesting of operations.

nor

public static BV nor(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext)
Changes value of out to the boolean nor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~(in1 | in2), allows chaining or nesting of operations.

nor

public static BV nor(int width,
                     BV in1,
                     BV in2,
                     BV out,
                     boolean sign_ext1,
                     boolean sign_ext2)
Changes value of out to the boolean nor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~(in1 | in2), allows chaining or nesting of operations.

xnor

public static BV xnor(BV in1,
                      BV in2)
Returns boolean xnor of the two arguments, with default width. Default width for xnor() is the width of the larger argument, and default sign behavior is to zero-pad or sign extend bits from shorter argument as determined by the signed flag to the width of the result.

Parameters:
in1 - the first argument.
in2 - the second argument.
Returns:
~(in1 ^ in2), allows chaining or nesting of operations.

xnor

public static BV xnor(int width,
                      BV in1,
                      BV in2)
Returns boolean xnor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
Returns:
~(in1 ^ in2), allows chaining or nesting of operations.

xnor

public static BV xnor(BV in1,
                      BV in2,
                      BV out)
Changes value of out to the boolean xnor of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
Returns:
out = ~(in1 ^ in2), allows chaining or nesting of operations.

xnor

public static BV xnor(int width,
                      BV in1,
                      BV in2,
                      BV out)
Changes value of out to the boolean xnor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
Returns:
out = ~(in1 ^ in2), allows chaining or nesting of operations.

xnor

public static BV xnor(BV in1,
                      BV in2,
                      boolean sign_ext)
Returns boolean xnor of the two arguments, with default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter arguments to the length of the result before xnor-ing.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
~(in1 ^ in2), allows chaining or nesting of operations.

xnor

public static BV xnor(BV in1,
                      BV in2,
                      boolean sign_ext1,
                      boolean sign_ext2)
Returns boolean xnor of the two arguments, with default width. Setting sign_ext to SIGN_EXT overrides default behavior, and sign-extends shorter arguments to the length of the result before xnor-ing.

Parameters:
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
~(in1 ^ in2), allows chaining or nesting of operations.

xnor

public static BV xnor(int width,
                      BV in1,
                      BV in2,
                      boolean sign_ext)
Returns boolean xnor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
~(in1 ^ in2), allows chaining or nesting of operations.

xnor

public static BV xnor(int width,
                      BV in1,
                      BV in2,
                      boolean sign_ext1,
                      boolean sign_ext2)
Returns boolean xnor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
~(in1 ^ in2), allows chaining or nesting of operations.

xnor

public static BV xnor(BV in1,
                      BV in2,
                      BV out,
                      boolean sign_ext)
Changes value of out to the boolean xnor of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~(in1 ^ in2), allows chaining or nesting of operations.

xnor

public static BV xnor(BV in1,
                      BV in2,
                      BV out,
                      boolean sign_ext1,
                      boolean sign_ext2)
Changes value of out to the boolean xnor of the two arguments, with original width.

Parameters:
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~(in1 ^ in2), allows chaining or nesting of operations.

xnor

public static BV xnor(int width,
                      BV in1,
                      BV in2,
                      BV out,
                      boolean sign_ext)
Changes value of out to the boolean xnor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~(in1 ^ in2), allows chaining or nesting of operations.

xnor

public static BV xnor(int width,
                      BV in1,
                      BV in2,
                      BV out,
                      boolean sign_ext1,
                      boolean sign_ext2)
Changes value of out to the boolean xnor of the two arguments, with specified width.

Parameters:
width - the width to set the result to.
in1 - the first argument.
in2 - the second argument.
out - the BV to store the result in.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
out = ~(in1 ^ in2), allows chaining or nesting of operations.

shiftLeft

public static BV shiftLeft(BV in,
                           int amt)
Returns the value of the BV shifted left by amt places, with default width. Default width for shiftLeft() is the width of the BV argument, and default sign behavior is to zero-pad or sign-extend shorter arguments according to signed flag to width of the result. BV.shiftLeft(a, 1) corresponds to Java's a << 1.

Parameters:
in - the argument to shift.
amt - the number of bits to shift left by (negative amounts shift right).
Returns:
in << amt, allows chaining or nesting of operations.

shiftLeft

public static BV shiftLeft(int width,
                           BV in,
                           int amt)
Returns the value of the BV shifted left by amt places, with specified width.

Parameters:
width - the width to set the result to.
in - the argument to shift.
amt - the number of bits to shift left by (negative amounts shift right).
Returns:
in << amt, allows chaining or nesting of operations.

shiftLeft

public static BV shiftLeft(BV in,
                           int amt,
                           BV out)
Changes out to the value of in shifted left by amt places, keeping width of out. BV.shiftLeft(b, 1, a) corresponds to Java's a = b << 1. BV.shiftLeft(a, 1, a) corresponds to Java's a <<= 1.

Parameters:
in - the argument to shift.
amt - the number of bits to shift left by (negative amounts shift right).
out - the BV to store the result in.
Returns:
in << amt, allows chaining or nesting of operations.

shiftLeft

public static BV shiftLeft(int width,
                           BV in,
                           int amt,
                           BV out)
Changes out to the value of in shifted left by amt places, with specified width.

Parameters:
width - the width to set the result to.
in - the argument to shift.
amt - the number of bits to shift left by (negative amounts shift right).
out - the BV to store the result in.
Returns:
in << amt, allows chaining or nesting of operations.

shiftLeft

public static BV shiftLeft(BV in,
                           int amt,
                           boolean sign_ext)
Returns the value of the BV shifted left by amt places, with default width. Setting sign_ext to ZERO_PAD overrides default behavior, and pads zeroes to the argument to make it the width of the result before shifting.

Parameters:
in - the argument to shift.
amt - the number of bits to shift left by (negative amounts shift right).
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in << amt, allows chaining or nesting of operations.

shiftLeft

public static BV shiftLeft(int width,
                           BV in,
                           int amt,
                           boolean sign_ext)
Returns the value of the BV shifted left by amt places, with specified width.

Parameters:
width - the width to set the result to.
in - the argument to shift.
amt - the number of bits to shift left by (negative amounts shift right).
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in << amt, allows chaining or nesting of operations.

shiftLeft

public static BV shiftLeft(BV in,
                           int amt,
                           BV out,
                           boolean sign_ext)
Changes out to the value of in shifted left by amt places, keeping width of out.

Parameters:
in - the argument to shift.
amt - the number of bits to shift left by (negative amounts shift right).
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in << amt, allows chaining or nesting of operations.

shiftLeft

public static BV shiftLeft(int width,
                           BV in,
                           int amt,
                           BV out,
                           boolean sign_ext)
Changes out to the value of in shifted left by amt places, with specified width.

Parameters:
width - the width to set the result to.
in - the argument to shift.
amt - the number of bits to shift left by (negative amounts shift right).
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in << amt, allows chaining or nesting of operations.

shiftRight

public static BV shiftRight(BV in,
                            int amt)
Returns the value of the BV shifted right by amt places, with default width. Default width for shiftRight() is the width of the BV argument, and default sign behavior is to zero-pad or sign-extend while shifting as determined by the signed flag. BV.shiftRight(a, 1) corresponds to Java's a >> 1.

Parameters:
in - the argument to shift.
amt - the number of bits to shift right by (negative amounts shift left).
Returns:
in >> amt, allows chaining or nesting of operations.

shiftRight

public static BV shiftRight(int width,
                            BV in,
                            int amt)
Returns the value of the BV shifted right by amt places, with specified width.

Parameters:
width - the width to set the result to.
in - the argument to shift.
amt - the number of bits to shift right by (negative amounts shift left).
Returns:
in >> amt, allows chaining or nesting of operations.

shiftRight

public static BV shiftRight(BV in,
                            int amt,
                            BV out)
Changes out to the value of in shifted right by amt places, keeping width of out. BV.shiftRight(b, 1, a) corresponds to Java's a = b >> 1. BV.shiftRight(a, 1, a) corresponds to Java's a >>= 1.

Parameters:
in - the argument to shift.
amt - the number of bits to shift right by (negative amounts shift left).
out - the BV to store the result in.
Returns:
in >> amt, allows chaining or nesting of operations.

shiftRight

public static BV shiftRight(int width,
                            BV in,
                            int amt,
                            BV out)
Changes out to the value of in shifted right by amt places, with specified width.

Parameters:
width - the width to set the result to.
in - the argument to shift.
amt - the number of bits to shift right by (negative amounts shift left).
out - the BV to store the result in.
Returns:
in >> amt, allows chaining or nesting of operations.

shiftRight

public static BV shiftRight(BV in,
                            int amt,
                            boolean sign_ext)
Returns the value of the BV shifted right by amt places, with default width. Setting sign_ext to ZERO_PAD overrides default behavior, and both zero pads a shorter argument to the width of the result, and shifts in zeroes. BV.shiftRight(a, 1, ZERO_PAD) corresponds to Java's a >>> 1.

Parameters:
in - the argument to shift.
amt - the number of bits to shift right by (negative amounts shift left).
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in >> amt, allows chaining or nesting of operations.

shiftRight

public static BV shiftRight(int width,
                            BV in,
                            int amt,
                            boolean sign_ext)
Returns the value of the BV shifted right by amt places, with specified width.

Parameters:
width - the width to set the result to.
in - the argument to shift.
amt - the number of bits to shift right by (negative amounts shift left).
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in >> amt, allows chaining or nesting of operations.

shiftRight

public static BV shiftRight(BV in,
                            int amt,
                            BV out,
                            boolean sign_ext)
Changes out to the value of in shifted right by amt places, keeping width of out. BV.shiftRight(b, 1, a, ZERO_PAD) corresponds to Java's a = b >>> 1. BV.shiftRight(a, 1, a, ZERO_PAD) corresponds to Java's a >>>= 1.

Parameters:
in - the argument to shift.
amt - the number of bits to shift right by (negative amounts shift left).
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in >> amt, allows chaining or nesting of operations.

shiftRight

public static BV shiftRight(int width,
                            BV in,
                            int amt,
                            BV out,
                            boolean sign_ext)
Changes out to the value of in shifted right by amt places, with specified width.

Parameters:
width - the width to set the result to.
in - the argument to shift.
amt - the number of bits to shift right by (negative amounts shift left).
out - the BV to store the result in.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
in >> amt, allows chaining or nesting of operations.

barrelShiftLeft

public static BV barrelShiftLeft(BV in,
                                 int amt)
Barrel shifts the BV left (moves bits from left end to the right) by amt places.

Parameters:
in - the argument to barrel shift.
amt - the number of bits to shift left by (negative amounts shift right).
Returns:
in << amt | in >>> (width - amt), allows chaining or nesting of operations.

barrelShiftLeft

public static BV barrelShiftLeft(BV in,
                                 int amt,
                                 BV out)
Barrel shifts the BV left (moves bits from left end to the right) by amt places.

Parameters:
in - the argument to barrel shift.
amt - the number of bits to shift left by (negative amounts shift right).
out - the BV to store the result in, must be same width as in.
Returns:
in << amt | in >>> (width - amt), allows chaining or nesting of operations.
Throws:
BVException - if in.width() != out.width().

barrelShiftRight

public static BV barrelShiftRight(BV in,
                                  int amt)
Barrel shifts the BV right (moves bits from right end to the left) by amt places.

Parameters:
in - the argument to barrel shift.
amt - the number of bits to shift right by (negative amounts shift left).
Returns:
in >>> amt | in << (width - amt), allows chaining or nesting of operations.

barrelShiftRight

public static BV barrelShiftRight(BV in,
                                  int amt,
                                  BV out)
Barrel shifts the BV right (moves bits from right end to the left) by amt places.

Parameters:
in - the argument to barrel shift.
amt - the number of bits to shift right by (negative amounts shift left).
out - the BV to store the result in, must be same width as in.
Returns:
in >>> amt | in << (width - amt), allows chaining or nesting of operations.
Throws:
BVException - if in.width() != out.width().

reverse

public static BV reverse(BV in)
Reverses the order of the bits from most to least significant.

Parameters:
in - The BV to reverse.
Returns:
A new BV with the value reversed from in.

reverse

public static BV reverse(BV in,
                         BV out)
Reverses the order of the bits from most to least significant.

Parameters:
in - The BV to reverse.
out - The BV to store the results in.
Returns:
out, with the value set to the reverse of in.
Throws:
BVException - if in.width() != out.width().

negative

public boolean negative()
Returns true if negative when interpreted as a 2's-complement number if signed flag set, otherwise returns false.

Returns:
true if msb is 1 and signed flag = SIGN_EXT, false if msb is 0.

negative

public boolean negative(boolean is_Signed)
Returns true if negative when interpreted as a 2's-complement number, otherwise returns false.

Parameters:
is_Signed - SIGN_EXT or ZERO_PAD
Returns:
true if msb is 1, false if msb is 0.

negative

public static boolean negative(BV bv)
Returns true if negative when interpreted as a 2's-complement number if signed flag set, otherwise returns false.

Parameters:
bv - the BV to test.
Returns:
true if msb is 1 and signed flag = SIGN_EXT, false if msb is 0.

positive

public boolean positive()
Returns true if positive when interpreted as a 2's-complement number.

Returns:
true if msb is 0 and at least one other bit is 1, false if msb is 1 or value is 0.

positive

public boolean positive(boolean is_Signed)
Returns true if positive when interpreted as a 2's-complement number.

Parameters:
is_Signed - SIGN_EXT or ZERO_PAD
Returns:
true if msb is 0 and at least one other bit is 1, false if msb is 1 or value is 0.

positive

public static boolean positive(BV bv)
Returns true if positive when interpreted as a 2's-complement number.

Parameters:
bv - the BV to test.
Returns:
true if msb is 0 and at least one other bit is 1, false if msb is 1 or value is 0.

zero

public boolean zero()
Returns true if the value is 0.

Returns:
true iff every bit is 0.

zero

public static boolean zero(BV bv)
Returns true if the value is 0.

Parameters:
bv - the BV to test.
Returns:
true iff every bit is 0.

signum

public int signum()
Returns the signum of the value.

Returns:
-1 if value is negative, 0 if zero, 1 if positive.

signum

public static int signum(BV bv)
Returns the signum of the value.

Parameters:
bv - the BV to test.
Returns:
-1 if value is negative, 0 if zero, 1 if positive.

compare

public int compare(BV bv2)
Returns integer representing relation between two bit vectors, default is sign extension if signed flag is set.

Parameters:
bv2 - the right hand argument in comparison. (this is left hand argument).
Returns:
-1 if left hand argument less than right, 0 if equal, 1 if greater than.

compare

public static int compare(BV bv1,
                          BV bv2)
Returns integer representing relation between two bit vectors, default of sign extension.

Parameters:
bv1 - the left hand argument in comparison.
bv2 - the right hand argument in comparison.
Returns:
-1 if left hand argument less than right, 0 if equal, 1 if greater than.

compare

public int compare(BV bv2,
                   boolean sign_ext)
Returns integer representing relation between two bit vectors, according to sign_ext. For this the signed flag is used to determine sign extension or zero padding.

Parameters:
bv2 - the right hand argument in comparison. (this is left hand argument).
sign_ext - Either ZERO_PAD or SIGN_EXT used for bv2.
Returns:
-1 if left hand argument less than right, 0 if equal, 1 if greater than.

compare

public static int compare(BV bv1,
                          BV bv2,
                          boolean sign_ext)
Returns integer representing relation between two bit vectors, according to sign_ext.

Parameters:
bv1 - the left hand argument in comparison.
bv2 - the right hand argument in comparison.
sign_ext - Either ZERO_PAD or SIGN_EXT, used for bv1 and bv2.
Returns:
-1 if left hand argument less than right, 0 if equal, 1 if greater than.

compare

public static int compare(BV bv1,
                          BV bv2,
                          boolean sign_ext1,
                          boolean sign_ext2)
Returns integer representing relation between two bit vectors, according to sign_ext.

Parameters:
bv1 - the left hand argument in comparison.
bv2 - the right hand argument in comparison.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
-1 if left hand argument less than right, 0 if equal, 1 if greater than.

equals

public boolean equals(java.lang.Object obj)
Returns true iff obj is equivalent to this. Works with hashCode()

Parameters:
obj - Object to compare.
Returns:
true iff obj is equivalent.

hashCode

public int hashCode()
Returns a hash of this. Works with equals(Object)

Returns:
a hashCode for this, guaranteed to be the same for two objects that satisfy equals().

lt

public boolean lt(BV bv2)
Returns true iff this < bv2. Defaults to following the signed flag for comparison.

Parameters:
bv2 - the second argument of comparison (the first is this).
Returns:
true if less than relation holds.

lt

public boolean lt(BV bv2,
                  boolean sign_ext)
Returns true iff this < bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT. For this it uses the signed flag.

Parameters:
bv2 - the second argument of comparison (the first is this).
sign_ext - Either ZERO_PAD or SIGN_EXT used for bv2.
Returns:
true if less than relation holds.

lt

public static boolean lt(BV bv1,
                         BV bv2)
Returns true iff bv1 < bv2. Defaults to following signed flags for comparison.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
Returns:
true if less than relation holds.

lt

public static boolean lt(BV bv1,
                         BV bv2,
                         boolean sign_ext)
Returns true iff bv1 < bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
sign_ext - Either ZERO_PAD or SIGN_EXT used for both bv1 and bv2.
Returns:
true if less than relation holds.

lt

public static boolean lt(BV bv1,
                         BV bv2,
                         boolean sign_ext1,
                         boolean sign_ext2)
Returns true iff bv1 < bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
true if less than relation holds.

gt

public boolean gt(BV bv2)
Returns true iff this > bv2. Defaults to signed comparison if signed flag is set.

Parameters:
bv2 - the second argument of comparison (the first is this).
Returns:
true if greater than relation holds.

gt

public boolean gt(BV bv2,
                  boolean sign_ext)
Returns true iff this > bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT.

Parameters:
bv2 - the second argument of comparison (the first is this).
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
true if greater than relation holds.

gt

public static boolean gt(BV bv1,
                         BV bv2)
Returns true iff bv1 > bv2. Defaults to following signed flags.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
Returns:
true if greater than relation holds.

gt

public static boolean gt(BV bv1,
                         BV bv2,
                         boolean sign_ext)
Returns true iff bv1 > bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
true if greater than relation holds.

gt

public static boolean gt(BV bv1,
                         BV bv2,
                         boolean sign_ext1,
                         boolean sign_ext2)
Returns true iff bv1 > bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
true if greater than relation holds.

lteq

public boolean lteq(BV bv2)
Returns true iff this <= bv2. Defaults to following the signed flags.

Parameters:
bv2 - the second argument of comparison (the first is this).
Returns:
true if less than or equal relation holds.

lteq

public boolean lteq(BV bv2,
                    boolean sign_ext)
Returns true iff this <= bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT. For this it uses the signed flag.

Parameters:
bv2 - the second argument of comparison (the first is this).
sign_ext - Either ZERO_PAD or SIGN_EXT used for bv2.
Returns:
true if less than or equal relation holds.

lteq

public static boolean lteq(BV bv1,
                           BV bv2)
Returns true iff bv1 <= bv2. Defaults to signed comparison.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
Returns:
true if less than or equal relation holds.

lteq

public static boolean lteq(BV bv1,
                           BV bv2,
                           boolean sign_ext)
Returns true iff bv1 <= bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
sign_ext - Either ZERO_PAD or SIGN_EXT used for both arguments.
Returns:
true if less than or equal relation holds.

lteq

public static boolean lteq(BV bv1,
                           BV bv2,
                           boolean sign_ext1,
                           boolean sign_ext2)
Returns true iff bv1 <= bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
sign_ext1 - Either ZERO_PAD or SIGN_EXT used for first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT used for second argument.
Returns:
true if less than or equal relation holds.

gteq

public boolean gteq(BV bv2)
Returns true iff this >= bv2. Defaults to following signed flag.

Parameters:
bv2 - the second argument of comparison (the first is this).
Returns:
true if greater than or equal relation holds.

gteq

public boolean gteq(BV bv2,
                    boolean sign_ext)
Returns true iff this >= bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT. For this it uses the signed flag.

Parameters:
bv2 - the second argument of comparison (the first is this).
sign_ext - Either ZERO_PAD or SIGN_EXT used for bv2.
Returns:
true if greater than or equal relation holds.

gteq

public static boolean gteq(BV bv1,
                           BV bv2)
Returns true iff bv1 >= bv2. Defaults to signed comparison.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
Returns:
true if greater than or equal relation holds.

gteq

public static boolean gteq(BV bv1,
                           BV bv2,
                           boolean sign_ext)
Returns true iff bv1 >= bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
true if greater than or equal relation holds.

gteq

public static boolean gteq(BV bv1,
                           BV bv2,
                           boolean sign_ext1,
                           boolean sign_ext2)
Returns true iff bv1 >= bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
sign_ext1 - Either ZERO_PAD or SIGN_EXT for the first argument.
sign_ext2 - Either ZERO_PAD or SIGN_EXT for the second argument.
Returns:
true if greater than or equal relation holds.

eq

public boolean eq(BV bv2)
Returns true iff this == bv2. Defaults to signed comparison.

Parameters:
bv2 - the second argument of comparison (the first is this).
Returns:
true if equal relation holds.

eq

public boolean eq(BV bv2,
                  boolean sign_ext)
Returns true iff this == bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT. For this it uses the signed flag.

Parameters:
bv2 - the second argument of comparison (the first is this).
sign_ext - Either ZERO_PAD or SIGN_EXT used for bv2.
Returns:
true if equal relation holds.

eq

public static boolean eq(BV bv1,
                         BV bv2)
Returns true iff bv1 == bv2. Defaults to following signed flag.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
Returns:
true if equal relation holds.

eq

public static boolean eq(BV bv1,
                         BV bv2,
                         boolean sign_ext)
Returns true iff bv1 == bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
true if equal relation holds.

eq

public static boolean eq(BV bv1,
                         BV bv2,
                         boolean sign_ext1,
                         boolean sign_ext2)
Returns true iff bv1 == bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
true if equal relation holds.

neq

public boolean neq(BV bv2)
Returns true iff this != bv2. Defaults to following signed flags.

Parameters:
bv2 - the second argument of comparison (the first is this).
Returns:
true if not equal relation holds.

neq

public boolean neq(BV bv2,
                   boolean sign_ext)
Returns true iff this != bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT. For this it uses the signed flag.

Parameters:
bv2 - the second argument of comparison (the first is this).
sign_ext - Either ZERO_PAD or SIGN_EXT used for bv2.
Returns:
true if not equal relation holds.

neq

public static boolean neq(BV bv1,
                          BV bv2)
Returns true iff bv1 != bv2. Defaults to signed comparison.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
Returns:
true if not equal relation holds.

neq

public static boolean neq(BV bv1,
                          BV bv2,
                          boolean sign_ext)
Returns true iff bv1 != bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
true if not equal relation holds.

neq

public static boolean neq(BV bv1,
                          BV bv2,
                          boolean sign_ext1,
                          boolean sign_ext2)
Returns true iff bv1 != bv2. Unsigned comparison with ZERO_PAD, signed with SIGN_EXT.

Parameters:
bv1 - the first argument of comparison.
bv2 - the second argument of comparison.
sign_ext1 - Either ZERO_PAD or SIGN_EXT.
sign_ext2 - Either ZERO_PAD or SIGN_EXT.
Returns:
true if not equal relation holds.

getWidth

public int getWidth()
Retrieves the width of the BV.

Returns:
the width.

getIsSigned

public boolean getIsSigned()
Retrieves the current status of the signed flag of the BV.

Returns:
if signed (SIGN_EXT) or unsigned (ZERO_PAD).

getBit

public boolean getBit(int pos)
Returns value of bit in given position.

Parameters:
pos - the position of the bit.
Returns:
true if the bit at that position is 1, false if it is 0.
Throws:
BVException - if pos is invalid.

setBit

public BV setBit(int pos)
Sets value of bit in given position to 1.

Parameters:
pos - the position of the bit.
Returns:
the updated BV, allows chaining or nesting of operations.
Throws:
BVException - if pos is invalid.

setIsSigned

public BV setIsSigned(boolean is_signed)
Sets value of signed flag of the BV.

Parameters:
is_signed - the value to set the signed flag to. Signed (SIGN_EXT) or unsigned (ZERO_PAD) .
Returns:
the updated BV, allows chaining or nesting of operations.

setBit

public BV setBit(int pos,
                 boolean value)
Sets value of bit in given position to 1 if value is true, to 0 if value is false.

Parameters:
pos - the position of the bit.
value - the value to set the bit to.
Returns:
the updated BV, allows chaining or nesting of operations.
Throws:
BVException - if pos is invalid.

setBits

public BV setBits(int upper,
                  int lower)
Sets value of a range of bits to 1.

Parameters:
upper - the upper boundary of the range, inclusive.
lower - the lower boundary of the range, inclusive.
Returns:
the updated BV, allows chaining or nesting of operations.
Throws:
BVException - if either limit is invalid.

setBits

public BV setBits(int upper,
                  int lower,
                  boolean value)
Sets value of a range of bits to 1 if value is true, to 0 if value is false.

Parameters:
upper - the upper boundary of the range, inclusive.
lower - the lower boundary of the range, inclusive.
value - the value to set the bits to.
Returns:
the updated BV, allows chaining or nesting of operations.
Throws:
BVException - if either limit is invalid.

clearBit

public BV clearBit(int pos)
Clears value of bit in given position to 0.

Parameters:
pos - the position of the bit.
Returns:
the updated BV, allows chaining or nesting of operations.
Throws:
BVException - if pos is invalid.

clearBits

public BV clearBits(int upper,
                    int lower)
Clears value of a range of bits to 0.

Parameters:
upper - the upper boundary of the range, inclusive.
lower - the lower boundary of the range, inclusive.
Returns:
the updated BV, allows chaining or nesting of operations.
Throws:
BVException - if either limit is invalid.

toggleBit

public BV toggleBit(int pos)
Toggles value of bit in given position between 1 and 0, and returns its new value.

Parameters:
pos - the position of the bit.
Returns:
the updated BV, allows chaining or nesting of operations.
Throws:
BVException - if pos is invalid.

toggleBits

public BV toggleBits(int upper,
                     int lower)
Toggles value of each bit in a range between 1 and 0.

Parameters:
upper - the upper boundary of the range, inclusive.
lower - the lower boundary of the range, inclusive.
Returns:
the updated BV, allows chaining or nesting of operations.
Throws:
BVException - if either limit is invalid.

setRange

public BV setRange(int lower,
                   BV in)
Sets the range of the BV starting at lower to the value of the argument, stopping at either the most significant bit of the argument or the instance.

Parameters:
lower - the lower boundary of the range, inclusive.
in - BV containing the bits to insert at the range.
Returns:
the updated BV, with the value of in inserted starting from the lower bit position.
Throws:
BVException - if lower is invalid.

setRange

public BV setRange(int upper,
                   int lower,
                   BV in)
Sets the given range of the BV to the value of the argument, taking the least significant portion of the argument or extending it according to the signed flag as needed.

Parameters:
upper - the upper boundary of the range, inclusive.
lower - the lower boundary of the range, inclusive.
in - BV containing the bits to insert at the range.
Returns:
the updated BV, with the value of in inserted from the lower to upper bit positions.
Throws:
BVException - if either limit is invalid.

setRange

public BV setRange(int upper,
                   int lower,
                   BV in,
                   boolean sign_ext)
Sets the given range of the BV to the value of the argument, taking the least significant portion of the argument or extending it according to sign_ext as needed.

Parameters:
upper - the upper boundary of the range, inclusive.
lower - the lower boundary of the range, inclusive.
in - BV containing the bits to insert at the range.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
the updated BV, with the value of in inserted from the lower to upper bit positions.
Throws:
BVException - if either limit is invalid.

lowerBits

public BV lowerBits(int amount)
Returns a BV that has the present value and width of the specified amount of the least significant bits of this. Returned BV has signed flag set to ZERO_PAD.

Parameters:
amount - the amount of least significant bits to use.
Returns:
a new BV from the lower bits.
Throws:
BVException - if amount is out of range.

lowerBits

public BV lowerBits(int amount,
                    BV out)
Changes given BV to have the present value and width of the specified amount of the least significant bits of this.

Parameters:
amount - the amount of least significant bits to use.
out - the location to store the result.
Returns:
out modified to be the width and value of the lower bits.
Throws:
BVException - if amount is out of range.

upperBits

public BV upperBits(int amount)
Returns a BV that has the present value and width of the specified amount of the most significant bits of this. Returned BV has signed flag set to ZERO_PAD.

Parameters:
amount - the amount of most significant bits to use.
Returns:
a new BV from the upper bits.
Throws:
BVException - if amount is out of range.

upperBits

public BV upperBits(int amount,
                    BV out)
Changes given BV to have the present value and width of the specified amount of the most significant bits of this.

Parameters:
amount - the amount of most significant bits to use.
out - the location to store the result.
Returns:
out modified to be the width and value of the upper bits.
Throws:
BVException - if amount is out of range.

range

public BV range(int upper,
                int lower)
Returns a BV that has the present value of the specified range of this.

Parameters:
upper - the upper boundary of the range, inclusive.
lower - the lower boundary of the range, inclusive.
Returns:
a new BV from the specified bits.
Throws:
BVException - if either range argument is invalid.

range

public BV range(int upper,
                int lower,
                BV out)
Returns a BV that has the present value of the specified range of this.

Parameters:
upper - the upper boundary of the range, inclusive.
lower - the lower boundary of the range, inclusive.
out - the location to store the result.
Returns:
out modified to the value of the lower bits.
Throws:
BVException - if either range argument is invalid.

getMSBOn

public int getMSBOn()
Returns the position of the first non-zero bit, starting from the most significant position. If the value is 0, returns -1.

Returns:
position of first non-zero bit, or -1.

getMSBOn

public static int getMSBOn(BV bv)
Returns the position of the first non-zero bit, starting from the most significant position. If the value is 0, returns -1.

Parameters:
bv - the BV to evaluate
Returns:
position of first non-zero bit, or -1.

getMSBOff

public int getMSBOff()
Returns the position of the first zero bit, starting from the most significant position. If the value is all 1's, returns -1.

Returns:
position of first zero bit, or -1.

getMSBOff

public static int getMSBOff(BV bv)
Returns the position of the first zero bit, starting from the most significant position. If the value is all 1's, returns -1.

Parameters:
bv - the BV to evaluate
Returns:
position of first zero bit, or -1.

getLSBOn

public int getLSBOn()
Returns the position of the first non-zero bit, starting from the least significant position. If the value is 0, returns -1.

Returns:
position of first non-zero bit, or -1.

getLSBOn

public static int getLSBOn(BV bv)
Returns the position of the first non-zero bit, starting from the least significant position. If the value is 0, returns -1.

Parameters:
bv - the BV to evaluate
Returns:
position of first non-zero bit, or -1.

getLSBOff

public int getLSBOff()
Returns the position of the first zero bit, starting from the least significant position. If the value is all 1's, returns -1.

Returns:
position of first zero bit, or -1.

getLSBOff

public static int getLSBOff(BV bv)
Returns the position of the first zero bit, starting from the least significant position. If the value is all 1's, returns -1.

Parameters:
bv - the BV to evaluate
Returns:
position of first zero bit, or -1.

getOnCount

public int getOnCount()
Returns a count of the number of bits that are currently 1.

Returns:
The count of bits that are on.

getOnCount

public static int getOnCount(BV bv)
Returns a count of the number of bits that are currently 1.

Parameters:
bv - The BV to count.
Returns:
The count of bits that are on.

getOffCount

public int getOffCount()
Returns a count of the number of bits that are currently 0.

Returns:
The count of bits that are off.

getOffCount

public static int getOffCount(BV bv)
Returns a count of the number of bits that are currently 0.

Parameters:
bv - The BV to count.
Returns:
The count of bits that are off.

clone

public java.lang.Object clone()
Returns a clone of this. Overrides Object.clone().

Returns:
a copy of this.

stringBitWidth

public static int stringBitWidth(java.lang.String str)
Returns the width that DETERMINE_FROM_STRING will use for the given string

Parameters:
str - the string to determine bit width from
Returns:
the number of bits the string occupies
Throws:
java.lang.NumberFormatException - if the string cannot be parsed as a valid number

stringBitWidth

public static int stringBitWidth(java.lang.String str,
                                 boolean ignore_zeroes)
Returns the number of bits needed to represent the given string If ignore_zeroes is false, this is equivalent to the width using DETERMINE_FROM_STRING in the constructor; if true, it is the position of the first non-zero bit

Parameters:
str - the string to determine bit width from
ignore_zeroes - false for entire width of string, true for position of first non-zero bit
Returns:
the number of bits the string occupies
Throws:
java.lang.NumberFormatException - if the string cannot be parsed as a valid number

byteValue

public byte byteValue()
Returns the least significant 8 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.

Returns:
the least significant byte of the BV.

shortValue

public short shortValue()
Returns the least significant 16 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.

Returns:
the least significant short of the BV.

intValue

public int intValue()
Returns the least significant 32 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.

Returns:
the least significant int of the BV.

longValue

public long longValue()
Returns the least significant 64 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.

Returns:
the least significant long of the BV.

floatValue

public float floatValue()
Returns the closest float to the integral value of the BV.

Returns:
the float representation of the BV.

doubleValue

public double doubleValue()
Returns the closest double to the integral value of the BV.

Returns:
the double representation of the BV.

toBoolean

public boolean toBoolean()
Returns true if the BV is non-zero.

Returns:
true if the BV is non-zero.

toByte

public byte toByte()
Returns the least significant 8 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.

Returns:
the least significant byte of the BV.

toByte

public byte toByte(boolean sign_ext)
Returns the least significant 8 bits of the BV, with appropriate sign extension.

Parameters:
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
the least significant byte of the BV.

toChar

public char toChar()
Returns the least significant 16 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.

Returns:
the least significant char of the BV.

toChar

public char toChar(boolean sign_ext)
Returns the least significant 16 bits of the BV, with appropriate sign extension.

Parameters:
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
the least significant char of the BV.

toShort

public short toShort()
Returns the least significant 16 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.

Returns:
the least significant short of the BV.

toShort

public short toShort(boolean sign_ext)
Returns the least significant 16 bits of the BV, with appropriate sign extension.

Parameters:
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
the least significant short of the BV.

toInt

public int toInt()
Returns the least significant 32 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.

Returns:
the least significant integer of the BV.

toInt

public int toInt(boolean sign_ext)
Returns the least significant 32 bits of the BV, with appropriate sign extension.

Parameters:
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
the least significant integer of the BV.

toLong

public long toLong()
Returns the least significant 64 bits of the BV, zero-padded or sign-extended if needed as indicated by the signed flag.

Returns:
the least significant long of the BV.

toLong

public long toLong(boolean sign_ext)
Returns the least significant 64 bits of the BV, with appropriate sign extension.

Parameters:
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
the least significant long of the BV.

toArray

public int[] toArray()
Returns the value as a low-endian int[] (ie. bits 0-31 in array[0]), with zero padding or sign-extended as indicated by the signed flag.

Returns:
the value of the BV.

toArray

public int[] toArray(boolean sign_ext)
Returns the value as an int[] (ie. bits 0-31 in array[0]), with appropriate sign extension.

Parameters:
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
the value of the BV.

toBVArray

public BV[] toBVArray(int bv_size)
Returns the value as a low-endian BV[] (ie. bits 0-bv_size in array[0]), with zero padding or sign-extended as indicated by the signed flag.

Parameters:
bv_size - The size of each BV in the new array.
Returns:
the value of the BV.

toBVArray

public BV[] toBVArray(int bv_size,
                      boolean sign_ext)
Returns the value as an BV[] (ie. bits 0-bv_size in array[0]), with appropriate sign extension.

Parameters:
bv_size - The size of each BV in the new array.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
the value of the BV.

toBigInteger

public java.math.BigInteger toBigInteger()
Returns the value as a BigInteger, with zero padding or sign-extended as indicated by the signed flag.

Returns:
the value of the BV.

toBigInteger

public java.math.BigInteger toBigInteger(boolean sign_ext)
Returns the value as a BigInteger, with appropriate sign extension.

Parameters:
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
the value of the BV.

toBinaryString

public java.lang.String toBinaryString()
Returns value of BV as a straight binary string, no leading 0's.

Returns:
the value of the BV.

toBinaryString

public java.lang.String toBinaryString(boolean print_leading_zeroes)
Returns value of BV as a straight binary string, with leading 0's iff flag is true.

Parameters:
print_leading_zeroes - whether or not to print leading 0's.
Returns:
the value of the BV.

toHexString

public java.lang.String toHexString()
Returns value of BV as a straight hexadecimal string, with leading 0's iff signed flag is set.

Returns:
the value of the BV.

toHexString

public java.lang.String toHexString(boolean print_leading_zeroes)
Returns value of BV as a straight hexadecimal string, with leading 0's iff flag is true.

Parameters:
print_leading_zeroes - whether or not to print leading 0's.
Returns:
the value of the BV.

toDecimalString

public java.lang.String toDecimalString()
Returns value of BV interpreted as a 2's-complement number iff signed flag is set.

Returns:
the value of the BV.

toDecimalString

public java.lang.String toDecimalString(boolean signed)
Returns value of BV as a decimal string, no leading 0's, interpreted as a 2's-complement number iff flag is true.

Parameters:
signed - whether or not to interpret the value as being signed.
Returns:
the value of the BV.

toString

public java.lang.String toString()
Displays a BV as "(width bits)0xvalue", where value is in hexadecimal, and separated by spaces every 8 characters for legibility. Useful in debugging.

Returns:
a String representing the BV.

toString

public java.lang.String toString(int radix)
Returns value of BV as a string of specified radix. This method always assumes unsigned numbers.

Parameters:
radix - radix in which to display the number. BV accepts built-in values of 2,10 and 16. It will also use the BigInteger class to create strings for radices to 36. Anything over 36 is not supported.
Returns:
the value of the BV in the specified radix.

initWidth

protected boolean initWidth(int width)

verify

protected boolean verify()

initFromString

protected BV initFromString(int width,
                            java.lang.String value,
                            boolean sign_ext)

main

public static void main(java.lang.String[] argv)


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.