HOW TO: Convert Decimal to IEEE-754 Single-Precision Binary

Sdílet
Vložit
  • čas přidán 28. 08. 2024
  • Quick links:
    0:35 - Convert 45 to binary
    1:59 - Convert 0.45 to binary
    4:46 - Normalization
    6:24 - IEEE-754 format
    7:28 - Exponent bias
    10:25 - Writing out the result

Komentáře • 221

  • @thornclawofwarriors
    @thornclawofwarriors Před 7 lety +501

    "If you were going to get a hundred on the exam, you wouldn't be watching this video"
    OUCH, LOL.
    I know its the truth, but still... ouch.

    • @giorgibujiashvili3942
      @giorgibujiashvili3942 Před 6 lety +10

      can confirm, can't get a hundred. will report back once the test is done.

    • @kev814445
      @kev814445 Před 6 lety +5

      It made the video more interesting...your humor was greatly appreciated during this stressful time :-)

    • @Miraclefruitify
      @Miraclefruitify Před 5 lety +7

      @@richardma3187 Jeez, chill bruh. It's just a joke

    • @ajimatsmail5686
      @ajimatsmail5686 Před 5 lety

      Teu ngarti aing bngst:(

    • @ashishdaniel169
      @ashishdaniel169 Před 5 lety +2

      @@giorgibujiashvili3942 still waiting for that report

  • @Yunho_Park
    @Yunho_Park Před 5 lety +71

    woah woah I didn't ask to be personally attacked watching a youtube tutorial video lmao

  • @DragonDePlatino
    @DragonDePlatino Před 6 lety +27

    Thank you so much! This was an immense help and I wasn't able to find such a straightforward explanation anywhere else.

  • @EMMIR_KC
    @EMMIR_KC Před 7 lety +88

    The best video i've seen discussing this topic so far!

  • @JayoomJay
    @JayoomJay Před 6 lety +16

    In case someone is wondering why there is a need to use bias. It is to make fast magnitude comparison of floating point numbers possible in hardware.
    By using a bias we are effectively avoiding the need to store the exponent as negative numbers. If we had allowed the exponent to be stored as negative number (probably as a 2's complement), then during the occasion when there is a need to compare two exponents of two FP numbers, we need to obtain the magnitude of the 2's complement representation of the exponent by performing the 2's complement (need CPU cycles) operation (this is how you obtain the magnitude of a negative number represented in 2's complement form. If the number was represented in sign magnitude form, bits other than the sign bit would have directly given the magnitude) So if there is a bias, we can just forget about the negatives and just compare the bits of two exponents and say which one is larger.

  • @mrarcticaaa1101
    @mrarcticaaa1101 Před 5 lety +10

    Thank you so much. I definitely wouldn't be able to graduate without youtube. I'm glad I'm studying university at this decade :D

  • @alexbourlis
    @alexbourlis Před 6 lety +37

    love your way of explaning mate, i think you meant the only way to score 100 is to watch your video ;)

  • @johnrex9612
    @johnrex9612 Před 5 lety +7

    That video will help me to get 100/100 on exam. Thanks from Poland

  • @heron_
    @heron_ Před 6 lety +1

    This was the best explanation ever. Why couldn't my professor break it down this simply. Thanks for this video.

  • @vinayak8100
    @vinayak8100 Před 5 lety +2

    Watching this from India- there's like hundreds of tutorial vids on this topic from Indian channels and none is half as good as this one.
    Thanks a lot sir :D

  • @g0ballistic
    @g0ballistic Před 5 lety +2

    You're a legend. Best video about IEEE-754 on youtube.

  • @standinonstilts
    @standinonstilts Před 6 lety +7

    Ma boi steven roasting these kids expecting him to be perfect, love it

  • @mitchallcowell5166
    @mitchallcowell5166 Před 6 lety +6

    this saved my ass before an exam, great video

  • @TheFlyguy31
    @TheFlyguy31 Před 6 lety +1

    Definitely the best 'pencil-pen' i've seen.

  • @LaplacianFourier
    @LaplacianFourier Před 5 lety +2

    WHOA... when some guy out of a billion in the internet you've searched is using the same pencil as you.... pffssshhh MIND BLOWN!

  • @foobar_eve8813
    @foobar_eve8813 Před 7 lety

    I wish you were my Comp Org TA! :-D You're delightful, and your videos are outstanding.

  • @ns_down
    @ns_down Před 7 lety +1

    Saving me for my final exams mate, thank you.

  • @calvinlan6568
    @calvinlan6568 Před 4 lety

    ditching my professor's video in favor of some random guy on youtube
    -seriously though, thank you for making this easier to understand

  • @volodymyrzmazhenko4060

    Thank you, Steven, it help me to understand IEEE 754 much more better than others!

  • @deshanesims2196
    @deshanesims2196 Před 3 lety

    this is the BEST explanation of floating point!!! thank you Steven!

  • @krullebolalex
    @krullebolalex Před 6 lety

    Thanks a bunch! Very helpful, straight forward and clear. Other videos try to explain the concepts behind them too but that just confuses people.

  • @saturdaysportscentral6129

    Watched this for my exam today, no way you had the right to drag me like that😭 1:17

  • @badong4878
    @badong4878 Před 6 lety

    you might have just saved my finals thanks

  • @klauspeter2199
    @klauspeter2199 Před 3 lety

    9:58 that arrow is sooooo smooth!

  • @fruitlover7073
    @fruitlover7073 Před 4 lety

    finally someone who speaks english

  • @JoseFloresEC
    @JoseFloresEC Před 4 lety

    woah, very helpful, thank you so much :) literally couldn't find anything else anywhere else online

  • @Xudas
    @Xudas Před 3 lety +35

    Pov: You came from tintok

  • @PerpetuallyTiredMillennial
    @PerpetuallyTiredMillennial Před 11 měsíci

    "If you were going to be getting 100% on the exam, you wouldn't be watching this video." Out here sayin what every TA wants to say, hope you're doin well.

  • @kucuksamuray
    @kucuksamuray Před 7 lety +1

    Thanks for your video Man, very helpfull really. Im watching you from France, keep going

  • @aldrinaldrinald
    @aldrinaldrinald Před 4 lety +1

    Best video bro..
    Thank you so much 🙂🙂👍👍👍

  • @joaquincandalaft2124
    @joaquincandalaft2124 Před 7 lety

    awesome explanation, quite short and totally clear

  • @KansasFashion
    @KansasFashion Před 6 lety

    The best Video I've ever seen about that

  • @AC-fi8ge
    @AC-fi8ge Před 8 měsíci

    You are AWESOOOOOME ! 10/10

  • @tomislavvinkovic6652
    @tomislavvinkovic6652 Před 6 lety +12

    How is 5 equal to 132?

    • @0fficialRatedR
      @0fficialRatedR Před 6 lety +3

      he added to 127

    • @opatechnus
      @opatechnus Před 6 lety

      what he converted to binary and how

    • @puskalpulami8246
      @puskalpulami8246 Před 6 lety +3

      at first, he just added exponent(i.e, 5) with 127. And their sum is 132. Then he converted 132 (132 is decimal numbers) to binary numbers.

  • @Tibia390
    @Tibia390 Před 5 lety

    Thanks Bro!!!! You helped myself. I'm Brazilian spectator.

  • @adamroach43
    @adamroach43 Před 6 lety

    Very helpful and well explained. Thanks!

  • @rosiebahrani9895
    @rosiebahrani9895 Před 5 lety +1

    Good for you! What university do you TA for? I wish our TAs did that for us too. :)

  • @justdledfruitloops
    @justdledfruitloops Před 6 lety

    Very clear explanation! Thanks alot!

  • @Akatsuu
    @Akatsuu Před 6 lety

    THANK YOU
    MY PROFESSOR COULDN'T EXPLAIN THIS FOR SHIT

  • @azizko2046
    @azizko2046 Před 4 lety +3

    Is this CasuallyExplained?!

  • @DrNinjaPhDofPAIN
    @DrNinjaPhDofPAIN Před 7 lety

    Outstanding, thank you for this

  • @nafisah9499
    @nafisah9499 Před 2 lety

    "If you were going to get 100 on this exam, you wouldn't be watching this video"
    way to be discouraging lol

    • @stevenpetryk6869
      @stevenpetryk6869  Před 2 lety

      Don’t take it too seriously! I made this video to help my students get 100’s :)

  • @ezzermaya4082
    @ezzermaya4082 Před 5 měsíci

    thanks! my exam is tomorrow :~)

  • @tooru
    @tooru Před 5 lety

    got 100% thanks to this video

  • @maxgobel
    @maxgobel Před 7 lety +7

    Are you the voice behind Casually Explained?

    • @ProductionsOfPauls
      @ProductionsOfPauls Před 7 lety

      I was thinking the same thing haha

    • @halio8012
      @halio8012 Před 6 lety +4

      He even makes the same jokes... How many channels does this guy have???

  • @leogourbin9752
    @leogourbin9752 Před 3 lety

    You saved my life dude !

  • @edwinsanchez4973
    @edwinsanchez4973 Před rokem

    "If you were going to get 100 on this exam, you wouldn't have to watch this video. Anyway-" 1:23. Did not need to do us like that my man

  • @andrewbrenner9375
    @andrewbrenner9375 Před 5 lety

    Wonderfully explained 😅

  • @jennyggf3556
    @jennyggf3556 Před 5 lety

    Excellent explanation

  • @unicorn8533
    @unicorn8533 Před 4 lety

    Thank you so much

  • @danielmapiti6891
    @danielmapiti6891 Před 6 lety

    Steven, when recording the results at the end, on the mantissa, why didn't you consider the fact that 1100 is repeating?

  • @mehdibadaoui1658
    @mehdibadaoui1658 Před 7 lety

    really appreciate the video

  • @BsharatAhmed
    @BsharatAhmed Před 5 lety

    thank you man your the best !!!

  • @rishiupadhyay3956
    @rishiupadhyay3956 Před 3 lety

    Pencils are important. Indeed!😊😊

  • @GidMightyWarrior
    @GidMightyWarrior Před 7 lety

    Amazing, thank you so much

  • @stephennnamani8647
    @stephennnamani8647 Před měsícem

    My teacher always want us to normalize the mantissa... why?

  • @katrinagonzales1575
    @katrinagonzales1575 Před rokem +1

    How did you get the binary of 132? I don't get it:((( help

  • @hekk_tech5975
    @hekk_tech5975 Před 4 lety

    my professor makes a test with more exercises (110%) than usual but in the same amount of time with the amount of exercises for 100% so that more students can hit 100% :)

  • @hadyabdel-fattah5810
    @hadyabdel-fattah5810 Před 5 lety

    You sir are awesome

  • @tiffany3255
    @tiffany3255 Před 6 lety

    SUPER HELPFUL

  • @SuperCracker123456
    @SuperCracker123456 Před 5 lety +2

    I'm really confused. So they decided to bias an exponent. Why didn't they just used 8-bit signed number for it?

    • @Matthew.Sweeney
      @Matthew.Sweeney Před 5 lety

      Partly, I think because it is less efficient. For example, you would wind up wasting multiple values to represent zero (positive zero = 00000000 and negative zero = 10000000).
      The reason it is not 2's complement is because the circuitry would be more complicated than just having an extra step of subtracting 127.

  • @timi_LoL
    @timi_LoL Před 2 lety

    Very "encouraging" words.

  • @shanegrayson7068
    @shanegrayson7068 Před 5 lety

    Dude, ty you so much!

  • @serkan3743
    @serkan3743 Před 6 lety

    Karrrrdeşimmm biliyorsun bu hayatı

  • @patelav21
    @patelav21 Před 5 lety +3

    Hello,
    Can you help me on this one -0.045625(ten) to binary? I tried doing it your way. But I'm trying to do it without calculator since our professor don't allow it. Can you show me?

  • @mustafaahmadov3896
    @mustafaahmadov3896 Před 2 lety

    hello , i dont get last three 1100,why you add?okay you want to get 23 bit ,but why 1100?

  • @AkashSingh-pu4dc
    @AkashSingh-pu4dc Před 7 lety

    Thanks Steven 👍

  • @somefuckstolemynick
    @somefuckstolemynick Před 6 lety

    What would I search for to find a video explaining the math behind that nifty little technique he's using to get the binary (the multipying with two table)?
    I'm not in computer science in case you wondered. ;)

  • @darksynthesis1273
    @darksynthesis1273 Před 7 lety +25

    The bias is 127 not 255

    • @darksynthesis1273
      @darksynthesis1273 Před 7 lety

      Yep! 7:44

    • @danteeep
      @danteeep Před 6 lety +2

      2^8 -1 = 127 For the listeners(like me) that got confused or dont know what is going on. we use (2^8)-1 cause its 32 bit so (S^k) - 1 becomes 2^8 -1 . if it was 8 bit then k=3. so the exponent part is whatever you got on top of 2^this. and the (2^8) -1 . so its 5 + 127 = 132 . transform that into binary and voila you got your exponential. so sign + exponential + mantisa and you re good to go

    • @brianvandenberg4467
      @brianvandenberg4467 Před 6 lety

      Whoa this 127 reminds me of loopback....255 reminds me of multicast “Broadcasting” Or portion of Network....Or...SubNet....
      Don’t get me started on those “Admin” or “Research” Numbers that always return inAdd-ARPA..”Advanced Research Projects Agency...Or DARPA “Defense” Advanced Research Projects Agency....We gonna use this “New” Nanotechnology to cure CANCER & provide safe FOOD & WATER....
      Or you “Defense” & “Research” Folks on the Take....North & South America going to get FOOD dropped in by air....
      Like Africa et al “Hellenism” for profit....

    • @brianvandenberg4467
      @brianvandenberg4467 Před 6 lety

      Why has Law Enforcement Not stepped in....?

    • @Rayyankhantheboss
      @Rayyankhantheboss Před 5 lety

      Guys just to clarify the bias = 2^(8-1) - 1 = 127

  • @OMNI_INFINITY
    @OMNI_INFINITY Před 8 měsíci

    Thanks!

  • @thomaswolf1143
    @thomaswolf1143 Před 7 lety

    45 is a palindrome number in binary. So reading in opposite order isn't really explained.

  • @minsookim13
    @minsookim13 Před 11 měsíci

    Heyy Steven, what if it is a negative decimal

  • @aditopguy9785
    @aditopguy9785 Před 10 měsíci

    Which textbook do you recommend?

  • @joecomplexgeometricshapesr3348

    Hey Steven great video, but does the exponent always equal 132? What is the significance of the 5 and the 132 , thanks
    EDIT Nevermind just got it lol

    • @exoxDiD
      @exoxDiD Před 7 lety

      wait I still don't ;;

    • @sorrefly
      @sorrefly Před 7 lety +3

      The exponent is coded in excess 127, so you just add 127 to the value of the actual exponent
      5 + 127 = 132
      keep in mind while converting back from iee754

    • @exoxDiD
      @exoxDiD Před 7 lety

      thanks a lot! I get it now

    • @sorrefly
      @sorrefly Před 7 lety

      jongup__ no problem :)

  • @jahedulislam3438
    @jahedulislam3438 Před 4 lety

    Man you saved my ass. Can you make a video for double precision?

  • @hixamjocular6591
    @hixamjocular6591 Před 5 lety

    why you repeated that loop of binary fraction representation at the matisse case , normally you should complete the mantisse result by zeros !!

  • @user-yz7ts2fq9m
    @user-yz7ts2fq9m Před 4 lety

    Thanks bro!

  • @shortsFactsSociety
    @shortsFactsSociety Před 4 lety

    So, what if the fractionary part process ends up without a repeating cycle? How many digits should i take as a result?
    Example: for 0.01

    • @Oreoezi
      @Oreoezi Před rokem

      Usually the question will specify, most professors would be ok with doing it 6-7 times. Theoretically you'd have to do it until all 52 bits are filled.

  • @moralniprocvat2205
    @moralniprocvat2205 Před 6 lety +1

    what if 'E' negative?

  • @asmcriminaL
    @asmcriminaL Před 3 lety

    I found this video in my old "watch later" category... I watched it many years ago. All I have to say is the crap they taught is in school is mostly worthless.

    • @stevenpetryk6869
      @stevenpetryk6869  Před 3 lety

      You’re right! I barely remember this stuff. I did find it cool to learn, though.

  • @ayurmahajan1650
    @ayurmahajan1650 Před 5 lety

    Actually U @Steven Petryk missed a rule.....Coz in mantissa we need 23 bits..We write 23 bits as u said, but the rule u missed is that If 24th bit is 1 then 23rd should be 1 Else 0......

  • @RTimo
    @RTimo Před 3 lety

    Can you make a video for a negative decimal? Like (-4.75)???

  • @johnybonny8262
    @johnybonny8262 Před 4 lety +1

    Buddy u should convert binary by using 1,2,4,8 pattern it is easy

  • @zaberraiyan2570
    @zaberraiyan2570 Před rokem

    "If were gonna get a 100 on the exam you wouldnt have to watch this video like lets be real anyway"

  • @user-ox2rb7po3u
    @user-ox2rb7po3u Před 4 lety +1

    Omg , thank you so much.

  • @korneliuspasztor7465
    @korneliuspasztor7465 Před 7 lety

    I know this video has been some years ago, but do u have a video with fractions? :O

  • @solopine9624
    @solopine9624 Před 6 lety

    Thank you.

  • @S3iF3
    @S3iF3 Před 6 lety

    What if the mantissa wouldnt be repetetive. Would you just fill the last bits with 0's?

  • @eg9418
    @eg9418 Před 4 lety

    nice vid!

  • @tr_998
    @tr_998 Před 6 lety

    Shouldn't the exponent have the value 6

  • @sorrefly
    @sorrefly Před 7 lety

    Why does the IEE754 converter here puts a 1 at the end? because of rounding?
    www.h-schmidt.net/FloatConverter/IEEE754.html
    thanks for the video by the way :)

  • @ramazanberkozbek
    @ramazanberkozbek Před 3 měsíci

    Thanks

  • @Yusa98
    @Yusa98 Před 6 lety

    Hey, nice Video realy!

  • @ochuodhoisaya9017
    @ochuodhoisaya9017 Před 6 lety

    why have you not 127 for mantisa

  • @bintw3335
    @bintw3335 Před 6 lety

    shouldn't 11111111 be infinity?

  • @user-cm9qb4xy7c
    @user-cm9qb4xy7c Před 6 lety

    nicly explained

  • @etien613
    @etien613 Před 7 lety

    what if the we have something like -0,123

  • @nicoli108
    @nicoli108 Před 3 lety

    Thank you so much! I'm struggling a lot to understand this but you definitely made it easier. I was trying to convert -0,75 to binary and I did this:
    0,75 * 2 = 1,50
    0,5 * 2 = 1,00
    When I get only 1.0 I need to stop.
    So my number would be
    0.11 so 1.1 * 2 ^ -1
    1.1 * 2 ^126
    0 | 01111110 | 100000000000000
    Is this logic correct?

    • @Staroo
      @Staroo Před 3 lety +1

      Yh, but your original number was negative so your sign bit would be 1 instead of 0

    • @nicoli108
      @nicoli108 Před 3 lety

      @@Staroo thank you!

  • @webad8770
    @webad8770 Před 4 lety

    u cannot do this with 0.006. Ofcouse its simple with that number

  • @TheStrelok7
    @TheStrelok7 Před 7 lety

    ok how to convert 0.0059 any help