Gosh I wish I could say stuff like that and know what I meant.
The problem with computers is that they can only count to two. We have ten unique symbols in our number system (0, 1, 2, 3, 4, 5, 6, 7, 8, and 9). That's why our number system is called decimal. When we get to ten, we move over to the next position, and write 10, which is equal to 1 * 10 + 0. What we are doing is working with powers of ten. The number 200 is equal to 2 * 10
2 + 0 * 10
1 + 0 * 10
0. There are only two symbols in a computer's number system; namely, 0 and 1. This number system is known as binary (bit is a contraction for binary digit). When a computer evaluates 1 + 1, it produces 10, which is two in binary because the places to the left of the first digit are powers of two. For example, the number 31 in binary is 11111, which is equal to 1 * 2
4 + 1 * 2
3 + 1 * 2
2 + 1 * 2
1 + 1 * 2
0, or 16 + 8 + 4 + 2 + 1.
Non-computer-type forum members are probably asking why a computer uses binary. Well, the number 1 is most often denoted by 5 volts (there are types of digital logic that use a smaller voltage for the number 1) and the number zero is denoted by 0 volts (actually there are voltage thresholds in most circuits with an ambiguity zone between the thresholds, but let's keep things simple). One of the simplest circuits in a computer is a half adder. It is composed of an XOR gate and an AND gate. The XOR gate produces the sum, and the AND gate produces the carry into the next position. The truth tables for these operations are as follows
A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0
A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1
Now, there is a circuit called a subtractor, but we do not need it. We can subtract numbers by representing a negative number in a form known as 2s complement. In order to convert a positive number to a negative number in 2s complement form, we invert all bits (1s become 0s and 0s become 1s) and add 1.
Example
Let's represent 31 as an 8-bit binary number
00011111
If we want to convert this number to -31 in binary, we first invert all of the bits, leading to
11100000
then we add 1
11100000 + 1 = 11100001
Now, watch what happens when we add 11100001 (-31) to 00011111 (31)
11100001
00011111
-----------
00000000
Remember, a computer can only count to 1. If we add 1 + 1, we get 10; hence, the first two 1s in the two numbers sum to 10, leading to a carry into the next position, which also results in the sum of 10. This process ripples across the addends.
Now, getting to fractions. If the positions to the left of the decimal point are powers of two, then the positions to the right of the decimal point are one over powers of two.
0.1/2
1 + 1/2
2 + 1/2
3 + 1/2
4 + 1/2
5 ...
The fraction 0.75 is equal to 1/2
1 + 1/2
2 (i.e., 1/2 + 1/4), or 0.11
There are fractions that cannot be handled easily using this system such as 1/10th. I will not go into detail here, but trust me, these fractions result in repeating binary sequences.