No video

Binary 6 - Normalised Floating Point Binary Fractions

This is the sixth in a series of videos about the binary number system which is fundamental to the operation of a digital electronic computer. In particular, this video covers the conversion of real numbers, both positive and negative, from denary into normalised floating point binary. It also covers the objectives of normalisation, explaining how to recognise un-normalised floating point binary representations of positive and negative numbers and then how to normalise them.

Пікірлер: 115

  • @coolandnormal4606
    @coolandnormal46063 жыл бұрын

    Hi, I live in Zimbabwe, and it's really difficult to find a competent comp sci teacher here, and it's been made a lot worse by the pandemic and everything. So i just wanted to say thank you, you really are the reason I'm passing my A level comp sci exams this year.

  • @alevelsos

    @alevelsos

    3 жыл бұрын

    Exam tommorow ?

  • @coolandnormal4606

    @coolandnormal4606

    3 жыл бұрын

    @@alevelsos yeah, you too?

  • @alevelsos

    @alevelsos

    3 жыл бұрын

    @@coolandnormal4606 yess

  • @alevelsos

    @alevelsos

    3 жыл бұрын

    @@coolandnormal4606 do you have any tips for me i havent been preparing as long as you actually..

  • @coolandnormal4606

    @coolandnormal4606

    3 жыл бұрын

    @@alevelsos it's the night before the exam😬... There's not much I can think of besides cram like your life depends on it

  • @sasindhij.9903
    @sasindhij.99033 жыл бұрын

    For a whole year of A2 level I had no full picture of this lesson in my mind and you helped me gain that. Thank you very much sir!!

  • @ComputerScienceLessons

    @ComputerScienceLessons

    3 жыл бұрын

    I'm delighted to help, hopefully not too late :)KD

  • @namviet7104
    @namviet71046 ай бұрын

    Hi. For guys thinking that the math with -0.25 and -0.125 are not correct, I would say that the math totally makes sense. It's just a little bit confuse when you see it for the 1st time. I also thought that -0.25 and -0.125 in this video are represented incorrectly, but I tried it one more time and realized that this video did the math right. Let's see the case with -0.125, then-0.25 is just similar. -0.125 = -1 + 0.5+0.25+0.125. So in binary -0.125 is 1.111. But the problem is, if you follow the rule to move the floating point in front of the first 0 (because we are solving negative number) then 1.111 becomes 0.0111, isn't it? But anything starts with 0 is a POSITIVE number. So? It doesn't work, right? Now you think there might be another way to do with the math. Instead of -0.125=-1+0.5+0.25+0.125, how about -0.125= -2+1+0.5+0.25+0.125 or -0.125 = -4+2+1+0.5+0.25+0.125.... Just throw any 1 onto the left as you wish, it's still the same. 1 on the left of negative number is just meaningless as 0 on the left of positive number (discussed in this video). So, the problem here is that we are stuck with that math between binary and denary. So the solution must be somewhere else. And it turns out to be quite simple. Just consider 0.001 = |0.125| (absolute value of 0.125 in denary instead of 0.001 =0.125 only), then use the floating point to change it to be come 1.0000..... x 2^-3. Now you see the 1 which represent negative number. Negative sign and a number represent absolute value of 0.125, and now you have -0.125. Hope that helps.

  • @QuaternionPhysics1
    @QuaternionPhysics12 жыл бұрын

    That you for this clear explanation! I was heavily struggling with this topic and could not understand what to do. This video cleared all my confusion. Great stuff! And thank you again! 😁🙏

  • @trendsetter639
    @trendsetter6393 жыл бұрын

    Ive searched for computer science lectures everywhere and this is the best one.Cannot thank you enough for these videos👍👍👍😫😫

  • @ComputerScienceLessons

    @ComputerScienceLessons

    3 жыл бұрын

    You are most welcome :)KD

  • @oTakisApoTinAchaia
    @oTakisApoTinAchaia5 жыл бұрын

    Great. Lovely! Brilliant!!! Everything's much clearer now.

  • @vyk_1
    @vyk_12 жыл бұрын

    I don't really comment but you're a lifesaver THANK YOU SO MUCH FOR YOUR HARD WORK :)

  • @ComputerScienceLessons

    @ComputerScienceLessons

    2 жыл бұрын

    You are very welcome indeed. Glad to help :)KD

  • @aroshanifernando9153
    @aroshanifernando91534 жыл бұрын

    U are a really good teacher! This was a good explaination....

  • @ComputerScienceLessons

    @ComputerScienceLessons

    4 жыл бұрын

    Thanks. I really appreciate the comment. :)KD

  • @janhorcicka4988
    @janhorcicka49885 жыл бұрын

    Great series of videos, thank you for that. Btw, are you sure that -0.25 is 0.01 in binary? (time 10:30). Seems like it should be 1.11

  • @ComputerScienceLessons

    @ComputerScienceLessons

    5 жыл бұрын

    Hi Jan. You can approach this in a couple of ways. 1.11 is indeed -0.25 in pure binary, assuming that the leftmost 1 has a negative place value. When you move the point two places to the right, you get a mantissa of 111.0 with an exponent of -2. You then need to remove the leading ones from the mantissa and pad it with trailing zeros, giving a mantissa of 1000 In my video I said that 0.01 is -0.25 in pure binary. This is also true if you assume that the leftmost 1 has a negative place value. Since this is a negative number, we move the point so that the leftmost bit is a 1 (that is, two places to the right). You get the same mantissa but without the leading ones. You can then pad the mantissa with trailing zeros, giving you 1000. Both approaches produce the same result. By the way, you could start by representing -0.25 as 11.11 or even 111.11 and you will still get the same result. I hope this makes sense.

  • @akskhurana9353

    @akskhurana9353

    3 жыл бұрын

    @@ComputerScienceLessons Does this mean that the 1.11 based answer also qualify as a normalized answer or is that incorrect then?

  • @neoinBJ

    @neoinBJ

    3 жыл бұрын

    i had the same result. 1110 1110

  • @marwansasol5598

    @marwansasol5598

    2 жыл бұрын

    @@ComputerScienceLessons PLEASE PLEASE EXPLAIN THIS IN A VIDEO , THE -0.25 CONFUSED ME TO BE HONEST

  • @streetmanners9048

    @streetmanners9048

    Жыл бұрын

    @@neoinBJ What? 1110 1110 means 1.11 times 2^(-2) so that's 0.0111 0.0111 is definitely not -0.25 in decimal......

  • @goldenbrothers9373
    @goldenbrothers93733 жыл бұрын

    Thankyou so much.i was totally blank in this topic.u really saved my marks.thumbs up👍

  • @ComputerScienceLessons

    @ComputerScienceLessons

    3 жыл бұрын

    You're most welcome :)KD

  • @Sharper290
    @Sharper2903 жыл бұрын

    9:07 why is the 2 negative? (-2) can you just make any number negative in that little bits chart? Also, the -0.25 is represented as 1.000 in the example at 10:30 - so you just make the first bit, that you are gonna write '1' under, negative? . Also, how do you decide where to start? How did you come up with 0.01?

  • @WhatupPlayboy
    @WhatupPlayboy Жыл бұрын

    Thank you very much man❤ your one of the best teacher of all times

  • @ComputerScienceLessons

    @ComputerScienceLessons

    Жыл бұрын

    You are very kind. Thanks :)KD

  • @Hpmanenz
    @Hpmanenz3 жыл бұрын

    How do I normalize if the mantis is 111.1111? Can you move it 3 times to the left and then add 3 to the exponent? Or it doesn't work like that?

  • @belvinef4949
    @belvinef49494 ай бұрын

    Excellent work

  • @emmanuellegentil9930
    @emmanuellegentil99303 жыл бұрын

    Hi sir I have one question for the denary number 19.25 @ (6:55). You've got the binary number 010011.01,but after the point, it starts with a zero not by a 1 but the point is supposed to float to the right!!!??.. but would you please explain to me why you float the point to the left 🤔 knowing that it starts with a zero after the binary point????

  • @TankutTalu
    @TankutTalu6 ай бұрын

    Great explanation. Thanks a lot

  • @ComputerScienceLessons

    @ComputerScienceLessons

    5 ай бұрын

    You're very welcome :)KD

  • @nikolajancic7130
    @nikolajancic71304 жыл бұрын

    You my friend saved me. Thanks

  • @ComputerScienceLessons

    @ComputerScienceLessons

    4 жыл бұрын

    Glad to help. Thanks for the comment :)KD

  • @rx25251

    @rx25251

    3 жыл бұрын

    Is that "Thanks" left shift three times ? :)

  • @itachi6336
    @itachi63364 жыл бұрын

    Great explaination regarding why leading 1's make no difference in negative numbers. My teacher unfortunately didn't explain this to our class.

  • @ComputerScienceLessons

    @ComputerScienceLessons

    4 жыл бұрын

    Thanks for the comment. Glad to help. :)KD

  • @netsaimarambi4596
    @netsaimarambi4596 Жыл бұрын

    Really helpful. Thanks

  • @ComputerScienceLessons

    @ComputerScienceLessons

    Жыл бұрын

    You're most welcome :)KD

  • @yt-1161
    @yt-11612 жыл бұрын

    The exponent looks a bit different if it's negative. How is the conversion in that case ? @12:20 first one

  • @derveochorofriguez3455
    @derveochorofriguez34552 жыл бұрын

    Could you do an example of 1/3 denary to binary?

  • @qoutesspace
    @qoutesspace4 ай бұрын

    Thank you very much ❤

  • @maurus101gmail
    @maurus101gmail4 ай бұрын

    10:39 please i got my answer for -0.25 to be 1111 0001 i want to know if its correct eventhough its not the answer in the video

  • @ComputerScienceLessons

    @ComputerScienceLessons

    4 ай бұрын

    You are correct, but your result is not normalised. My result in the video is normalised. If you convert your result back to base 10 you will see that it is indeed -0.25, and so is mine. Please watch the rest of the video which covers normalisation and you will learn how to convert your answer into 1000 1110. In an exam, you would normally be asked for a normalised a result. With practice, you will be able to come up with a normalised result while converting from base 10, but there is nothing wrong with normalising separately, after you've converted. :)KD

  • @swagatadas5121
    @swagatadas51212 жыл бұрын

    Good explanation 😘

  • @ComputerScienceLessons

    @ComputerScienceLessons

    2 жыл бұрын

    Thank you :)KD

  • @allstar7135
    @allstar71353 жыл бұрын

    You are amazing

  • @ComputerScienceLessons

    @ComputerScienceLessons

    3 жыл бұрын

    Thanks - so are you :)KD

  • @allstartuition267
    @allstartuition2673 жыл бұрын

    This has actually confused me more, though it's not necessarily to do with your excellent teaching. It's more about the idea that if normalisation is standard (which some incorrect answers to questions on some class exams have now taught me) why is it only shown as a sort of addendum here?

  • @ComputerScienceLessons

    @ComputerScienceLessons

    3 жыл бұрын

    The 'system' of floating point numbers that I have covered in this series of videos is rather generic (and debatably, there is nothing standard about it), but knowledge of this system is required by many UK exam boards because it covers a number of fundamental principles. Specialised digital signal processing systems (rather than PCs) might use this system. Normalisation is important because it leads to an unambiguous representation and it makes efficient use of the mantissa (hence the best possible precision). Perhaps it is something of a misnomer to call this a standard. Most PCs actually use the IEEE 754 standard which is a variation of the system described in this video, and it is arguably more relevant. I have covered it separately kzread.info/dash/bejne/hKl_zceJqdKfqs4.html IEEE 754 IS a ratified standard per-se, but is does cater for de-normalised numbers (denormals) which allow for better precision of very small values.

  • @allstartuition267

    @allstartuition267

    3 жыл бұрын

    @@ComputerScienceLessons Thanks for responding so quickly. Can I email you or do you offer one to one lessons? I only need one, I just need some questions clarifying.

  • @rawanb2375
    @rawanb23754 жыл бұрын

    In 18:17 when you moved the decimal point one place to the right, why did you subtract 1 to the exponent?

  • @ComputerScienceLessons

    @ComputerScienceLessons

    4 жыл бұрын

    It works in the same way as base 10 standard scientific form. 2.997 x 10^8 is the speed of light, a universal constant. (The notation, 10^8 means 'ten to the power of 8'). The value 29.97 x 10^7 is another way to write down the speed of light, but it's not normalised. Notice that the point is in a different position but the exponent is smaller to compensate. :)KD

  • @rawanb2375

    @rawanb2375

    4 жыл бұрын

    Computer Science Thank you!

  • @mer10n
    @mer10n2 жыл бұрын

    Why do we place point just before leftmost 1?? I am confused.

  • @ComputerScienceLessons

    @ComputerScienceLessons

    2 жыл бұрын

    The explanation you see here is an abstract model of what is going on inside a processor. In reality, floating point binary numbers are stored (or to be precise, represented) inside registers; Think of a line of pigeon holes, and each can store a 1 or 0. A register has a fixed size (it can store a finite number of bits). By design, and depending on the architecture, some of the bits are allocated to store the mantissa and some the exponent. By design, it is assumed there is a binary point before the first 1. Making that connection between what is going on inside the hardware, and this abstract model is easier to do if you have studied logic gates in detail. I tell my students to follow this recipe, for now, and assure them that the bigger picture will emerge later :)KD

  • @Bumbaclart
    @BumbaclartАй бұрын

    Is there a mistake at 21:30 because you said 2^(11-4 = -7)

  • @NoName-tj8dm
    @NoName-tj8dm Жыл бұрын

    Dear Sir, I have 8 bit register having 4 bit for the mantissa and 4 bit for the exponent.Both are in 2's complement form. Below is my binary 1010 1000 I am converting to denary. 1.010 * 2^-8 = 1.11111111010 . Since , Mantissa has 4 bits only, So I have truncated the redundant bits and remaining bits are 1.111 1.111 = -1 + 0.5 + 0.25 + 0.125 = -0.125 Can you please confirm if the above is correct ?

  • @ComputerScienceLessons

    @ComputerScienceLessons

    Жыл бұрын

    Your example is similar to the second example in the video at time kzread.info/dash/bejne/oaieqsSyntPeftY.html In your example, once you have floated the point eight places to the left, and have generated the pure binary form, you cannot ignore the most important part of the bit pattern. You don't need to throw anything away when you are converting back to denary. Assuming the left most one has a negative place value, then from 1.11111111010 you will get -1 + 0.5 + 0.25 + 0.125 + 0.0625 + 0.03125 + 0.015625 + 0.0078125 + 0.0039 + 0.00097 = -0.00293 (I used a spreadsheet to do this by the way). Alternatively, after floating the point you could pad with zeros instead of ones. This will give you 0.00000001010 When you convert this back into denary, you need to bear in mind that the left most one has a negative place value (in this case -0.003906) so you get -0.003906 + 0.000977 = -0.00293. Suppose you wanted to convert -0.125 into binary (4 bit mantissa/4 bit exponent), you could proceed as follows: -0.125 in pure binary is 1.111, which is 1000 x 2^-3, which is 1000 1101 (not 1010 1000 as your original calculation would suggest) You could also convert -0.125 into binary using a slightly different approach, as follows: 0.001 x 2^0, which is 0001 0000, assuming the left most one has a negative place value. But you would then need to normalise this, which would give you 1000 1101 I hope this helps. You need to practice a few of these to get the hang of them. :)KD

  • @NoName-tj8dm

    @NoName-tj8dm

    Жыл бұрын

    @@ComputerScienceLessons Thank you very much Sir for the explanation.

  • @hanzhekhaw8850
    @hanzhekhaw88502 жыл бұрын

    Hi, I have gone through the video more than 5 times now, likewise I went through the comment section quite a few times and I still don't quite getting why in your video exercises you showed that -0.125 is equal to 0.001 in pure binary? And why 0.25 is equal to -0.25, can you please explain to me in details or perhaps provide me resources to read up on it? I went through the entire internet and still can't find any further explanation for it. Thank you..

  • @ComputerScienceLessons

    @ComputerScienceLessons

    2 жыл бұрын

    Please re-watch my video on two's complement representation of negative numbers.

  • @evgenybagi
    @evgenybagi3 жыл бұрын

    10:57 isn't 0.75 is 0.11 in floating denary?

  • @ComputerScienceLessons

    @ComputerScienceLessons

    3 жыл бұрын

    When you look at 10.01, assume that the leftmost place value is negative (in this case -2). Then when you add the least significant place value (in this case 0.25) you get -1.75

  • @nathan12581
    @nathan125813 жыл бұрын

    Whats the difference between Floating point binary and Normalised floating point binary then?

  • @ComputerScienceLessons

    @ComputerScienceLessons

    3 жыл бұрын

    They are essentially the same, but normalisation makes most efficient use of the space in the registers that hold the bits. For example, in base 10, if you only had space for 6 digits, you could write the value of pi as 003.141, or you could write it in a normalised form as 3.14159

  • @nathan12581

    @nathan12581

    3 жыл бұрын

    @@ComputerScienceLessons thank you!

  • @user-ft8kn2um7q
    @user-ft8kn2um7q Жыл бұрын

    in 10:09,i think -0.25 in pure binary is 1.11 right ? why is it 0.01

  • @ComputerScienceLessons

    @ComputerScienceLessons

    Жыл бұрын

    Yes. But either way is fine as long as you assume the left-most 1 has a negative place value :)KD

  • @user-ft8kn2um7q

    @user-ft8kn2um7q

    Жыл бұрын

    @@ComputerScienceLessons ok thanks and thanks for the beneficial content

  • @OrangeDude7
    @OrangeDude76 ай бұрын

    what a legend

  • @ComputerScienceLessons

    @ComputerScienceLessons

    6 ай бұрын

    Thank you :)KD

  • @lynxvelvet5552
    @lynxvelvet55523 жыл бұрын

    On the Q's at 20:16 did he do it wrong because he's right in saying that the exponent is 3 therefore you should shift the decimal point by 3 to the right, however he only shifted it by 2. Pls help

  • @lynxvelvet5552

    @lynxvelvet5552

    3 жыл бұрын

    Oh wait nvm I'm dumb

  • @ComputerScienceLessons

    @ComputerScienceLessons

    3 жыл бұрын

    The method involves placing the point in the correct position first, regardless of the value of the exponent (to ensure that the two leftmost bits will be different), then you calculate a new exponent based on the number of places you moved the point. This method is correct. You should do lots of examples to be sure of it. If you study chemistry or physics, it would be worth trying to do the same with some values in standard scientific form. The speed of light for example is approximately 3.0 x 10^8 metres per second. It is also 300 x 10^6. Think about how you would convert from one to the other. :)KD

  • @TheStudyGuy1

    @TheStudyGuy1

    Жыл бұрын

    @@lynxvelvet5552 😂

  • @joshuawaterson8268
    @joshuawaterson82683 жыл бұрын

    I don't quite understand how -.125 in pure binary is 0.001 (11:00). Could you please let me know why this isn't .125

  • @joshuawaterson8268

    @joshuawaterson8268

    3 жыл бұрын

    btw, your videos are truly excellent - my primary reference point for first few weeks of a particular module at uni

  • @ComputerScienceLessons

    @ComputerScienceLessons

    3 жыл бұрын

    The place values, from the left, decrease by half each time so they are: 1, 0.5, 0.25, 0.125 but when we work these out we assume that the most significant place value is negative. The most significant place value here is -0.125

  • @ComputerScienceLessons

    @ComputerScienceLessons

    3 жыл бұрын

    Thank you :)KD

  • @joshuawaterson8268

    @joshuawaterson8268

    3 жыл бұрын

    Thanks, I ended up getting this myself shortly afterwards!

  • @KylianMbappe07303
    @KylianMbappe073039 ай бұрын

    1:56 why two places to the left

  • @divnoor2085
    @divnoor20852 жыл бұрын

    In any conversion Witt 0.75 I don’t understand how it’s binary is 01 SHOUDNT it be 11 instead

  • @ComputerScienceLessons

    @ComputerScienceLessons

    2 жыл бұрын

    For POSITIVE 0.75 the normalised form, with 4 bit mantissa and 4 bit exponent would be: 0110 0000 With a 5 bit mantissa and a 3 bit exponent it would be: 01100 000

  • @glory9605
    @glory960511 күн бұрын

    -0.25 = 1.110 in this case we have 2 leading one (which are useless) so we erase them to have 1.0 then by padding two 0's we get 1.000

  • @gayapavlov1176
    @gayapavlov11763 ай бұрын

    I did not understand how you got - 1.75?

  • @ComputerScienceLessons

    @ComputerScienceLessons

    3 ай бұрын

    Remember that the most significant place value is negative. So the leftmost 1 in 10.01 has a place value of -2. The rightmost 1 has a place value of 0.25. We can therefore calculate that -2 + 0.25 = -1.75 Take a look at my video on Two's Complement if you are unsure of this :)KD

  • @gayapavlov1176

    @gayapavlov1176

    3 ай бұрын

    @@ComputerScienceLessons aaaah , right !! Thanks for the explanation :D Btw , thank you for the videos , they are lifesavers for exams 🥹

  • @dailydoseofdopamine50
    @dailydoseofdopamine505 ай бұрын

    i don’t understand how he gets the first exponents. i need an asset urgently

  • @ComputerScienceLessons

    @ComputerScienceLessons

    5 ай бұрын

    Please watch the whole series from the start :)KD

  • @moofficial420
    @moofficial420 Жыл бұрын

    thankss

  • @ComputerScienceLessons

    @ComputerScienceLessons

    Жыл бұрын

    You're welcome :)KD

  • @milestailsprower4555
    @milestailsprower45553 жыл бұрын

    This 01000000 will equal to 1/2, also this 00100001 will also equal to 1/2, this is 00010010 equal to 1/2 too, Thanks!

  • @ComputerScienceLessons

    @ComputerScienceLessons

    3 жыл бұрын

    Which is why we have to normalise. :)KD

  • @HozAbubakir
    @HozAbubakir3 жыл бұрын

    21:30 the second number is not -96 it's -192.

  • @MichaelPims

    @MichaelPims

    3 жыл бұрын

    It has incorrect (11 - 4) = -7 written, but then it is evaluated as 1.01 x 2^7 = -0.75 × 128 = -96. Or do you mean anything else?

  • @milestailsprower4555
    @milestailsprower45552 жыл бұрын

    “This number .1 can't represent in binary, it's recurring bits is 0011„

  • @ComputerScienceLessons

    @ComputerScienceLessons

    2 жыл бұрын

    Almost - It begins with 00011 followed by 0011 recurring. 0.000110011001100110011…. kzread.info/dash/bejne/c2Z8yM6JZdbHj5M.html

  • @user-km1xt8ct4g
    @user-km1xt8ct4g25 күн бұрын

    Hazvisirizvo mabharanz