Jump to content

Binary coding

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Derek Ross (talk | contribs) at 12:30, 9 September 2002 (sp). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The binary number system, also know as Base-2, is an alternative to the more commonly used decimal system, which, instead of having a basic multiplier of 10, uses a multiplier of 2.

Binary numbers have only two digits, 0 and 1, and the values denoted by these digits depend on their positions, just as in decimal numbers. Like decimal, the rightmost column before a point is the "1's" column, but the second column, instead of being for "10's" is for "2's". Each column in a binary number represents a bit (binary digit), and binary numbers are usually written with all bits preserved - including leading zeros. To work out a binary number in decimal, work from the right, counting 1 (20) if there is a one in the first column, 2 (21) if there is a 1 in the second column and so on, going up in powers of 2. For example, 00012=110 (the subscript indicates the base being used), 00102=210.

<needs expansion!>

There are several different methods of coding decimal into binary, each useful for different things:

Binary Coded Decimal
Each digit of decimal is encoded as a 4-bit binary number. The digits are then individually decoded to form a decimal number
Two's Complement
The number is encoded so negative numbers start with a 1, then all other 1's are subtracted. Eg. 11112=-110. Is useful for arithmetic with binary

See also: