# How to convert fractions and decimal numbers into binary notation? E.g 4 1/2, 5/16, 4.7 etc?

Relevance
• Jim
Lv 7
2 years ago

You need to know how Positional Value works

Base 10

1 x 10^2 = 100

1 x 10^1 = 10

1 x 10^0 = 1

1 x 10-1 = 1/10 = 0.1

1 x 10-2 = 1/100 = 0.01

etc

Base 2: (or any other base follows same design)

1 x 2^2 = 4

1 x 2^1 = 2

1 x 2^0 = 1

1 x 2-1 = 1/2 = 0.5

1 x 2-2 = 1/4 = 0.25

etc

You simply add up the numbers that give you your value.

4.5 is 1x2^2 + 0x2^1 + 0.2^0 + 1x2^-1 = 100.1₂

• ?
Lv 7
2 years ago

4 1/2 = 9/2

9 = 1001 base 2

/2 is right shift 1 bit

4 1/2 = 100.1 base 2

5/16

5 = 0101

/16 is right shift 4 bits

5/16 = 0.0101

4.7 does not have an exact representation

4 = 100 base 2

fractional part

2(0.7) = 1.4

2(.4) = 0.8

2(.8) = 1.6

2(.6) = 1.2

2(.2) = 0.4

2(.4) = 0.8

7/10 = 1 0110 0110 ...

4.7 = 100.0 0110 0110 ...

• khalil
Lv 7
2 years ago

0.abc

as you know a, b, and c are 0 or 1

the values

a ...1/2

b ....1/4

c......1/8

so on

1/2 → 0.100

4 → 100

4 1/2 = 100.1

• 2 years ago

Think of it this way: in the decimal system, the places are:

with n = 0 to 9 as the digits

1st = n*10^(-1)

2nd = n*10^(-2)

etc

so, for binary, it would be (n = digits 0, 1)

1st = n*2^-1

2nd = n*2^-2

3rd = n^2^-3

...

Still have questions? Get answers by asking now.