Processors can only understand binary. Ultimately, everything that is processed by a computer is handled in one of two states, 1 or 0.
Many devices such as hair straighteners or games consoles make use of the following symbols:
The number 1 represents on and the number 0 represents off.
Integers
Binary is used to represent whole numbers so that they can be understood by the processor. An integer is a whole number.
Integers can be positive numbers or negative numbers. The number 173 can be represented in binary as:
10101101
Binary works using a number system that is based on powers of 2. To understand why 10101101 is the same as 173 look at the following table:
When adding up all of the values that are on, the following sum is created:
128 + 32 + 8 + 4 + 1 = 173
In this example we are using 8 bits to represent a number. If we use 8 bits we can represent any number between 0 and 255.
If all of the values are off, the number is 0:
If all of the values are on, the number is 255:
128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255