< Return to Video

https:/.../emt121080p.mp4

  • 0:17 - 0:23
    Welcome to the next video in the
    binary series. In the previous
  • 0:23 - 0:27
    video we learned how to convert
    numbers to floating point
  • 0:27 - 0:33
    notation. In this video I will
    show you how to do the other way
  • 0:33 - 0:38
    around, so had to convert a
    floating point notation number
  • 0:38 - 0:42
    back into ordinary decimal
    numbers. So let's say that you
  • 0:42 - 0:47
    are given an 8 bits floating
    point notation, something like
  • 0:47 - 0:53
    1001. 1011 OK,
    now the first step that you
  • 0:53 - 0:56
    would do in here is break
    this code into it
  • 0:56 - 0:59
    constituents break this
    code into its parts.
  • 0:59 - 1:02
    Remember that the first bit
    is the sign bit. That's
  • 1:02 - 1:06
    going to tell you if it's a
    positive or a negative
  • 1:06 - 1:08
    number. The next 3 digits.
  • 1:10 - 1:12
    Is your exponent?
  • 1:13 - 1:16
    And this exponent, these 3
    bits twos complement notation
  • 1:16 - 1:20
    will tell you how many places
    you need to move the radix
  • 1:20 - 1:24
    point either in to the right
    or to the left and the last
  • 1:24 - 1:26
    part. The last four bits.
  • 1:27 - 1:30
    Is your normalized?
  • 1:31 - 1:32
    Month is self.
  • 1:33 - 1:39
    This is the number that you will
    have to apply the exponent two
  • 1:39 - 1:42
    and move the radix point into
  • 1:42 - 1:48
    the right. Place to be able to
    decode the binary number so.
  • 1:49 - 1:56
    Step one. Sign because the sign
    equals to one. We have got a
  • 1:56 - 1:58
    negative number here.
  • 2:02 - 2:03
    Then Step 2.
  • 2:05 - 2:11
    Exponent Our exponent is
    001. Well, that's a positive
  • 2:11 - 2:17
    number because it starts with
    zero and it's positive one. So
  • 2:17 - 2:23
    my exponent is positive one, so
    I will need to move my
  • 2:23 - 2:28
    normalized mantissa one place
    into the positive direction that
  • 2:28 - 2:31
    three. My normalized mantissa is
  • 2:31 - 2:36
    0.1011. Apply the exponent
    two. It move the radix .1
  • 2:36 - 2:38
    in the positive direction.
  • 2:40 - 2:47
    So the number the binary number
    that is given to me here is
  • 2:47 - 2:54
    one data .011. Now I need to
    decode it back into decimal.
  • 2:55 - 3:00
    This is one that's the radix
    point. This is 1/2. This is 1/4
  • 3:00 - 3:05
    and this is an 8. So what I have
    in here is.
  • 3:05 - 3:12
    1 + 1/4 plus an 8. Remember,
    how can we act together?
  • 3:12 - 3:18
    Fractions need to make them to
    be the same denominators, so it
  • 3:18 - 3:24
    will be 1 + 2 eight +18,
    which is altogether one and
  • 3:24 - 3:31
    three eights. And remember,
    we had one to start with,
  • 3:31 - 3:36
    so 10011011 in eight bits
    floating point notation is
  • 3:36 - 3:41
    the same as minus one and
    three eights in decimal.
  • 3:44 - 3:50
    Let's look at the
    next example, which
  • 3:50 - 3:53
    is 11011100 again.
  • 3:58 - 4:03
    The first step is to identify
    the sign. Now the sign is 1
  • 4:03 - 4:06
    again. So we have got a
    negative number.
  • 4:09 - 4:12
    Then Step
  • 4:12 - 4:18
    2. Find
    the exponent.
  • 4:19 - 4:24
    Remember the exponent is 101
    now. This is in three Bits 2's
  • 4:24 - 4:29
    complement, so the 1st digit
    tells me that this is a negative
  • 4:29 - 4:35
    number. So this is a negative
    exponent, so it went through the
  • 4:35 - 4:40
    inversion process. So what I
    need to do to find out what
  • 4:40 - 4:44
    positive equivalent is in here
    is to redo that inversion
  • 4:44 - 4:49
    process, so copy the number
    until you copy the one.
  • 4:49 - 4:52
    Then invert everything else.
  • 4:52 - 4:57
    So that zero becomes one. This
    one becomes a 0, so this will be
  • 4:57 - 5:01
    the positive equivalent of this
    negative number, and the
  • 5:01 - 5:04
    positive equivalent in here
    using the place values.
  • 5:04 - 5:08
    This is equal to
  • 5:08 - 5:15
    R. Three, so this original
    number is negative three, so our
  • 5:15 - 5:17
    exponent is negative 3.
  • 5:17 - 5:20
    And that 3.
  • 5:21 - 5:23
    Using the mantissa.
  • 5:23 - 5:30
    Now the normalized mantissa is
    the last four bits. Remember,
  • 5:30 - 5:37
    it's always starts with 0.1100,
    but what that Azar's done?
  • 5:38 - 5:43
    The exponent was negative three,
    so the computer was stored to
  • 5:43 - 5:48
    move it 3 places to the negative
    direction. So what does that
  • 5:48 - 5:52
    mean? One place to place
  • 5:52 - 5:56
    three places. Filling the zeros.
  • 5:57 - 6:04
    So the original number
    was a very small
  • 6:04 - 6:08
    number O radix .0001100.
  • 6:09 - 6:11
    So what is this number?
  • 6:12 - 6:19
    Use the place values again this
    is 1 radix point or half or
  • 6:19 - 6:25
    quarter on 8R16R32 and the rest
    of them are zero, so we don't
  • 6:25 - 6:31
    really need to bother about
    them. So this number here is
  • 6:31 - 6:35
    basically the sum of the 16th
    and the 32.
  • 6:36 - 6:40
    Again, how can I add
    fractions together? I need to
  • 6:40 - 6:44
    make them to be the same
    denominator, so how can I
  • 6:44 - 6:48
    make 30 twos from sixteens? I
    just need to double it.
  • 6:49 - 6:56
    So it's altogether 3 / 32.
    And remember I had a negative
  • 6:56 - 7:00
    number because my assignment was
    one so one.
  • 7:01 - 7:08
    1011100 As an 8 bits floating
    point is exactly the same as
  • 7:08 - 7:10
    minus 3 / 32.
  • 7:13 - 7:17
    Let's do one more example of
    this floating point notation and
  • 7:17 - 7:19
    let's look at what number is 0.
  • 7:20 - 7:24
    101
    1011
  • 7:26 - 7:30
    Step one, find
  • 7:30 - 7:37
    the sign. The
    first bit is 0, so this
  • 7:37 - 7:39
    is a positive number.
  • 7:41 - 7:44
    Then comes Step
  • 7:44 - 7:52
    2. Using
    the exponent.
  • 7:53 - 7:55
    Now our exponent.
  • 7:56 - 7:57
    Is 101.
  • 8:00 - 8:02
    Which is a negative number.
  • 8:02 - 8:07
    So again, going through the
    inversion process copied the
  • 8:07 - 8:11
    number until your Capital One,
    then invert everything else.
  • 8:12 - 8:15
    And. This is again.
  • 8:16 - 8:20
    Positive three so this is still
    negative. 3 The difference here
  • 8:20 - 8:25
    now will be that my month is a
    is slightly different, so let's
  • 8:25 - 8:29
    look at the last step and deal
    with the mantissa.
  • 8:30 - 8:36
    So I'm normalized mantissa
    is 0.1011. The computer
  • 8:36 - 8:43
    was told to move
    this mantissa or the
  • 8:43 - 8:49
    radix point. Three in the
    negative direction, so it would
  • 8:49 - 8:51
    need to move it 123.
  • 8:52 - 8:59
    So 0.00.
    So the original
  • 8:59 - 9:05
    number was 0.0001011.
    The accompanying place
  • 9:05 - 9:11
    values are one
    radix point 1/2
  • 9:11 - 9:17
    or quarter an
    8 or 16
  • 9:17 - 9:20
    or 3264 and
  • 9:20 - 9:28
    128th. So I need to
    talk together. Now is 1 / 16 +
  • 9:28 - 9:34
    1 / 64 + 1 / 128. Now
    again to be able to add them
  • 9:34 - 9:41
    together I need to get them all
    to be the same denominator. Now
  • 9:41 - 9:46
    this is a common denominator
    because I can get 228 from
  • 9:46 - 9:48
    doubling all of them but at
  • 9:48 - 9:51
    different numbers. So from.
  • 9:53 - 10:00
    16 to get 228 what I've done. I
    doubled 123 times. So that is
  • 10:00 - 10:07
    basically 16 * 8 going to give
    me the 128. So what this is
  • 10:07 - 10:15
    telling me that 8 / 128 is the
    same as 1 / 1664 and 120. There
  • 10:15 - 10:22
    is only one doubling point in
    here, so that is just 2 / 128.
  • 10:22 - 10:29
    Plus 1 / 128, so
    this is altogether giving me
  • 10:29 - 10:36
    8 + 2 is 10
    plus one is 11 /
  • 10:36 - 10:41
    128 so 01011011 in eight
    bits within point.
  • 10:42 - 10:47
    Is the same as 11 / 128?
    Remember this time it was zero,
  • 10:47 - 10:51
    so this is a positive number and
    for positive numbers we don't
  • 10:51 - 10:53
    write out the positive sign.
  • 10:54 - 10:58
    Now we went through the 8 bits
    floating point notation and you
  • 10:58 - 11:01
    might find it still a little bit
    confusing. That's absolutely
  • 11:01 - 11:05
    fine, because this is like an
    orchestra you pulling together
  • 11:05 - 11:08
    everything that you've learned
    about binary numbers. So you
  • 11:08 - 11:11
    putting together the two bits
    complement notation, some normal
  • 11:11 - 11:14
    mathematical knowledge about
    moving decimal places applied 2
  • 11:14 - 11:19
    in binary numbers and so on. So
    this is probably one of the most
  • 11:19 - 11:23
    difficult questions that you can
    get in binary numbers, but once
  • 11:23 - 11:25
    you understand them then you
    will really know.
  • 11:26 - 11:29
    What needed to be known
    about this system, and
  • 11:29 - 11:32
    you know how the computer
    looks at the binary code.
  • 11:33 - 11:38
    And now it is your turn to try
    these conversions. You will find
  • 11:38 - 11:42
    the answers to these questions
    shortly after the questions
  • 11:42 - 11:45
    appear. So these are the
    practice questions.
  • 11:51 - 11:53
    And here are the answers.
Title:
https:/.../emt121080p.mp4
Video Language:
English
Duration:
12:23

English subtitles

Revisions