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

Поділитися
Вставка
  • Опубліковано 20 сер 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

КОМЕНТАРІ • 221

  • @thornclawofwarriors
    @thornclawofwarriors 7 років тому +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 6 років тому +10

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

    • @kev814445
      @kev814445 6 років тому +5

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

    • @Miraclefruitify
      @Miraclefruitify 5 років тому +7

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

    • @ajimatsmail5686
      @ajimatsmail5686 5 років тому

      Teu ngarti aing bngst:(

    • @ashishdaniel169
      @ashishdaniel169 5 років тому +2

      @@giorgibujiashvili3942 still waiting for that report

  • @Yunho_Park
    @Yunho_Park 5 років тому +71

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

  • @JayoomJay
    @JayoomJay 6 років тому +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.

  • @EMMIR_KC
    @EMMIR_KC 7 років тому +88

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

  • @DragonDePlatino
    @DragonDePlatino 6 років тому +27

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

  • @alexbourlis
    @alexbourlis 6 років тому +37

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

  • @mrarcticaaa1101
    @mrarcticaaa1101 5 років тому +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

  • @johnrex9612
    @johnrex9612 5 років тому +7

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

  • @heron_
    @heron_ 6 років тому +1

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

  • @vinayak8100
    @vinayak8100 5 років тому +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

  • @standinonstilts
    @standinonstilts 6 років тому +7

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

  • @g0ballistic
    @g0ballistic 5 років тому +2

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

  • @mitchallcowell5166
    @mitchallcowell5166 6 років тому +6

    this saved my ass before an exam, great video

  • @LaplacianFourier
    @LaplacianFourier 5 років тому +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!

  • @TheFlyguy31
    @TheFlyguy31 6 років тому +1

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

  • @ns_down
    @ns_down 7 років тому +1

    Saving me for my final exams mate, thank you.

  • @saturdaysportscentral6129
    @saturdaysportscentral6129 Рік тому +1

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

  • @volodymyrzmazhenko4060
    @volodymyrzmazhenko4060 4 роки тому

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

  • @krullebolalex
    @krullebolalex 5 років тому

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

  • @calvinlan6568
    @calvinlan6568 4 роки тому

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

  • @foobar_eve8813
    @foobar_eve8813 7 років тому

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

  • @PerpetuallyTiredMillennial
    @PerpetuallyTiredMillennial 11 місяців тому

    "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.

  • @deshanesims2196
    @deshanesims2196 3 роки тому

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

  • @badong4878
    @badong4878 6 років тому

    you might have just saved my finals thanks

  • @klauspeter2199
    @klauspeter2199 3 роки тому

    9:58 that arrow is sooooo smooth!

  • @JoseFloresEC
    @JoseFloresEC 4 роки тому

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

  • @fruitlover7073
    @fruitlover7073 3 роки тому

    finally someone who speaks english

  • @nafisah9499
    @nafisah9499 2 роки тому

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

    • @stevenpetryk6869
      @stevenpetryk6869  2 роки тому

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

  • @kucuksamuray
    @kucuksamuray 7 років тому +1

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

  • @KansasFashion
    @KansasFashion 6 років тому

    The best Video I've ever seen about that

  • @joaquincandalaft2124
    @joaquincandalaft2124 7 років тому

    awesome explanation, quite short and totally clear

  • @edwinsanchez4973
    @edwinsanchez4973 Рік тому

    "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

  • @aldrinaldrinald
    @aldrinaldrinald 4 роки тому +1

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

  • @Xudas
    @Xudas 3 роки тому +35

    Pov: You came from tintok

  • @azizko2046
    @azizko2046 4 роки тому +3

    Is this CasuallyExplained?!

  • @AC-fi8ge
    @AC-fi8ge 8 місяців тому

    You are AWESOOOOOME ! 10/10

  • @adamroach43
    @adamroach43 6 років тому

    Very helpful and well explained. Thanks!

  • @Tibia390
    @Tibia390 5 років тому

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

  • @justdledfruitloops
    @justdledfruitloops 6 років тому

    Very clear explanation! Thanks alot!

  • @Akatsuu
    @Akatsuu 6 років тому

    THANK YOU
    MY PROFESSOR COULDN'T EXPLAIN THIS FOR SHIT

  • @tomislavvinkovic6652
    @tomislavvinkovic6652 6 років тому +12

    How is 5 equal to 132?

    • @0fficialRatedR
      @0fficialRatedR 6 років тому +3

      he added to 127

    • @opatechnus
      @opatechnus 6 років тому

      what he converted to binary and how

    • @puskalpulami8246
      @puskalpulami8246 6 років тому +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.

  • @ezzermaya4082
    @ezzermaya4082 5 місяців тому

    thanks! my exam is tomorrow :~)

  • @jennyggf3556
    @jennyggf3556 5 років тому

    Excellent explanation

  • @tooru
    @tooru 5 років тому

    got 100% thanks to this video

  • @leogourbin9752
    @leogourbin9752 3 роки тому

    You saved my life dude !

  • @andrewbrenner9375
    @andrewbrenner9375 5 років тому

    Wonderfully explained 😅

  • @DrNinjaPhDofPAIN
    @DrNinjaPhDofPAIN 7 років тому

    Outstanding, thank you for this

  • @hekk_tech5975
    @hekk_tech5975 4 роки тому

    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% :)

  • @stephennnamani8647
    @stephennnamani8647 Місяць тому

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

  • @rishiupadhyay3956
    @rishiupadhyay3956 3 роки тому

    Pencils are important. Indeed!😊😊

  • @zaberraiyan2570
    @zaberraiyan2570 Рік тому

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

  • @BsharatAhmed
    @BsharatAhmed 5 років тому

    thank you man your the best !!!

  • @mehdibadaoui1658
    @mehdibadaoui1658 7 років тому

    really appreciate the video

  • @unicorn8533
    @unicorn8533 4 роки тому

    Thank you so much

  • @katrinagonzales1575
    @katrinagonzales1575 Рік тому +1

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

  • @GidMightyWarrior
    @GidMightyWarrior 7 років тому

    Amazing, thank you so much

  • @rosiebahrani9895
    @rosiebahrani9895 5 років тому +1

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

  • @maxgobel
    @maxgobel 7 років тому +7

    Are you the voice behind Casually Explained?

    • @ProductionsOfPauls
      @ProductionsOfPauls 7 років тому

      I was thinking the same thing haha

    • @halio8012
      @halio8012 6 років тому +4

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

  • @mustafaahmadov3896
    @mustafaahmadov3896 2 роки тому

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

  • @hadyabdel-fattah5810
    @hadyabdel-fattah5810 5 років тому

    You sir are awesome

  • @patelav21
    @patelav21 5 років тому +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?

  • @jahedulislam3438
    @jahedulislam3438 4 роки тому

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

  • @tiffany3255
    @tiffany3255 6 років тому

    SUPER HELPFUL

  • @shanegrayson7068
    @shanegrayson7068 5 років тому

    Dude, ty you so much!

  • @SuperCracker123456
    @SuperCracker123456 5 років тому +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 5 років тому

      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 2 роки тому

    Very "encouraging" words.

  • @AkashSingh-pu4dc
    @AkashSingh-pu4dc 7 років тому

    Thanks Steven 👍

  • @somefuckstolemynick
    @somefuckstolemynick 6 років тому

    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. ;)

  • @danielmapiti6891
    @danielmapiti6891 6 років тому

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

  • @minsookim13
    @minsookim13 10 місяців тому

    Heyy Steven, what if it is a negative decimal

  • @johnybonny8262
    @johnybonny8262 4 роки тому +1

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

  • @serkan3743
    @serkan3743 6 років тому

    Karrrrdeşimmm biliyorsun bu hayatı

  • @RTimo
    @RTimo 3 роки тому

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

  • @OMNI_INFINITY
    @OMNI_INFINITY 7 місяців тому

    Thanks!

  • @asmcriminaL
    @asmcriminaL 3 роки тому

    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  3 роки тому

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

  • @moralniprocvat2205
    @moralniprocvat2205 6 років тому +1

    what if 'E' negative?

  • @thomaswolf1143
    @thomaswolf1143 7 років тому

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

  • @korneliuspasztor7465
    @korneliuspasztor7465 7 років тому

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

  • @hixamjocular6591
    @hixamjocular6591 5 років тому

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

  • @etien613
    @etien613 7 років тому

    what if the we have something like -0,123

  • @ayurmahajan1650
    @ayurmahajan1650 5 років тому

    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......

  • @eg9418
    @eg9418 4 роки тому

    nice vid!

  • @TheStrelok7
    @TheStrelok7 7 років тому

    ok how to convert 0.0059 any help

  • @rickthebrick12
    @rickthebrick12 3 роки тому

    I watch the video to get a 100 on the exam.

  • @aditopguy9785
    @aditopguy9785 10 місяців тому

    Which textbook do you recommend?

  • @darksynthesis1273
    @darksynthesis1273 7 років тому +25

    The bias is 127 not 255

    • @darksynthesis1273
      @darksynthesis1273 7 років тому

      Yep! 7:44

    • @danteeep
      @danteeep 6 років тому +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 6 років тому

      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 6 років тому

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

    • @Rayyankhantheboss
      @Rayyankhantheboss 5 років тому

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

  • @sorrefly
    @sorrefly 7 років тому

    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 :)

  • @user-yz7ts2fq9m
    @user-yz7ts2fq9m 4 роки тому

    Thanks bro!

  • @shortsFactsSociety
    @shortsFactsSociety 4 роки тому

    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 Рік тому

      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.

  • @ochuodhoisaya9017
    @ochuodhoisaya9017 6 років тому

    why have you not 127 for mantisa

  • @ramazanberkozbek
    @ramazanberkozbek 3 місяці тому

    Thanks

  • @solopine9624
    @solopine9624 6 років тому

    Thank you.

  • @HabiburRahman-xs9gb
    @HabiburRahman-xs9gb 6 років тому

    Huge thanks ..man..u deserve more than that...maybe a pizza

  • @webad8770
    @webad8770 4 роки тому

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

  • @ExecutechTutorials
    @ExecutechTutorials 6 років тому

    how do i convert 23.1675, im racking my brain out

  • @user-ox2rb7po3u
    @user-ox2rb7po3u 4 роки тому +1

    Omg , thank you so much.

  • @megaquickunboxhope6268
    @megaquickunboxhope6268 3 роки тому

    Check solution is
    0 10000100 01101011100....
    Check bec video is blur not able to see ans.

  • @S3iF3
    @S3iF3 6 років тому

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

  • @Yusa98
    @Yusa98 6 років тому

    Hey, nice Video realy!

  • @tr_998
    @tr_998 6 років тому

    Shouldn't the exponent have the value 6