smallest binary

advertisement

Converting Binary Bits

This set of instructions is intended to teach Elementary Educated students (K-5), how to successfully and easily convert between binary, decimal, and hexadecimal bits. Before we begin, you might wonder: “What is a binary bit?” A bit is the smallest possible unit of data used by computers, which are symbolized through

1’s and 0’s. Computers are able to manipulate these bits for the purpose of storage and personal instructions. Before we start, let’s brush up on our powers of two:

1 2 4 8 16 32 64 128

2⁰ 2 1 2 2 2 3 2 4 2 5 ` 2 6 2 7

Perfect! Now that we’ve got that down, let’s move on to our first conversion.

Convert From Decimal to Binary

1.

Pick a decimal number (0, 1, 2, 3, 4, 5, 6….)

2.

Set out 8 spaces to symbolize the powers of two

3.

Start from the right side: a.

If the power of two value fits inside the decimal, enter a 1. b.

If the power of two value does not fit inside, enter a 0.

Now Let’s Try An Example:

1.

Decimal Number: 47

2.

_ _ _ _ _ _ _ _

2⁰ 2 1 2 2 2 3 2 4 2 5 2 6 2 7

3.

32 + 8 + 4 + 2+ 1 =47

= 1 1 1 1 0 1 0 0

Convert From Binary to Decimal

1.

Pick any 8 bit combination of 1’s and 0’s

2.

Set out 8 spaces to symbolize the powers of two

3.

Start from the left side a.

If the power of two value has a 1, insert that specific value b.

If the power of two value has a 0, insert a 0.

4.

Add all values together

Now Let’s Try An Example:

1.

Binary Number: 11110100

2.

_ _ _ _ _ _ _ _

2⁰ 2 1 2 2 2 3 2 4 2 5 2 6 2 7

3.

1 + 2 + 4 + 8 + 0 + 32 + 0 + 0 = 47

Before we move on to conversions with Hexadecimals, there are a few things that we must note. First, let’s brush up on our mathematical skills with multiplying by the power of 16.

1 16 256 4096 65536

16 0 16 1 16 2 16 3 16 4

Next, it’s important to understand that when thinking in terms of Hexadecimals,

0-9 are considered valid numbers BUT 10-15 are symbolized with A-F. For example:

A B C D E F

14 15 10 11 12 13

Finally, it’s important to remember:

- For every 1 hexadecimal = 4 binary bits.

- 4 bits = 1 byte

Convert From Binary to Hexadecimal

1.

Pick any 8 bit binary number

2.

Start from the left side, and group each by four bits (1 byte) a.

You will only need to know from 2 0 - 2 3

3.

Assign each byte to the correct power of 16 value

Now Let’s Try An Example

1.

Binary Bit: 10101111

2.

1010 1111

1+0+4+0 = 5

3.

5 = 5

= 5F

1+2+4+8 = 15

15 = F

Convert From Hexadecimal to Binary

1.

Pick any Hexadecimal number

2.

Leave 4 bit spaces for each Hexadecimal number a.

You’ll need to master powers of 16 and powers of 2

3.

Convert the power of 16 to powers of 2

Now Let’s Try An Example

1.

Hexadecimal: 5F

2.

5 F

1010 1111

(1+4 = 5)

3.

Binary: 1010111

(1+2+4+8 = 15)

Convert From Decimal to Hexadecimal

1.

Pick any Decimal number

2.

Leave 8 spaces for each 16 power value

3.

For each 16 power value: a.

If the decimal number goes inside decide how many times b.

If the decimal number doesn’t go inside, ignore

Now Let’s Try An Example

1.

342

_ _ _ _ _

16 0 16 1 16 2 16

2.

6(1) + 5(16)+ (256)1

3 16 4

3.

Hexadecimal: 651

Convert from Hexadecimal to Decimal

1.

Pick any Hexadecimal number

2.

Consider the 16 power values a.

Each Hexadecimal number represents the number of times that certain power of 16 value occurs b.

Multiply the number of times each value occurs c.

Add the numbers together

3.

Final result will be the decimal number

Now Let’s Try An Example

1.

651

2.

_ _ _ _ _

16 0 16 1 16 2 16 3 16 4

1 5 1

6(1) + 5(16) + 256(1)

= 342

Congratulations, you’ve mastered the skill of binary conversion!

Author: Mija Isip

Download