< Return to Video

https:/.../emt071080p.mp4

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

English subtitles

Revisions