BVEC
Binary Vector Representation of Signed Integers
BVEC
is a FORTRAN77 library which
demonstrates how signed integers can be stored as
binary vectors, and arithmetic can be performed on them.
Licensing:
The computer code and data files made available on this
web page are distributed under
the GNU LGPL license.
Languages:
BVEC is available in
a C version and
a C++ version and
a FORTRAN77 version and
a FORTRAN90 version and
a MATLAB version and
a Python version.
Related Data and Programs:
Source Code:
-
bvec.f, the source code.
-
bvec.sh,
BASH commands to compile the source code.
Examples and Tests:
List of Routines:
-
BVEC_ADD adds two (signed) binary vectors.
-
BVEC_AND computes the AND of two binary vectors.
-
BVEC_CHECK checks a binary vector.
-
BVEC_COMPLEMENT2 computes the two's complement of a binary vector.
-
BVEC_MUL computes the product of two binary vectors.
-
BVEC_NEXT generates the next BVEC.
-
BVEC_NOT "negates" or takes the 1's complement of a binary vector.
-
BVEC_OR computes the inclusive OR of two binary vectors.
-
BVEC_PRINT prints a BVEC, with an optional title.
-
BVEC_REVERSE reverses a binary vector.
-
BVEC_SUB subtracts two binary vectors.
-
BVEC_TO_I4 makes an integer from a (signed) binary vector.
-
BVEC_UNIFORM returns a pseudorandom BVEC.
-
BVEC_XOR computes the exclusive OR of two binary vectors.
-
I4_TO_BVEC makes a signed binary vector from an I4.
-
I4_UNIFORM_AB returns a scaled pseudorandom I4.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
You can go up one level to
the FORTRAN77 source codes.
Last revised on 29 December 2014.