Binary: an introduction
If I told you I would give you 10 dollars for a Five dollar bill, you probably would be excited. But if you received two dollars, you might be livid. “Where is the ten dollars you promised?” But I said 10 dollars not ten dollars. The 10 is binary. In binary 10 is 2. Are you confused? Don’t worry, it should make sense by the end
“ a binary number is a number expressed in the base-2 numeral system or binary numeral system, which uses only two symbols: typically 0 (zero) and 1 (one).”
The number system we are used to is called decimal. The digits consist of 0,1,2,3,4,5,6,7,8,9 and are part of base ten notation. With binary, or base2 notation, the only digits are 0, and 1. While it may seem counterintuitive, every number that can be made with the decimal system can also be made in binary. Coincidentally this is how computers count and add digits, binary is the “native language” of computers.
What does zero to ten look like in binary?
- Zero 0
- One 1
- Two 10
- Three 11
- Four 100
- Five 101
- Six 110
- Seven 111
- Eight 1000
- Nine 1001
- Ten 1010
Addition in binary is just like decimal addition, adding from right to left, and carrying over carry values.
Lets go through an example: We will add Ten (1010) and eleven (1011)
- Ten + Eleven = sum
- Sum is currently 0
- 1010 + 1011 : sum 0 : carry 0
- Remember, Start with rightmost digits: Digits we worked on will be replaced with x
- 1010 + 1011 = 0 + 1 = 1 : sum is 1 : carry is 0
- 101x + 101x = 1 + 1 = 10: sum is 01 : carry is 1
- 10xx + 10xx = 0 + 0 + carry(1) : sum is 101 : carry is 0
- 1xxx + 1xxx = 1 + 1 = 10 : sum is 0101 : carry is 1
- Sum is 10101
- 10101 is 21 in decimal, addition complete!