Jump to content

Binary coding

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by MP~enwiki (talk | contribs) at 09:40, 25 May 2002 (Incomplete introduction to binary number system). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Binary, 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. There are only 2 digits in binary, 0 and 1, and these obey similar place values to decimal. 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 arithmatic with binary