Binary, Decimal, and Hexadecimal are fundamental number systems used in computing. Decimal is the system we use every day with digits 0-9, Binary is the language of computers using only 0s and 1s, and Hexadecimal is a shorthand way to represent binary numbers.
The decimal system is the number system we use every day, such as when counting money, ages, or scores in games. It's based on base-10, which means it uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. This system is familiar because it's how we naturally count, often linked to having ten fingers.
Each digit in a decimal number has a position that determines its value, based on powers of 10. The rightmost digit is the ones place (10 to the power of 0, which equals 1), the next digit to the left is the tens place (10 to the power of 1), then hundreds (10 to the power of 2), and so on. This might sound tricky at first, but it's straightforward once you see it in action.
Let's break down a simple example with the number 345
:
Digit | Place Value (Power of 10) | Actual Value |
---|---|---|
3 | Hundreds (102) | 3 × 100 = 300 |
4 | Tens (101) | 4 × 10 = 40 |
5 | Ones (100) | 5 × 1 = 5 |
Now, add these values together: 300
+ 40
+ 5
= 345
. See how the position of each digit changes what it represents? For instance, the '3' is worth 300 because it's in the hundreds place.
Decimal numbers are intuitive for humans because they're based on tens, making them easy to read and write. However, computers use binary (base-2) instead, as it's more efficient for their electronic components.
Choose three different decimal numbers between 100 and 1000. For each number, write it down and break it down into its place values (hundreds, tens, and ones). Then, write the expanded form by multiplying each digit by its place value and adding them together.
For example, if you choose 567
, here is the breakdown:
Digit | Place Value | Actual Value |
---|---|---|
5 | Hundreds (102) | 5 × 100 = 500 |
6 | Tens (101) | 6 × 10 = 60 |
7 | Ones (100) | 7 × 1 = 7 |
The sum of these values is 500
+ 60
+ 7
= 567
, which is the expanded form.
Follow these steps for each of your three numbers:
Binary is a number system that forms the foundation of how computers store and process information. It's a base-2 system, which means it only uses two digits: 0 and 1. Computers use binary because it's simple to represent with electronic components that can be either on (1) or off (0).
Each digit in a binary number, called a bit, represents a power of 2, starting from the rightmost digit. The rightmost bit is 2 to the power of 0 (which is 1), the next one to the left is 2 to the power of 1 (2), then 2 to the power of 2 (4), and so on. This might seem unfamiliar at first, but it's straightforward when you break it down with an example.
Let's look at the binary number 101
and see what it means in decimal.
Digit | Place Value (Power of 2) | Actual Value |
---|---|---|
1 | Four (22) | 1 × 4 = 4 |
0 | Two (21) | 0 × 2 = 0 |
1 | One (20) | 1 × 1 = 1 |
Now, add these values together: 4
+ 0
+ 1
= 5
in decimal. So, binary 101
equals decimal 5
. This shows how the position of each bit determines its value, just like in decimal but with powers of 2 instead of 10.
Binary is essential in computing because it allows data to be represented in a way that's efficient for machines. For example, a single byte (8 bits) can represent numbers from 0 to 255 in decimal. As you progress in this lesson, you'll learn how to convert between binary and other systems, which will help you understand how computers handle data.
Now, let's learn how to convert a decimal number to binary. For example, convert decimal 5 to binary.
To do this, divide the decimal number by 2 repeatedly and record the remainders. The binary number is read from the last remainder to the first.
Division | Quotient | Remainder (Binary Digit) |
---|---|---|
5 ÷ 2 | 2 | 1 (least significant bit) |
2 ÷ 2 | 1 | 0 |
1 ÷ 2 | 0 | 1 (most significant bit) |
Reading the remainders from bottom to top gives binary 101. To verify, we can convert binary 101 back to decimal, which is 4 + 0 + 1 = 5, matching our original number.
Choose three different binary numbers between 000 and 111 (for example, 011, 100, and 110). For each number, write it down, break it down into its place values (powers of 2), and calculate the decimal equivalent by summing the values.
For example, take binary 101:
Digit | Place Value (Power of 2) | Actual Value |
---|---|---|
1 | Four (22) | 1 × 4 = 4 |
0 | Two (21) | 0 × 2 = 0 |
1 | One (20) | 1 × 1 = 1 |
Sum: 4 + 0 + 1 = 5 in decimal.
Follow these steps for each of your three binary numbers:
Here are the solutions for the example binary numbers 011, 100, and 110:
Digit | Place Value (Power of 2) | Actual Value |
---|---|---|
0 | Four (22) | 0 × 4 = 0 |
1 | Two (21) | 1 × 2 = 2 |
1 | One (20) | 1 × 1 = 1 |
Sum: 0 + 2 + 1 = 3 in decimal.
Digit | Place Value (Power of 2) | Actual Value |
---|---|---|
1 | Four (22) | 1 × 4 = 4 |
0 | Two (21) | 0 × 2 = 0 |
0 | One (20) | 0 × 1 = 0 |
Sum: 4 + 0 + 0 = 4 in decimal.
Digit | Place Value (Power of 2) | Actual Value |
---|---|---|
1 | Four (22) | 1 × 4 = 4 |
1 | Two (21) | 1 × 2 = 2 |
0 | One (20) | 0 × 1 = 0 |
Sum: 4 + 2 + 0 = 6 in decimal.