IEEE 754 Standard for Floating Point Binary Arithmetic

Поделиться
HTML-код
  • Опубликовано: 29 июн 2024
  • This computer science video describes the IEEE 754 standard for floating point binary. The layouts of single precision, double precision and quadruple precision floating point binary numbers are described, including the sign bit, the biased exponent and the mantissa. Examples of how to convert between denary (base 10) and single precision floating point binary numbers are shown, including how to round the mantissa correctly. There are also some example conversions that you can try yourself, along with their solutions. The way the exponent bias works and why this particular technique is used in the IEEE 754 standard, rather than two’s complement, is demonstrated. Some reserved exponent values are also mentioned.
    0:00 Introduction
    0:14 Review of fixed point binary
    1:02 Review of floating point binary using two's complement
    2:44 The IEEE 754 standard
    4:08 Conversion from denary to single precision floating point binary
    8:25 The exponent bias
    13:42 Example conversions and solutions

Комментарии • 231

  • @MuyenKamran1nehal
    @MuyenKamran1nehal 3 года назад +71

    This is amazing. You explained in 20 minutes what my professor could not in 90 minutes.

  • @neolord50pro77
    @neolord50pro77 3 года назад +62

    How scared and ignorant i was about those floating points, but now i'm feeling enlightened and empowered with knowledge. Thank you!

    • @ComputerScienceLessons
      @ComputerScienceLessons  3 года назад +8

      That's music to a teacher's ears :)KD

    • @vit6723
      @vit6723 3 года назад

      @@ComputerScienceLessons what if the given would be .12?

  • @jbkhan1135
    @jbkhan1135 4 года назад +139

    This channel is so incredibly underrated... I wish every compsci student would subscribe to this. I know I could have used it in my uni days. Great work and keep it up!

    • @ComputerScienceLessons
      @ComputerScienceLessons  4 года назад +19

      It's very kind of you to say so. Thank you :)KD

    • @f.e.febriansyahpusatedukas8816
      @f.e.febriansyahpusatedukas8816 3 года назад

      @@ComputerScienceLessons 6:44 why the number is chage (19.5.. to 19.5)?
      btw, i think the voice volume is too low 🙏

    • @raffaelechinotti5244
      @raffaelechinotti5244 2 года назад

      @@ComputerScienceLessons i totally agree with him, BECAUSE I AM in university goddamn it can't you be my professor? :l

  • @jannesvanquaillie9151
    @jannesvanquaillie9151 4 года назад +65

    I really started to hate floating-point numbers after trying to do math with it.
    But you helped me appreciate it.
    This video is SO SUPER good.
    Few people are so good at what they do, know what they are talking about AND can even explain it; in your case, you are really good at all of them.
    Truly, you are probably one of the reasons that my passion for these kinds of things is so upfront.

  • @gabrielruszala4432
    @gabrielruszala4432 Год назад +4

    This guy's channel name is literally "Computer Science." Epic.

  • @NoName-tj8dm
    @NoName-tj8dm Год назад +12

    By far the best explanation on IEEE 754 and on biased exponent. It's really remarkable that you explained in a lucid manner. Thank you for the series on binary too.

  • @ganeshharikrishnan
    @ganeshharikrishnan 3 года назад +22

    I've followed this channel for about 2 years now. It's genuinely incredible how he has the capacity to simply the most complex procedures into a single set of steps

  • @bobdemp8691
    @bobdemp8691 2 года назад +5

    Really good. 20 years ago this went over my head and always meant to revisit it. Very clear explanation.

  • @annilator3000
    @annilator3000 Год назад +1

    that's the most comprehensive video I could find on this topic, great job

  • @LoudnessWar
    @LoudnessWar 3 года назад +2

    I signed in to RUclips after an eternity solely to post this - your explanation of the Two's Compliment sign bit at 9:41 is absolutely brilliant and intuitive. Well done; it's so simple: the MSB becomes its normal value except negative, and the conversion to decimal "Just Works." I wish I had seen that when I was first learning binary formats as a kid - it's SO much easier to think of it that way than the whole "count backwards from all 1's" way I had conceived of it before.

    • @ComputerScienceLessons
      @ComputerScienceLessons  3 года назад

      Thank you for taking the time to post such a lovely comment. It makes it all worthwhile. :)KD

  • @florisvanderhout2675
    @florisvanderhout2675 3 года назад +3

    just WOW, you are incredible. I just started with my first year of computer science and this video made everything sooooo clear. I subscribed. So keep up the good work.

  • @hayden.A0
    @hayden.A0 4 года назад +5

    Thanks again. Floating point numbers were always very confusing to me until I found your channel

  • @clarencedomond5837
    @clarencedomond5837 3 года назад +1

    This channel is a goldmine, you are saving lives sir please do not stop making videos!

  • @segafrompk
    @segafrompk 4 года назад +6

    This makes it really clear why simple math operations with floating point numbers sometimes give weird X.99999999 results. Great video!

  • @poserGirl863
    @poserGirl863 3 года назад

    this is such a good video! I never had the idea of using what you call the "modified gadget" for the place values of 2s complement numbers. I came here thinking I knew my 2s complement and I'm leaving having learned not only the standard for floating point numbers, but an incredibly valuable tool for working with 2s complement. Thank you!

  • @swedishguyonyoutube4684
    @swedishguyonyoutube4684 2 года назад +2

    4:08 is an incredibly well thought out, easy to follow, pedagogical explanation of conversion! Thanks a bunch!

  • @kellerw4800
    @kellerw4800 Год назад +1

    Thanks so much for this video, excellently paced for taking notes and really absorbing and understanding the information, with lots of great explanations as to WHY steps are taken. TY

  • @roshanafernando2443
    @roshanafernando2443 2 года назад

    Well explained. Worth watching the video. Keep on doing this. All the best!

  • @Sciller4
    @Sciller4 3 года назад +7

    Every year, I go on CS competitions (and usually do quite well, I was second in Croatia once), but I could never remember how to use this standard or why things were how they were. Thank you for that!

  • @estefaniac8260
    @estefaniac8260 3 года назад +1

    Thank you so much for your detailed explanation. It is excellent and exactly what I was looking for to understand this topic.

  • @xinguangmingwo2343
    @xinguangmingwo2343 3 года назад +2

    Your video taught me IEEE 754. Thank you.

  • @MIbrahimKh
    @MIbrahimKh 3 года назад +2

    Really made me "floating" with joy, thanks teacher!

  • @ieatnoodls
    @ieatnoodls 2 года назад +2

    Explanation clear as the sky, thank you

  • @Rahul-fq9kf
    @Rahul-fq9kf 2 года назад

    Very thankful to you for explaining it so well.

  • @nitinrawat4522
    @nitinrawat4522 2 года назад +1

    Nicely and neatly explained! Got all my answers from the single video. Keep up the good work! XD

  • @LuchsYT
    @LuchsYT 2 года назад +2

    TYSM! This finally made me understand the IEEE 754 standard for floating point numbers!

  • @kannadiga3644
    @kannadiga3644 2 года назад +1

    excellent session, crisp and complete coverage..

  • @aprendendoaainvestir
    @aprendendoaainvestir 3 года назад +2

    Mate, this is brilliant! I am a medical professional trying to grasp the basics of computer anatomy and physiology if you will, and your videos really make everything much more organic! Thanks for this amazing content! I'm looking forward to watching the other series in your channel.

  • @raghunathprabhakar2166
    @raghunathprabhakar2166 Год назад +1

    Thank you so much for explaining this in such a concise manner

  • @varma8669
    @varma8669 Год назад

    This was a very helpful video. Came in clutch right before the due date. Thank you!

  • @notgiven3971
    @notgiven3971 2 года назад +1

    I would just like to say thank you for this video it was very helpful for my upper div assembly lab assignment on this topic. Thank you for the video!

  • @parsiabolouki7685
    @parsiabolouki7685 3 года назад

    Amazingly great explained! Thank you

  • @JamesBrodski
    @JamesBrodski 2 года назад +1

    Wow, what an amazing video. Thank you so much.

  • @RawFatGod
    @RawFatGod 10 месяцев назад

    You explain it so clearly

  • @pinch-of-salt
    @pinch-of-salt 3 года назад +2

    More IEEE standard videos!!! Thank you so much. VonC explained it great on stackoverflow but I still referred to this video!

  • @user-gy8co1gk8o
    @user-gy8co1gk8o 11 месяцев назад

    Very good explanation, thanks!

  • @victorlucki8586
    @victorlucki8586 4 года назад +3

    Loved it! Thank you, as always!

  • @Thomas-ht9cn
    @Thomas-ht9cn 2 года назад +1

    Thank you, sir! This video really helped me grasp the concept.

  • @spacemule1
    @spacemule1 3 года назад

    High quality! Thanks brother

  • @user-om2ev8wz6g
    @user-om2ev8wz6g 3 года назад +1

    Thank you Kevin Drumm for this amazing video

  • @ghattassaliba4910
    @ghattassaliba4910 Год назад +1

    I love your work and explanation, you deserve to be the president 💪💪

  • @user-fg6ng7ej6w
    @user-fg6ng7ej6w 2 месяца назад

    very clear explanation thanks !

  • @MCMeru
    @MCMeru 3 года назад +1

    Incredibly well explained!!!

  • @swun3367
    @swun3367 2 года назад

    your way of saying Mantissa is just so perfect. has to be said.

  • @fromthebeattothesaber1419
    @fromthebeattothesaber1419 3 года назад

    Thanks a lot for this great explanation
    I am from Germany and i am currently playing with the x32 osc software which uses these floation points to control the faders of each single channel
    There is no open source javascript implementation of this calculation on the internet
    And also no good explanation
    With the help of this video I've managed to create my own conversion function
    Thanks a lot

  • @alphanumeric2702
    @alphanumeric2702 4 года назад +2

    Brilliant presentation!

  • @rpop7911
    @rpop7911 3 года назад +1

    Very well explained, thank you so much!

  • @izotovadaria7151
    @izotovadaria7151 3 года назад +1

    Thank you so much! This is so helpful for my classes!

  • @realtissaye
    @realtissaye 2 года назад +1

    DUDE THIS VIDEO IS SO AWESOME

  • @alikhaled844
    @alikhaled844 7 месяцев назад

    The exponent bias part was masterful..

  • @petar7867
    @petar7867 2 года назад +1

    Video is very easy to understand, thank you very much!

  • @YnjeviYhhei
    @YnjeviYhhei 3 года назад

    Very well explained thank you

  • @elchemico100
    @elchemico100 3 года назад

    Really helpful tutorial! Thank you very much!

  • @axelboy9080
    @axelboy9080 2 года назад +1

    it was wonderful..
    you taught me Sth..
    I LOVE YOU !

  • @stopthecap8810
    @stopthecap8810 Год назад

    This is such a phenomenal video. The pace at which the animations/charts line up with your words greatly help with understanding this. To be honest, your channel is like a wikipedia for basic data representation, and should be something every teacher recommends. The only question is what exactly do you mean by 'the value of the exponent specifies how far to the left or to the right the binary should float to obtain the value in the register?' That part wasn't clear. Do you mean how much it should float to determine the mantissa? Also, what part of the floating point concept tells us where the 'decimal' starts? Is it the exponent?

  • @tadikasxd9546
    @tadikasxd9546 2 года назад +1

    Amazing video, Thank you so much

  • @slava_in3757
    @slava_in3757 2 года назад +1

    Amazing explanation to say the least!

  • @ahmadhosseinzadeh3141
    @ahmadhosseinzadeh3141 3 года назад

    Thanks for the splendid video!
    Will you record a video on rounding up/down the floating point formats and the associated errors?

  • @roman_mf
    @roman_mf 2 года назад +1

    Thank you so much, an explanation well done!

  • @ErosMarques
    @ErosMarques 3 года назад

    thanks, this was really helpful!

  • @from2Dto3Dto4D
    @from2Dto3Dto4D 3 года назад +1

    thanks, very helpful and concise

  • @randyzakyasuchrady1488
    @randyzakyasuchrady1488 3 года назад +1

    Thanks for the explanation!

  • @koraltayeb8681
    @koraltayeb8681 3 года назад +1

    FANTASTIC!! THANK YOU

  • @larrywu8977
    @larrywu8977 3 года назад +1

    Really Really helpful, thank you!

  • @fkarls9282
    @fkarls9282 4 года назад +1

    A really good explanation and a nice visualisation, great video. Can you also make a video about the Quine-McCluskey method ?

    • @ComputerScienceLessons
      @ComputerScienceLessons  4 года назад

      I'll take a look at it. Sounds like an interesting programming project. :)KD

  • @marouaabdi611
    @marouaabdi611 3 года назад +1

    Thank you for your brilliant explanation sir , but I have a question . in the last two examples when we converted the number 123 to binary , why one started with 01 and the other with 11 ?

  • @Antagon666
    @Antagon666 Месяц назад +1

    This is one of the nicer takes

  • @ofd3769
    @ofd3769 2 года назад +1

    u are the best one thanks a lot

  • @TurgutKalfaoglu
    @TurgutKalfaoglu 5 месяцев назад +1

    very good thank you!

  • @jessebelleman8070
    @jessebelleman8070 3 года назад +1

    You are a legend!

  • @fay7725
    @fay7725 3 года назад +2

    I'm recommending this video to my college friends. Thank you so much
    Edit : also, you got a new subscriber

  • @singmantkpss
    @singmantkpss 2 года назад +2

    Thx god i found this gem

  • @yiming9569
    @yiming9569 2 года назад +2

    Could you explain why the normalization of the mantissa is "1.1 * 2^-4" instead of "0.11 * 2^-3" as you explained that normalization for positive numbers should be in the form of 0.1xxxxxx * 2^x in the video of "Binary 6 Normalized Floating Point Binary Fractions"?

  • @rosiRose676
    @rosiRose676 3 года назад +1

    Thank You !!!!

  • @lilultime6555
    @lilultime6555 2 года назад +1

    So good

  • @bakaphu1992
    @bakaphu1992 2 года назад +1

    at 06:46 the header changes from example 19.5375 to 19.25 randomly, even though the example is still done with the first number.

  • @maxhmetonxrono
    @maxhmetonxrono 3 года назад

    Thank you for the amazing video you are very good Teacher!!! I want to ask why we div with 2^-118 at 20:27
    ???

  • @oviya.n1317
    @oviya.n1317 Год назад +1

    excellent

  • @mattstyles4283
    @mattstyles4283 3 года назад

    Great video! Why is the leftmost bit of the mantissa always 1? And how is this different to the 0.1 / 1.0 rule of normalised floating point binary?

    • @mattstyles4283
      @mattstyles4283 3 года назад

      Is it something to do with the fact that IEEE format separates the sign bit?

  • @mdrezaulkarim47
    @mdrezaulkarim47 3 года назад +1

    wow..its awesome

  • @brascoarts2634
    @brascoarts2634 3 года назад +2

    If you think about it, there's always gonna be 1 at the end💥

  • @kendalwilliams5128
    @kendalwilliams5128 4 месяца назад +1

    Thanks!

  • @bakaphu1992
    @bakaphu1992 2 года назад

    thank you! I think at 14:49 it's rather how many places you have to get to the right instead of left right? step 3

  • @pataruutu1
    @pataruutu1 2 года назад +1

    i, and many others i suppose, would appreciate if you could do a video on guard, round and sticky bits.

  • @xianhui5302
    @xianhui5302 2 года назад +1

    thank you T.T

  • @lucaspaiva8410
    @lucaspaiva8410 Год назад +1

    Obrigado amigo você e Jesus são quase a mesma pessoa, salvou muito

  • @Lights.Camera.ActionYT
    @Lights.Camera.ActionYT Год назад

    Please represent 0.1 + 0.2 in IEEE 754 format and also how to equate exponents if we have -4 and -3

  • @Karim-nq1be
    @Karim-nq1be Год назад +1

    Your video is great. One of the most boring stuff I had to learn in my life.

  • @saiankitsahoo3944
    @saiankitsahoo3944 2 года назад

    BRILLIANT . PERIOD
    SAY NO MORE

  • @bradthompson1209
    @bradthompson1209 2 года назад

    I would have liked to see you convert -3.303139... E-36 back to a 32 bit binary number. I am struggling with how to deal with the base 10 exponent. It's not obvious to me yet.

  • @chidon7465
    @chidon7465 4 года назад +2

    Ah now it works!

  • @keonscorner516
    @keonscorner516 3 года назад

    That’s the IEEE 754 floating point double precision 32-bit format
    can you explain IEEE 754 floating point double precision 64-bit format

  • @tungtruong9232
    @tungtruong9232 Год назад

    very helpful, but why in your first example, you want to convert the value 19.25 to binary but in step 2 you also use 19.59375, can you explain me, very thanks, you lesson is very valuable

  • @HexadecimalDump
    @HexadecimalDump Год назад +1

    Do you know where I can read more about this theory of converting denary number to pure binary, or maybe you could explain it? I understand why repeatedly dividing whole part by 2 works, but I can't understand how repeatedly multiplying fractional part by 2 gives us binary representation. I really want to understand this part and not just memorise it

    • @ComputerScienceLessons
      @ComputerScienceLessons  Год назад

      I think converting between binary and denary by successively multiplying or dividing by two is nice 'trick' but I prefer to teach binary from first principles. It's important to realise that each bit has a place value. Perhaps my binary playlist will help. ruclips.net/video/cJNm938Xwao/видео.html :)KD

  • @shahebmiah2492
    @shahebmiah2492 3 года назад

    Why is there a remainder 1 after when no division took place? could i please know

  • @shahebmiah2492
    @shahebmiah2492 3 года назад

    I haven't spent so long on a topic like this. Looks so simple but so confusing.

    • @ComputerScienceLessons
      @ComputerScienceLessons  3 года назад

      It may be worth going back to the start of my playlist on binary and working your way through theses. This video is the last in a series.

    • @shahebmiah2492
      @shahebmiah2492 3 года назад

      @@ComputerScienceLessons from this video i put everything together with what i learned and i understand it now. Thank you

  • @Voeris
    @Voeris 3 года назад +1

    Wow, this is so useful and thorough!
    I was just trying to convert -670.90 to binary on paper and wondering why I got the last three bits of the mantissa as 001 while online converters keep showing 010. But your excellent explanation at 17:13 provided the answer.
    Thank you so much Sensei! ( ̄人 ̄)

  • @imraulemmaka511
    @imraulemmaka511 3 года назад +1

    What is a fixed-sized register?? Could you link any related resource, please? and in the beginning, you said -" the value of exponent specifies how far to the left or the right the binary point should float in order to obtain the actual value in the register." - Could you please explain "register" here? is the value in register or what!!

    • @ComputerScienceLessons
      @ComputerScienceLessons  3 года назад

      A register is the smallest unit of storage found in the CPU. In an older machine, a register could hold 32 bits. Modern machines have 64 bit registers (or even 128 bit registers). Registers are always fixed in size. I pointed out that they were fixed in size to emphasise that register size imposes a limitation on the size of the number it can store. I strongly recommend that you take a look at my playlist on binary which explains this in more detail. ruclips.net/p/PLTd6ceoshprcpen2Jvs_JiuvWvqIAkzea :)KD

  • @rohitpant6473
    @rohitpant6473 3 года назад +1

    Thanks :)

  • @mohamedjimale9258
    @mohamedjimale9258 6 месяцев назад

    i'm confused on the last question of this video, where did you get 10 to the -36 from when you were times it by -3.3031391268106278973921496695945?