Difference between revisions of "Binary"

(Added a section on how to convert binary to decimal)
m
Line 1: Line 1:
Binary stands for [[base numbers|base]] 2. It is commonly used in computing for its relative ease of computation and the ease of using ON - OFF states in computers.
+
Binary stands for [[base numbers|base]] 2. It is commonly used in computing for its relative ease of computation and the ease of using ON - OFF states in computers. Binary is written as a number with two different possible digits: 1 and 0.  
  
  
Line 27: Line 27:
 
==Converting Binary to Decimal==
 
==Converting Binary to Decimal==
  
Converting a binary number to decimal is not too difficult.  Take each digit in the binary number which is a 1 and write down the number it represents in decimal.  A good way to know what it represents is to start at the far right of the number (this digit is always 1).  As you move across each digit to the left you double the number it represents in decimal.  Once you've done this, add up all the decimal numbers and the total is your result.  Here is an example:
+
To convert binary to decimal, take each digit in the binary number which is a 1 and write down the number it represents in decimal.  A good way to know what it represents is to start at the far right of the number (this digit is always 1).  As you move across each digit to the left you double the number it represents in decimal.  Once you've done this, add up all the decimal numbers and the total is your result.  Here is an example:
  
 
Binary number 1101 =  
 
Binary number 1101 =  
Line 39: Line 39:
 
1 * 2^3 = 8
 
1 * 2^3 = 8
  
Add them all together and you get 13
+
Add them all together and you get 13.
  
(Hint:  If the far right digit is a 1 then the result should be an odd number, if it is a 0 then it should be an even number.  This is because the far right digit is the only one which can be odd.)
+
(Hint:  If the far right digit is a 1 then the result should be an odd number, if it is a 0 then it should be an even number.  This is because the far right digit is the only one which can be odd, as in any other place the digit will be multiplied by a power of 2 that doesn't equal 1.)
  
 +
Note that this works because the only two possible digits are 1 and 0. The digit 0 doesn't yield any additional value to a number, so we only have to consider the 1s.
  
 
==External Links==
 
==External Links==

Revision as of 22:14, 7 June 2015

Binary stands for base 2. It is commonly used in computing for its relative ease of computation and the ease of using ON - OFF states in computers. Binary is written as a number with two different possible digits: 1 and 0.


In computers, each byte usually holds 8 bits, or binary digits. Thus a single byte can hole a value ranging from 0 to 255.

Converting Binary to Decimal

To convert binary to decimal, take each digit in the binary number which is a 1 and write down the number it represents in decimal. A good way to know what it represents is to start at the far right of the number (this digit is always 1). As you move across each digit to the left you double the number it represents in decimal. Once you've done this, add up all the decimal numbers and the total is your result. Here is an example:

Binary number 1101 =

1 * 2^0 = 1

0 * 2^1 = 0

1 * 2^2 = 4

1 * 2^3 = 8

Add them all together and you get 13.

(Hint: If the far right digit is a 1 then the result should be an odd number, if it is a 0 then it should be an even number. This is because the far right digit is the only one which can be odd, as in any other place the digit will be multiplied by a power of 2 that doesn't equal 1.)

Note that this works because the only two possible digits are 1 and 0. The digit 0 doesn't yield any additional value to a number, so we only have to consider the 1s.

External Links


This article is a stub. Help us out by expanding it.

Power of two Number in base 10 Binary representation
$2^1$ 2 10
$2^2$ 4 100
$2^3$ 8 1000
$2^4$ 16 10000
$2^5$ 32 100000
$2^6$ 64 1000000
$2^7$ 128 10000000