|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
byucc.jhdl.base.BV
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.
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.
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.
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.
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.
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.
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.
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.
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 |
protected int width
protected int[] value
#fixExtraBits(boolean)
protected boolean is_signed
public static final boolean ZERO_PAD
public static final boolean SIGN_EXT
public static final int DETERMINE_FROM_STRING
public static final boolean UNSIGNED
public static final boolean SIGNED
protected static final int BYTE_MASK
protected static final int SHORT_MASK
protected static final long INT_MASK
Constructor Detail |
public BV()
public BV(int width)
width
- The width of the vector.public BV(Wire w)
w
- The wire to determine width from.public BV(int width, boolean value)
width
- The width of the vector.value
- The value of the vector.public BV(int width, boolean value, boolean sign_ext)
width
- The width of the vector.value
- The value of the vector.sign_ext
- Either ZERO_PAD or SIGN_EXT.public BV(int width, byte value)
width
- The width of the vector.value
- Up to 8 bits of the vector.public BV(int width, byte value, boolean sign_ext)
width
- The width of the vector.value
- Up to 8 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.public BV(int width, char value)
width
- The width of the vector.value
- Up to 16 bits of the value.public BV(int width, char value, boolean sign_ext)
width
- The width of the vector.value
- Up to 16 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.public BV(int width, short value)
width
- The width of the vector.value
- Up to 16 bits of the value.public BV(int width, short value, boolean sign_ext)
width
- The width of the vector.value
- Up to 16 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.public BV(int width, int value)
width
- The width of the vector.value
- Up to 32 bits of the value.public BV(int width, int value, boolean sign_ext)
width
- The width of the vector.value
- Up to 32 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.public BV(int width, long value)
width
- The width of the vector.value
- Up to 64 bits of the value.public BV(int width, long value, boolean sign_ext)
width
- The width of the vector.value
- Up to 64 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.public BV(int width, int[] value)
width
- The width of the vector.value
- An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).public BV(int width, int[] value, boolean sign_ext)
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.public BV(BV vector)
vector
- The original BV.public BV(BV bv1, BV bv2)
bv1
- The least significant bits.bv2
- The next bits.public BV(BV bv1, BV bv2, BV bv3)
bv1
- The least significant bits.bv2
- The next bits.bv3
- The next bits.public BV(BV bv1, BV bv2, BV bv3, BV bv4)
bv1
- The least significant bits.bv2
- The next bits.bv3
- The next bits.bv4
- The next bits.public BV(BV[] bv_array)
bv_array
- The array of BVs, least significant bits in slot 0.
BVException
- if the array contains only null pointers.public BV(int width, BV vector)
width
- The width of the new vector.vector
- Original BV.public BV(int width, BV vector, boolean sign_ext)
width
- The width of the new vector.vector
- Original BV.sign_ext
- Either ZERO_PAD or SIGN_EXT.public BV(java.lang.String value)
value
- The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
java.lang.NumberFormatException
- if the string cannot be parsed as a valid numberpublic BV(int width, java.lang.String value)
width
- The width of the new vector.value
- The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
java.lang.NumberFormatException
- if the string cannot be parsed as a valid numberpublic BV(int width, java.lang.String value, boolean sign_ext)
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.
java.lang.NumberFormatException
- if the string cannot be parsed as a valid numberpublic BV(java.math.BigInteger value)
value
- The BigInteger to parse.public BV(int width, java.math.BigInteger value)
width
- The width of the new vector.value
- The BigInteger to parse.public BV(int width, java.math.BigInteger value, boolean sign_ext)
width
- The width of the new vector.value
- The String to parse.sign_ext
- Either ZERO_PAD or SIGN_EXT.Method Detail |
public BV setValue(boolean value)
value
- The value of the vector.
public BV setValue(boolean value, boolean sign_ext)
value
- The value of the vector.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(int width, boolean value, boolean sign_ext)
width
- New width of BV.value
- The value of the vector.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(byte value)
value
- Up to 8 bits of the vector.
public BV setValue(byte value, boolean sign_ext)
value
- Up to 8 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(int width, byte value)
width
- New width of BV.value
- Up to 8 bits of the value.
public BV setValue(int width, byte value, boolean sign_ext)
width
- New width of BV.value
- Up to 8 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(char value)
value
- Up to 16 bits of the value.
public BV setValue(char value, boolean sign_ext)
value
- Up to 16 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(int width, char value)
width
- New width of BV.value
- Up to 16 bits of the value.
public BV setValue(int width, char value, boolean sign_ext)
width
- New width of BV.value
- Up to 16 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(short value)
value
- Up to 16 bits of the value.
public BV setValue(short value, boolean sign_ext)
value
- Up to 16 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(int width, short value)
width
- New width of BV.value
- Up to 16 bits of the value.
public BV setValue(int width, short value, boolean sign_ext)
width
- New width of BV.value
- Up to 16 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(int value)
value
- Up to 32 bits of the value.
public BV setValue(int value, boolean sign_ext)
value
- Up to 32 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(int width, int value)
width
- New width of BV.value
- Up to 32 bits of the value.
public BV setValue(int width, int value, boolean sign_ext)
width
- New width of BV.value
- Up to 32 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(long value)
value
- Up to 64 bits of the value.
public BV setValue(long value, boolean sign_ext)
value
- Up to 64 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(int width, long value)
width
- New width of BV.value
- Up to 64 bits of the value.
public BV setValue(int width, long value, boolean sign_ext)
width
- New width of BV.value
- Up to 64 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(int[] value)
value
- An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).
public BV setValue(int[] value, boolean sign_ext)
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.
public BV setValue(int width, int[] value)
width
- New width of BV.value
- An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).
public BV setValue(int width, int[] value, boolean sign_ext)
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.
public BV setValue(BV vector)
vector
- Original BV.
public BV setValue(BV bv1, BV bv2)
bv1
- The least significant bits.bv2
- The next bits.
public BV setValue(BV bv1, BV bv2, BV bv3)
bv1
- The least significant bits.bv2
- The next bits.bv3
- The next bits.
public BV setValue(BV bv1, BV bv2, BV bv3, BV bv4)
bv1
- The least significant bits.bv2
- The next bits.bv3
- The next bits.bv4
- The next bits.
public BV setValue(BV[] bv_array)
bv_array
-
BVException
- if the array contains only null pointers.public BV setValue(BV vector, boolean sign_ext)
vector
- Original BV.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(int width, BV vector)
width
- New width of BV.vector
- Original BV.
public BV setValue(int width, BV vector, boolean sign_ext)
width
- New width of BV.vector
- Original BV.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setValue(java.lang.String value)
value
- The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
java.lang.NumberFormatException
- if the string cannot be parsed as a valid numberpublic BV setValue(java.lang.String value, boolean sign_ext)
value
- The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.sign_ext
- Either ZERO_PAD or SIGN_EXT.
java.lang.NumberFormatException
- if the string cannot be parsed as a valid numberpublic BV setValue(int width, java.lang.String value)
width
- New width of BV.value
- The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
java.lang.NumberFormatException
- if the string cannot be parsed as a valid numberpublic BV setValue(int width, java.lang.String value, boolean sign_ext)
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.
java.lang.NumberFormatException
- if the string cannot be parsed as a valid numberpublic BV setValue(java.math.BigInteger value)
value
- The BigInteger to parse.
public BV setValue(java.math.BigInteger value, boolean sign_ext)
value
- The BigInteger to parse.sign_ext
- Either ZERO_PAD or SIGN_EXT.public BV setValue(int width, java.math.BigInteger value)
width
- New width of BV.value
- The BigInteger to parse.
public BV setValue(int width, java.math.BigInteger value, boolean sign_ext)
width
- New width of BV.value
- The BigInteger to parse.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV setWidth(int width)
width
- The new width of the BV.
BVException
- if width is not positive.public BV setWidth(int width, boolean sign_ext)
width
- The new width of the BV.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- if width is not positive.public BV setWidth(Wire w)
w
- The wire to determine width from.
public BV setWidth(Wire w, boolean sign_ext)
w
- The wire to determine width from.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV negate(BV in)
in
- the argument.
public static BV negate(int width, BV in)
width
- the width to set the result to.in
- the argument.
public static BV negate(BV in, BV out)
in
- the argument.out
- the location to store the result.
public static BV negate(int width, BV in, BV out)
width
- the width to set the result to.in
- the argument.out
- the location to store the result.
public static BV negate(BV in, boolean sign_ext)
in
- the argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV negate(int width, BV in, boolean sign_ext)
width
- the width to set the result to.in
- the argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV negate(BV in, BV out, boolean sign_ext)
in
- the argument.out
- the location to store the result.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV negate(int width, BV in, BV out, boolean sign_ext)
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.
public static BV abs(BV in)
in
- the argument.
public static BV abs(int width, BV in)
width
- the width to set the result to.in
- the argument.
public static BV abs(BV in, BV out)
in
- the argument.out
- the location to store the result.
public static BV abs(int width, BV in, BV out)
width
- the width to set the result to.in
- the argument.out
- the location to store the result.
public static BV max(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
public static BV max(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
public static BV max(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the location to store the result.
public static BV max(int width, BV in1, BV in2, BV out)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.out
- the location to store the result.
public static BV max(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV max(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
in1
- the first argument.in2
- the second argument.sign_ext1
- Either ZERO_PAD or SIGN_EXT.sign_ext2
- Either ZERO_PAD or SIGN_EXT.
public static BV max(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV max(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV max(BV in1, BV in2, BV out, boolean sign_ext)
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.
public static BV max(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV max(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
public static BV max(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV min(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
public static BV min(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
public static BV min(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the location to store the result.
public static BV min(int width, BV in1, BV in2, BV out)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.out
- the location to store the result.
public static BV min(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT both arguments.
public static BV min(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV min(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV min(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV min(BV in1, BV in2, BV out, boolean sign_ext)
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.
public static BV min(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV min(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
public static BV min(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV add(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
public static BV add(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
public static BV add(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the location to store the result.
public static BV add(int width, BV in1, BV in2, BV out)
width
- the width to set out to.in1
- the first argument.in2
- the second argument.out
- the location to store the result.
public static BV add(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT, used for both arguments.
public static BV add(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV add(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV add(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV add(BV in1, BV in2, BV out, boolean sign_ext)
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.
public static BV add(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV add(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
public static BV add(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV incr(BV in)
in
- the BV to increment.
public static BV incr(int width, BV in)
width
- the width to set the result to.in
- the BV to increment.
public static BV incr(BV in, BV out)
in
- the BV to increment.out
- the BV to store the result in.
public static BV incr(int width, BV in, BV out)
width
- the width to set the result to.in
- the BV to increment.out
- the BV to store the result in.
public static BV incr(BV in, boolean sign_ext)
in
- the BV to increment.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV incr(int width, BV in, boolean sign_ext)
width
- the width to set the result to.in
- the BV to increment.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV incr(BV in, BV out, boolean sign_ext)
in
- the BV to increment.out
- the BV to store the result in.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV incr(int width, BV in, BV out, boolean sign_ext)
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.
public static BV sub(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
public static BV sub(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
public static BV sub(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the location to store the result.
public static BV sub(int width, BV in1, BV in2, BV out)
width
- the width to set out to.in1
- the first argument.in2
- the second argument.out
- the location to store the result.
public static BV sub(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV sub(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV sub(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV sub(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV sub(BV in1, BV in2, BV out, boolean sign_ext)
in1
- the first argument.in2
- the second argument.out
- the location to store the result.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV sub(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV sub(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
public static BV sub(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV decr(BV in)
in
- the BV to decrement.
public static BV decr(int width, BV in)
width
- the width to set the result to.in
- the BV to decrement.
public static BV decr(BV in, BV out)
in
- the BV to decrement.out
- the BV to store the result in.
public static BV decr(int width, BV in, BV out)
width
- the width to set the result to.in
- the BV to decrement.out
- the BV to store the result in.
public static BV decr(BV in, boolean sign_ext)
in
- the BV to decrement.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV decr(int width, BV in, boolean sign_ext)
width
- the width to set the result to.in
- the BV to decrement.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV decr(BV in, BV out, boolean sign_ext)
in
- the BV to decrement.out
- the BV to store the result in.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV decr(int width, BV in, BV out, boolean sign_ext)
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.
public static BV mult(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
public static BV mult(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
multUpper(width, in1, in2)
public static BV mult(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the location to store the result.
multUpper(in1, in2, out)
public static BV mult(int width, BV in1, BV in2, BV out)
width
- the width to set out to.in1
- the first argument.in2
- the second argument.out
- the location to store the result.
multUpper(width, in1, in2, out)
public static BV mult(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV mult(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV mult(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
multUpper(width, in1, in2, sign_ext)
public static BV mult(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
multUpper(width, in1, in2, sign_ext)
public static BV mult(BV in1, BV in2, BV out, boolean sign_ext)
in1
- the first argument.in2
- the second argument.out
- the location to store the result.sign_ext
- Either ZERO_PAD or SIGN_EXT.
multUpper(in1, in2, out, sign_ext)
public static BV mult(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
multUpper(in1, in2, out, sign_ext)
public static BV mult(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
multUpper(width, in1, in2, out, sign_ext)
public static BV mult(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
multUpper(width, in1, in2, out, sign_ext)
public static BV multUpper(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
public static BV multUpper(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
mult(width, in1, in2)
public static BV multUpper(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the location to store the result.
mult(in1, in2, out)
public static BV multUpper(int width, BV in1, BV in2, BV out)
width
- the width to set out to.in1
- the first argument.in2
- the second argument.out
- the location to store the result.
mult(width, in1, in2, out)
public static BV multUpper(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV multUpper(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV multUpper(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
mult(width, in1, in2, sign_ext)
public static BV multUpper(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
mult(width, in1, in2, sign_ext)
public static BV multUpper(BV in1, BV in2, BV out, boolean sign_ext)
in1
- the first argument.in2
- the second argument.out
- the location to store the result.sign_ext
- Either ZERO_PAD or SIGN_EXT.
mult(in1, in2, out, sign_ext)
public static BV multUpper(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
mult(in1, in2, out, sign_ext)
public static BV multUpper(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
mult(width, in1, in2, out, sign_ext)
public static BV multUpper(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
mult(width, in1, in2, out, sign_ext)
public static BV div(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
java.lang.ArithmeticException
- if in2 is 0.public static BV div(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
java.lang.ArithmeticException
- if in2 is 0.public static BV div(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the location to store the result.
java.lang.ArithmeticException
- if in2 is 0.public static BV div(int width, BV in1, BV in2, BV out)
width
- the width to set out to.in1
- the first argument.in2
- the second argument.out
- the location to store the result.
java.lang.ArithmeticException
- if in2 is 0.public static BV div(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
java.lang.ArithmeticException
- if in2 is 0.public static BV div(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
java.lang.ArithmeticException
- if in2 is 0.public static BV div(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
java.lang.ArithmeticException
- if in2 is 0.public static BV div(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
java.lang.ArithmeticException
- if in2 is 0.public static BV div(BV in1, BV in2, BV out, boolean sign_ext)
in1
- the first argument.in2
- the second argument.out
- the location to store the result.sign_ext
- Either ZERO_PAD or SIGN_EXT.
java.lang.ArithmeticException
- if in2 is 0.public static BV div(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
java.lang.ArithmeticException
- if in2 is 0.public static BV div(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
java.lang.ArithmeticException
- if in2 is 0.public static BV div(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
java.lang.ArithmeticException
- if in2 is 0.public static BV mod(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
java.lang.ArithmeticException
- if in2 is 0.public static BV mod(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
java.lang.ArithmeticException
- if in2 is 0.public static BV mod(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the location to store the result.
java.lang.ArithmeticException
- if in2 is 0.public static BV mod(int width, BV in1, BV in2, BV out)
width
- the width to set out to.in1
- the first argument.in2
- the second argument.out
- the location to store the result.
java.lang.ArithmeticException
- if in2 is 0.public static BV mod(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
java.lang.ArithmeticException
- if in2 is 0.public static BV mod(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
in1
- the first argument.in2
- the second argument.sign_ext1
- Either ZERO_PAD or SIGN_EXT.sign_ext2
- Either ZERO_PAD or SIGN_EXT.
java.lang.ArithmeticException
- if in2 is 0.public static BV mod(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
java.lang.ArithmeticException
- if in2 is 0.public static BV mod(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
java.lang.ArithmeticException
- if in2 is 0.public static BV mod(BV in1, BV in2, BV out, boolean sign_ext)
in1
- the first argument.in2
- the second argument.out
- the location to store the result.sign_ext
- Either ZERO_PAD or SIGN_EXT.
java.lang.ArithmeticException
- if in2 is 0.public static BV mod(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
java.lang.ArithmeticException
- if in2 is 0.public static BV mod(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
java.lang.ArithmeticException
- if in2 is 0.public static BV mod(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
java.lang.ArithmeticException
- if in2 is 0.public static BV pow(BV in, int amt)
in
- the argument to exponentiate.amt
- the power to raise the argument by.
java.lang.ArithmeticException
- if in2 < 0.public static BV pow(int width, BV in, int amt)
width
- the width to set the result to.in
- the argument to exponentiate.amt
- the power to raise the argument by.
java.lang.ArithmeticException
- if in2 < 0.public static BV pow(BV in, int amt, BV out)
in
- the argument to exponentiate.amt
- the power to raise the argument by.out
- the BV to store the result in.
java.lang.ArithmeticException
- if in2 < 0.public static BV pow(int width, BV in, int amt, BV out)
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.
java.lang.ArithmeticException
- if in2 < 0.public static BV pow(BV in, int amt, boolean sign_ext)
in
- the argument to exponentiate.amt
- the power to raise the argument by.sign_ext
- Either ZERO_PAD or SIGN_EXT.
java.lang.ArithmeticException
- if in2 < 0.public static BV pow(int width, BV in, int amt, boolean sign_ext)
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.
java.lang.ArithmeticException
- if in2 < 0.public static BV pow(BV in, int amt, BV out, boolean sign_ext)
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.
java.lang.ArithmeticException
- if in2 < 0.public static BV pow(int width, BV in, int amt, BV out, boolean sign_ext)
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.
java.lang.ArithmeticException
- if in2 < 0.public static BV and(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
public static BV and(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
public static BV and(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.
public static BV and(int width, BV in1, BV in2, BV out)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.
public static BV and(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV and(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
in1
- the first argument.in2
- the second argument.sign_ext1
- Either ZERO_PAD or SIGN_EXT.sign_ext2
- Either ZERO_PAD or SIGN_EXT.
public static BV and(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV and(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV and(BV in1, BV in2, BV out, boolean sign_ext)
in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV and(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV and(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
public static BV and(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV or(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
public static BV or(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
public static BV or(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.
public static BV or(int width, BV in1, BV in2, BV out)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.
public static BV or(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV or(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
in1
- the first argument.in2
- the second argument.sign_ext1
- Either ZERO_PAD or SIGN_EXT.sign_ext2
- Either ZERO_PAD or SIGN_EXT.
public static BV or(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV or(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV or(BV in1, BV in2, BV out, boolean sign_ext)
in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV or(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV or(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
public static BV or(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV xor(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
public static BV xor(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
public static BV xor(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.
public static BV xor(int width, BV in1, BV in2, BV out)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.
public static BV xor(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV xor(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
in1
- the first argument.in2
- the second argument.sign_ext1
- Either ZERO_PAD or SIGN_EXT.sign_ext2
- Either ZERO_PAD or SIGN_EXT.
public static BV xor(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV xor(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV xor(BV in1, BV in2, BV out, boolean sign_ext)
in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV xor(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV xor(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
public static BV xor(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV not(BV in)
in
- the argument.
public static BV not(int width, BV in)
width
- the width to set the result to.in
- the argument.
public static BV not(BV in, BV out)
in
- the argument.out
- the BV to store the result in.
public static BV not(int width, BV in, BV out)
width
- the width to set the result to.in
- the argument.out
- the BV to store the result in.
public static BV not(BV in, boolean sign_ext)
in
- the argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV not(int width, BV in, boolean sign_ext)
width
- the width to set the result to.in
- the argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV not(BV in, BV out, boolean sign_ext)
in
- the argument.out
- the BV to store the result in.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV not(int width, BV in, BV out, boolean sign_ext)
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.
public static BV nand(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
public static BV nand(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
public static BV nand(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.
public static BV nand(int width, BV in1, BV in2, BV out)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.
public static BV nand(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV nand(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
in1
- the first argument.in2
- the second argument.sign_ext1
- Either ZERO_PAD or SIGN_EXT.sign_ext2
- Either ZERO_PAD or SIGN_EXT.
public static BV nand(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV nand(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV nand(BV in1, BV in2, BV out, boolean sign_ext)
in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV nand(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV nand(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
public static BV nand(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV nor(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
public static BV nor(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
public static BV nor(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.
public static BV nor(int width, BV in1, BV in2, BV out)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.
public static BV nor(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV nor(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
in1
- the first argument.in2
- the second argument.sign_ext1
- Either ZERO_PAD or SIGN_EXT.sign_ext2
- Either ZERO_PAD or SIGN_EXT.
public static BV nor(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV nor(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV nor(BV in1, BV in2, BV out, boolean sign_ext)
in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV nor(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV nor(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
public static BV nor(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV xnor(BV in1, BV in2)
in1
- the first argument.in2
- the second argument.
public static BV xnor(int width, BV in1, BV in2)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.
public static BV xnor(BV in1, BV in2, BV out)
in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.
public static BV xnor(int width, BV in1, BV in2, BV out)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.
public static BV xnor(BV in1, BV in2, boolean sign_ext)
in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV xnor(BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
in1
- the first argument.in2
- the second argument.sign_ext1
- Either ZERO_PAD or SIGN_EXT.sign_ext2
- Either ZERO_PAD or SIGN_EXT.
public static BV xnor(int width, BV in1, BV in2, boolean sign_ext)
width
- the width to set the result to.in1
- the first argument.in2
- the second argument.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV xnor(int width, BV in1, BV in2, boolean sign_ext1, boolean sign_ext2)
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.
public static BV xnor(BV in1, BV in2, BV out, boolean sign_ext)
in1
- the first argument.in2
- the second argument.out
- the BV to store the result in.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static BV xnor(BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV xnor(int width, BV in1, BV in2, BV out, boolean sign_ext)
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.
public static BV xnor(int width, BV in1, BV in2, BV out, boolean sign_ext1, boolean sign_ext2)
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.
public static BV shiftLeft(BV in, int amt)
in
- the argument to shift.amt
- the number of bits to shift left by (negative amounts shift right).
public static BV shiftLeft(int width, BV in, int amt)
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).
public static BV shiftLeft(BV in, int amt, BV out)
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.
public static BV shiftLeft(int width, BV in, int amt, BV out)
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.
public static BV shiftLeft(BV in, int amt, boolean sign_ext)
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.
public static BV shiftLeft(int width, BV in, int amt, boolean sign_ext)
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.
public static BV shiftLeft(BV in, int amt, BV out, boolean sign_ext)
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.
public static BV shiftLeft(int width, BV in, int amt, BV out, boolean sign_ext)
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.
public static BV shiftRight(BV in, int amt)
in
- the argument to shift.amt
- the number of bits to shift right by (negative amounts shift left).
public static BV shiftRight(int width, BV in, int amt)
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).
public static BV shiftRight(BV in, int amt, BV out)
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.
public static BV shiftRight(int width, BV in, int amt, BV out)
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.
public static BV shiftRight(BV in, int amt, boolean sign_ext)
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.
public static BV shiftRight(int width, BV in, int amt, boolean sign_ext)
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.
public static BV shiftRight(BV in, int amt, BV out, boolean sign_ext)
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.
public static BV shiftRight(int width, BV in, int amt, BV out, boolean sign_ext)
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.
public static BV barrelShiftLeft(BV in, int amt)
in
- the argument to barrel shift.amt
- the number of bits to shift left by (negative amounts shift right).
public static BV barrelShiftLeft(BV in, int amt, BV out)
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.
BVException
- if in.width() != out.width().public static BV barrelShiftRight(BV in, int amt)
in
- the argument to barrel shift.amt
- the number of bits to shift right by (negative amounts shift left).
public static BV barrelShiftRight(BV in, int amt, BV out)
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.
BVException
- if in.width() != out.width().public static BV reverse(BV in)
in
- The BV to reverse.
public static BV reverse(BV in, BV out)
in
- The BV to reverse.out
- The BV to store the results in.
BVException
- if in.width() != out.width().public boolean negative()
public boolean negative(boolean is_Signed)
is_Signed
- SIGN_EXT or ZERO_PAD
public static boolean negative(BV bv)
bv
- the BV to test.
public boolean positive()
public boolean positive(boolean is_Signed)
is_Signed
- SIGN_EXT or ZERO_PAD
public static boolean positive(BV bv)
bv
- the BV to test.
public boolean zero()
public static boolean zero(BV bv)
bv
- the BV to test.
public int signum()
public static int signum(BV bv)
bv
- the BV to test.
public int compare(BV bv2)
bv2
- the right hand argument in comparison. (this
is left hand argument).
public static int compare(BV bv1, BV bv2)
bv1
- the left hand argument in comparison.bv2
- the right hand argument in comparison.
public int compare(BV bv2, boolean sign_ext)
this
the signed flag is used to determine sign extension or zero padding.
bv2
- the right hand argument in comparison. (this
is left hand argument).sign_ext
- Either ZERO_PAD or SIGN_EXT used for bv2.
public static int compare(BV bv1, BV bv2, boolean sign_ext)
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.
public static int compare(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
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.
public boolean equals(java.lang.Object obj)
hashCode()
obj
- Object to compare.
public int hashCode()
equals(Object)
public boolean lt(BV bv2)
bv2
- the second argument of comparison (the first is this).
public boolean lt(BV bv2, boolean sign_ext)
this
it uses the signed flag.
bv2
- the second argument of comparison (the first is this).sign_ext
- Either ZERO_PAD or SIGN_EXT used for bv2.
public static boolean lt(BV bv1, BV bv2)
bv1
- the first argument of comparison.bv2
- the second argument of comparison.
public static boolean lt(BV bv1, BV bv2, boolean sign_ext)
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.
public static boolean lt(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
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.
public boolean gt(BV bv2)
bv2
- the second argument of comparison (the first is this).
public boolean gt(BV bv2, boolean sign_ext)
bv2
- the second argument of comparison (the first is this).sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static boolean gt(BV bv1, BV bv2)
bv1
- the first argument of comparison.bv2
- the second argument of comparison.
public static boolean gt(BV bv1, BV bv2, boolean sign_ext)
bv1
- the first argument of comparison.bv2
- the second argument of comparison.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static boolean gt(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
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.
public boolean lteq(BV bv2)
bv2
- the second argument of comparison (the first is this).
public boolean lteq(BV bv2, boolean sign_ext)
this
it uses the signed flag.
bv2
- the second argument of comparison (the first is this).sign_ext
- Either ZERO_PAD or SIGN_EXT used for bv2.
public static boolean lteq(BV bv1, BV bv2)
bv1
- the first argument of comparison.bv2
- the second argument of comparison.
public static boolean lteq(BV bv1, BV bv2, boolean sign_ext)
bv1
- the first argument of comparison.bv2
- the second argument of comparison.sign_ext
- Either ZERO_PAD or SIGN_EXT used for both arguments.
public static boolean lteq(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
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.
public boolean gteq(BV bv2)
bv2
- the second argument of comparison (the first is this).
public boolean gteq(BV bv2, boolean sign_ext)
this
it uses the signed flag.
bv2
- the second argument of comparison (the first is this).sign_ext
- Either ZERO_PAD or SIGN_EXT used for bv2.
public static boolean gteq(BV bv1, BV bv2)
bv1
- the first argument of comparison.bv2
- the second argument of comparison.
public static boolean gteq(BV bv1, BV bv2, boolean sign_ext)
bv1
- the first argument of comparison.bv2
- the second argument of comparison.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static boolean gteq(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
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.
public boolean eq(BV bv2)
bv2
- the second argument of comparison (the first is this).
public boolean eq(BV bv2, boolean sign_ext)
this
it uses the signed flag.
bv2
- the second argument of comparison (the first is this).sign_ext
- Either ZERO_PAD or SIGN_EXT used for bv2.
public static boolean eq(BV bv1, BV bv2)
bv1
- the first argument of comparison.bv2
- the second argument of comparison.
public static boolean eq(BV bv1, BV bv2, boolean sign_ext)
bv1
- the first argument of comparison.bv2
- the second argument of comparison.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static boolean eq(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
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.
public boolean neq(BV bv2)
bv2
- the second argument of comparison (the first is this).
public boolean neq(BV bv2, boolean sign_ext)
this
it uses the signed flag.
bv2
- the second argument of comparison (the first is this).sign_ext
- Either ZERO_PAD or SIGN_EXT used for bv2.
public static boolean neq(BV bv1, BV bv2)
bv1
- the first argument of comparison.bv2
- the second argument of comparison.
public static boolean neq(BV bv1, BV bv2, boolean sign_ext)
bv1
- the first argument of comparison.bv2
- the second argument of comparison.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public static boolean neq(BV bv1, BV bv2, boolean sign_ext1, boolean sign_ext2)
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.
public int getWidth()
public boolean getIsSigned()
public boolean getBit(int pos)
pos
- the position of the bit.
BVException
- if pos is invalid.public BV setBit(int pos)
pos
- the position of the bit.
BVException
- if pos is invalid.public BV setIsSigned(boolean is_signed)
is_signed
- the value to set the signed flag to. Signed (SIGN_EXT) or unsigned (ZERO_PAD) .
public BV setBit(int pos, boolean value)
pos
- the position of the bit.value
- the value to set the bit to.
BVException
- if pos is invalid.public BV setBits(int upper, int lower)
upper
- the upper boundary of the range, inclusive.lower
- the lower boundary of the range, inclusive.
BVException
- if either limit is invalid.public BV setBits(int upper, int lower, boolean value)
upper
- the upper boundary of the range, inclusive.lower
- the lower boundary of the range, inclusive.value
- the value to set the bits to.
BVException
- if either limit is invalid.public BV clearBit(int pos)
pos
- the position of the bit.
BVException
- if pos is invalid.public BV clearBits(int upper, int lower)
upper
- the upper boundary of the range, inclusive.lower
- the lower boundary of the range, inclusive.
BVException
- if either limit is invalid.public BV toggleBit(int pos)
pos
- the position of the bit.
BVException
- if pos is invalid.public BV toggleBits(int upper, int lower)
upper
- the upper boundary of the range, inclusive.lower
- the lower boundary of the range, inclusive.
BVException
- if either limit is invalid.public BV setRange(int lower, BV in)
lower
- the lower boundary of the range, inclusive.in
- BV containing the bits to insert at the range.
BVException
- if lower is invalid.public BV setRange(int upper, int lower, BV in)
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.
BVException
- if either limit is invalid.public BV setRange(int upper, int lower, BV in, boolean sign_ext)
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.
BVException
- if either limit is invalid.public BV lowerBits(int amount)
amount
- the amount of least significant bits to use.
BVException
- if amount is out of range.public BV lowerBits(int amount, BV out)
amount
- the amount of least significant bits to use.out
- the location to store the result.
BVException
- if amount is out of range.public BV upperBits(int amount)
amount
- the amount of most significant bits to use.
BVException
- if amount is out of range.public BV upperBits(int amount, BV out)
amount
- the amount of most significant bits to use.out
- the location to store the result.
BVException
- if amount is out of range.public BV range(int upper, int lower)
upper
- the upper boundary of the range, inclusive.lower
- the lower boundary of the range, inclusive.
BVException
- if either range argument is invalid.public BV range(int upper, int lower, BV out)
upper
- the upper boundary of the range, inclusive.lower
- the lower boundary of the range, inclusive.out
- the location to store the result.
BVException
- if either range argument is invalid.public int getMSBOn()
public static int getMSBOn(BV bv)
bv
- the BV to evaluate
public int getMSBOff()
public static int getMSBOff(BV bv)
bv
- the BV to evaluate
public int getLSBOn()
public static int getLSBOn(BV bv)
bv
- the BV to evaluate
public int getLSBOff()
public static int getLSBOff(BV bv)
bv
- the BV to evaluate
public int getOnCount()
public static int getOnCount(BV bv)
bv
- The BV to count.
public int getOffCount()
public static int getOffCount(BV bv)
bv
- The BV to count.
public java.lang.Object clone()
public static int stringBitWidth(java.lang.String str)
str
- the string to determine bit width from
java.lang.NumberFormatException
- if the string cannot be parsed as a valid numberpublic static int stringBitWidth(java.lang.String str, boolean ignore_zeroes)
str
- the string to determine bit width fromignore_zeroes
- false for entire width of string, true for position of first non-zero bit
java.lang.NumberFormatException
- if the string cannot be parsed as a valid numberpublic byte byteValue()
public short shortValue()
public int intValue()
public long longValue()
public float floatValue()
public double doubleValue()
public boolean toBoolean()
public byte toByte()
public byte toByte(boolean sign_ext)
sign_ext
- Either ZERO_PAD or SIGN_EXT.
public char toChar()
public char toChar(boolean sign_ext)
sign_ext
- Either ZERO_PAD or SIGN_EXT.
public short toShort()
public short toShort(boolean sign_ext)
sign_ext
- Either ZERO_PAD or SIGN_EXT.
public int toInt()
public int toInt(boolean sign_ext)
sign_ext
- Either ZERO_PAD or SIGN_EXT.
public long toLong()
public long toLong(boolean sign_ext)
sign_ext
- Either ZERO_PAD or SIGN_EXT.
public int[] toArray()
public int[] toArray(boolean sign_ext)
sign_ext
- Either ZERO_PAD or SIGN_EXT.
public BV[] toBVArray(int bv_size)
bv_size
- The size of each BV in the new array.
public BV[] toBVArray(int bv_size, boolean sign_ext)
bv_size
- The size of each BV in the new array.sign_ext
- Either ZERO_PAD or SIGN_EXT.
public java.math.BigInteger toBigInteger()
public java.math.BigInteger toBigInteger(boolean sign_ext)
sign_ext
- Either ZERO_PAD or SIGN_EXT.
public java.lang.String toBinaryString()
public java.lang.String toBinaryString(boolean print_leading_zeroes)
print_leading_zeroes
- whether or not to print leading 0's.
public java.lang.String toHexString()
public java.lang.String toHexString(boolean print_leading_zeroes)
print_leading_zeroes
- whether or not to print leading 0's.
public java.lang.String toDecimalString()
public java.lang.String toDecimalString(boolean signed)
signed
- whether or not to interpret the value as being signed.
public java.lang.String toString()
public java.lang.String toString(int radix)
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.
protected boolean initWidth(int width)
protected boolean verify()
protected BV initFromString(int width, java.lang.String value, boolean sign_ext)
public static void main(java.lang.String[] argv)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |