Learn the mathematical process of translating binary strings into numbers we use every day.
Every high-definition movie, viral meme, and text message you've ever sent is actually just a massive list of two numbers: 0 and 1. But how does a computer turn a string like into something we actually understand?
In our everyday lives, we use the Decimal system (Base-10), which relies on ten digits (0-9). Computers, however, use the Binary system (Base-2), which only uses 0 and 1. The secret to reading binary is understanding Place Value. In decimal, each column is a power of 10 (). In binary, each column is a power of two. We read binary from right to left, starting with . Each step to the left doubles the value: . These are the 'slots' where we place our 1s and 0s.
Quick Check
If the first position on the right is (which equals 1), what is the value of the 5th position from the right?
Answer
16
Think of each binary digit (or bit) as a light switch. A 1 means the switch is 'On,' and we count that column's value. A 0 means the switch is 'Off,' and we ignore that value. To convert a binary string to decimal, you simply look at which 'switches' are on and add their corresponding powers of two together. For example, in the 4-bit number , the '8' switch and the '2' switch are on. By adding them (), we find the decimal value is .
Convert the binary number to decimal: 1. Identify the place values: . 2. Match the bits: (at 8), (at 4), (at 2), (at 1). 3. Add the 'On' values: . 4. Final Answer: .
Convert to decimal: 1. Map the bits to values: - - - - - - - - 2. Sum the results: . 3. Final Answer: .
Quick Check
What is the decimal value of the binary string ?
Answer
15
What is the decimal value of ? 1. This represents a byte where every single switch is 'On'. 2. Calculation: . 3. Shortcut: The sum of any sequence of powers of two is always one less than the next power of two (). 4. Final Answer: .
What is the decimal value of the binary number ?
Which power of two corresponds to the 7th bit from the right?
The binary number is equal to the decimal number 128.
Review Tomorrow
In 24 hours, try to write down the eight place values of a byte from memory (starting from 128 down to 1).
Practice Activity
Find a random 8-bit binary generator online and practice converting 5 strings into decimal values without looking at a chart.