-
In this video, we're going to
look at the binary fractions
-
again, but from a slightly
different angle. I will show you
-
an alternative method to convert
decimal fractions into binary
-
fractions, which will work in
most cases. I will show you some
-
examples, and again I will draw
your attention to the
-
limitations of this method.
-
So let's look at an example. So
what happens if you would need
-
to convert 13.3125 into binary?
From here on, I'm going to split
-
the number I'm going to convert
the whole number and the
-
fraction part separately. The
whole number 413. We're going to
-
use the normal way of converting
decimal numbers into binary's,
-
so use the place where you
-
table. 124 eight 16 So what
combination of these makes up 13
-
while 8 + 4 makes 12
+ 1 makes 13, so the
-
whole part of this decimal
fraction is 1101.
-
How about the decimal part? What
I'm going to do now? I'm going
-
to just separately right down
the decimal part.
-
And the trick is here to keep
doubling the number. So what's
-
the double of three 125?
-
Double of five is 10, carried
A1 double of two is 4 + 1
-
makes 5 double of two is 2 and
double of three is 6. Now what
-
happened in here is that I do
not have any overflow into the
-
whole number part of this part
of the structure and therefore
-
I'm going to record 0 after
the radix point.
-
Then I'm going to keep doubling.
Obviously double of 00, so I
-
don't even need to think about
that. 2 * 5 is 10, carried A one
-
2 * 2 is 4 + 1 makes it five.
2 * 6 is 12. So record the two
-
and the one is an overflow. So
this digit. Now I'm going to
-
pick up and record as the 2nd
digit of the.
-
Binary fraction.
-
Imagine like if you were picking
this one up from here recorded
-
here. So from now it disappears.
The next step that I'm going to
-
do, I'm going to double again,
but without the whole part. So
-
I'm just going to 55.
-
Which may extend double of two
is 4 + 1 is 5 and there again I
-
have got no overflow into the
whole parts, so I'm going to
-
record a 0 here.
-
Double again 2 * 5 is 10.
-
There is an overflow. This is my
last digit here because from
-
here on I've got no more
fractional parts, so you stop
-
when you end up with a zero in
the fractional part. Now pulling
-
the two together.
-
13.3125, in decimal
is the same
-
as 1101 Radix
.0101 in binary.
-
The second example is
9.1875. Again separates the
-
number into whole and
fractional part. The whole
-
part is 9.
-
Which is 8 + 1, so eight
no four, no two and one.
-
The decimal part now.
-
0.1875 Let's keep doubling it. 2
* 5 is 10 carry one. 2 *
-
7 is 14 + 1 makes it 15
carried A one 2 * 8016 + 1
-
is 17, carried A one. 2 * 1
is 2 + 1 is 3 again. I
-
did not have any overflow into
the whole number part, so the
-
1st digit behind the radix point
that I'm going to record.
-
Is a 0.
-
Double again.
-
2 * 5 is 10, carried a warm 2
* 7 is 14 + 1 makes it 15.
-
Carry the one 2 * 3 is 6 +
1, seven again no overflow into
-
the whole part. So I'm going to
record 0 here.
-
Double again 2 * 5 is 10.
Carried a wamp. 2 * 7 is 14
-
+ 1 makes it 15. Now I have
gotten overflowing here, so I'm
-
going to record this.
-
As the next digit after the
radix point and then double
-
again, don't forget that this
one is not here anymore because
-
I picked up and recorded it in
-
here. So 2 * 5 is 10.
-
So the next digit is 1 again. So
for the two things together.
-
9.1875 in decimal
is the same
-
as 1001 radix
.0011 in binary.
-
The next number is 0.6875.
Luckily, this number doesn't
-
have any whole parts, so we just
need to concentrate on the
-
decimal fraction part so I can
just simply keep doubling this
-
number. 2 * 5 is 10. Carry
one 2 * 7 is 14 +
-
1 is 15, carried A one 2
* 8016 + 1 is 17.
-
Either one 2 * 6 is.
-
12 + 1 is 13, so I've got an
-
overflow. So the 1st digit
I'm going to record behind
-
the radix point is 1.
-
Double 2 * 5 is 10, carried A
one 2 * 7 is 14 + 1 makes it
-
15. Carry the one 2 * 3 is 6 +
1. Seven this case I did not
-
have an overflow, so the next
day did after the radix point is
-
0 double again.
-
2 * 510 carried A one 2 *
7 is 14 + 1 makes it 15
-
overflow, so the next digit is
1. Remember that's gone now and
-
O makes no difference there. 2 *
5 is 10, so it's 1.0. So we
-
have got one more digit here,
which is a one so 0.6875 in
-
decimal. As the same is O radix
-
.1011. In binary.
-
Now let's look at a nice and
easy decimal number. The one
-
that we didn't quite know how to
deal with at the end of the last
-
video. So let's look at 3.4. So
let's separate the number again
-
in two whole and fractional
parts, so three is 2 + 1, which
-
is 1 one and the fractional
part. Let's just double 2 * 4 is
-
0.8, so after the radix point,
the 1st digit will be 0.
-
2 * 8 is 16.
-
So 1.6 the next digit is 1.
-
2 * 6 is 12, so 2.
-
.1 again carry the one.
-
Double of two is 4 no
carry, 004 is 8 again, no
-
overflow. Double F8 is 16 so
I've got one here now.
-
WF6 is 12. I've got another one
here. Now double F2 is 4.
-
Put down a zero and hold on.
I'm repeating myself look.
-
Point 4.8. 6248624862
-
so this.
Simple decimal fraction 3.4 is
-
an infinitely recurring binary
fraction, so that's again shows
-
you some difficulties when it
comes to converting that simple
-
fractions to binary fractions.
So this would be.
-
3.4 in decimal
would be 1
-
one radix .01100110.
-
212345678 places.
-
As I mentioned it in the last
video, this is something that's
-
fundamentally inherent property
of the binary number system. We
-
can't really do anything about
it, but by using more binary
-
digits to represent the decimal
numbers, we can minimize this
-
problem. Let's look
at another simple
-
example, 4.715. Separate
it again to whole and
-
fractional. Part 4 is just 100.
Remember this is 1, two and four
-
and the fractional part will be
0.715. Now let's keep doubling
-
it. 2 * 5 is then carried A1
three times, one is 2 + 1 is
-
three 2 * 7 is 14, so I've got
one of the overflow, so the 1st
-
digit in after the radix point
will be one.
-
Now those two unnecessary
anymore. So double again 2 * 3
-
is Six 2 * 4 is 8, so there
is no overflow. This digit will
-
be at 0.
-
Double it again. 2 * 6 is 12,
carried A one 2 * 8016 + 1 makes
-
17. I've got an overflow here
now, so that's number one.
-
Double it again. 2 * 2 is
four 2 * 7 is 14.
-
So next digit is 1.
-
Double against that digits gone
2 * 4 is eight 2 * 4 is 8
-
no overflow, so this digit
phobia, 0 double 2 * 8 is 16,
-
carried A one 2 * 8 is 16 + 1
is 17. So there is one as an
-
overflow that's gone. Now double
again 2 * 6 is 12, carried A one
-
2 * 7 is 14 + 1 makes it 15,
so I've got one as an overflow.
-
Double again 2 * 2 is
four 2 * 5 is 10.
-
Overflow, so that's another one
-
in there. Times 2 is 8000 is the
next digit? Well, I don't know
-
about you, but I'm getting
exhausted in here and look there
-
is not even a sign anywhere for
a repetition, so this function
-
looks even worse than the
previous one. And again just
-
look at it how simple this is in
decimal. So yes, the binary
-
number system indeed have got
quite a few limitations which
-
can get quite a bit annoying
-
well. What kind of things have
been discovered about the binary
-
number system? Well, basically
we know that not all decimal
-
fractions can be expressed as a
finite binary fraction.
-
Unfortunately, this cannot be
avoided, but can be minimized by
-
using more bids. Also, if you
look at the examples through the
-
video again, you can see that
the radix point is different for
-
different numbers, so the
position of the radix point is
-
changing from number to number.
-
That can get quite confusing for
the computer, but Luckily for
-
this problem we do have a
solution and that is the
-
floating point notation which we
will talk about in more details
-
in one of the following videos.
For now I've prepared some
-
examples for you, so please look
at them. Try them and you will
-
find the answers later, so these
are the practice questions.
-
And here are the answers.