ICS2O Binary Numbers

Part A: Converting from Binary to Decimal Numbers

A simple and organized way to convert from binary to decimal is to separate out each binary digit and match it up with the corresponding power of 2.

For example, what is 001011012 as a decimal value? Notice that binary numbers are often represented using multiples of 4 digits (4, 8, 12, 16, etc.), even if some of the leading digits are zeros.

binary digits / 0 / 0 / 1 / 0 / 1 / 1 / 0 / 1
power of 2 / 27 / 26 / 25 / 24 / 23 / 22 / 21 / 20
decimal value / 128 / 64 / 32 / 16 / 8 / 4 / 2 / 1

In this case, 001011012 = 32 + 8 + 4 + 1 = 45

Exercise 1: Converting from Binary Numbers to Decimal Numbers

Write each binary number as a sum of decimal numbers, then determine the final answer.

Binary Number / Sum of Decimal Numbers / Decimal Number
0011
1010
0001 0100
1011 0100

Part B: Converting From Decimal to Binary Numbers

Converting from binary to decimal involves multiplying by powers of 2, so it makes sense that going the other way, from decimal to binary, would involve dividing by 2, and looking at the remainder from the division.

For example, what is the decimal number 25 (or 2510) in binary notation?

Instruction / division statement / whole answer / remainder
  1. divide the original value by 2
/ / 12 / 1
  1. divide the previous answer by 2
/ / 6 / 0
  1. divide the previous answer by 2
/ / 3 / 0
  1. divide the previous answer by 2
/ / 1 / 1
  1. divide the previous answer by 2
/ / 0 / 1
6.  stop because the previous answer is zero!
7.  construct the binary number using the digits from the remainder, starting from the bottom

In this case, 2510 = 110012

Exercise 2: Converting Decimal Numbers to Binary Numbers

For each decimal number, perform divisions by two (2) until you reach an answer of zero (0). Then write your final answer by using the digits from the remainder. Check each answer by converting the binary number back to decimal.

Decimal Number / Binary Conversion / Sum of Decimal Numbers / Decimal Number
4
9
21
75