info prev up next book cdrom email home

Binary

The Base 2 method of counting in which only the digits 0 and 1 are used. In this Base, the number 1011 equals $1\cdot 2^0+1\cdot 2+0\cdot 2^2+1\cdot 2^3=11$. This Base is used in computers, since all numbers can be simply represented as a string of electrically pulsed ons and offs. A Negative $-n$ is most commonly represented as the complement of the Positive number $n-1$, so $-11=00001011_2$ would be written as the complement of $10=00001010_2$, or 11110101. This allows addition to be carried out with the usual carrying and the left-most digit discarded, so $17-11=6$ gives
$\quad 00010001 \quad \phantom{-}17$
$\quad \underline{11110101}\quad \underline{-11}$
$\quad 00000110 \quad \phantom{-0}6$


The number of times $k$ a given binary number $b_n\cdots b_2 b_1 b_0$ is divisible by 2 is given by the position of the first $b_k=1$ counting from the right. For example, $12=1100$ is divisible by 2 twice, and $13=1101$ is divisible by 2 0 times.


Unfortunately, the storage of binary numbers in computers is not entirely standardized. Because computers store information in 8-bit bytes (where a bit is a single binary digit), depending on the ``word size'' of the machine, numbers requiring more than 8 bits must be stored in multiple bytes. The usual FORTRAN77 integer size is 4 bytes long. However, a number represented as (byte1 byte2 byte3 byte4) in a VAX would be read and interpreted as (byte4 byte3 byte2 byte1) on a Sun. The situation is even worse for floating point (real) numbers, which are represented in binary as a Mantissa and Characteristic, and worse still for long (8-byte) reals!


Binary multiplication of single bit numbers (0 or 1) is equivalent to the And operation, as can be seen in the following Multiplication Table.

$\times$ 0 1
0 0 0
1 0 1

See also Base (Number), Decimal, Hexadecimal, Octal, Quaternary, Ternary


References

Lauwerier, H. Fractals: Endlessly Repeated Geometric Figures. Princeton, NJ: Princeton University Press, pp. 6-9, 1991.

Pappas, T. ``Computers, Counting, & Electricity.'' The Joy of Mathematics. San Carlos, CA: Wide World Publ./Tetra, pp. 24-25, 1989.

Press, W. H.; Flannery, B. P.; Teukolsky, S. A.; and Vetterling, W. T. ``Error, Accuracy, and Stability'' and ``Diagnosing Machine Parameters.'' §1.2 and §20.1 in Numerical Recipes in FORTRAN: The Art of Scientific Computing, 2nd ed. Cambridge, England: Cambridge University Press, pp. 18-21, 276, and 881-886, 1992.

mathematica.gif Weisstein, E. W. ``Bases.'' Mathematica notebook Bases.m.



info prev up next book cdrom email home

© 1996-9 Eric W. Weisstein
1999-05-26