0:00:17.270,0:00:22.634 Welcome to the next video in the[br]binary series. In the previous 0:00:22.634,0:00:27.104 video we learned how to convert[br]numbers to floating point 0:00:27.104,0:00:33.362 notation. In this video I will[br]show you how to do the other way 0:00:33.362,0:00:37.832 around, so had to convert a[br]floating point notation number 0:00:37.832,0:00:42.302 back into ordinary decimal[br]numbers. So let's say that you 0:00:42.302,0:00:46.772 are given an 8 bits floating[br]point notation, something like 0:00:46.772,0:00:52.634 1001. 1011 OK,[br]now the first step that you 0:00:52.634,0:00:56.254 would do in here is break[br]this code into it 0:00:56.254,0:00:58.788 constituents break this[br]code into its parts. 0:00:58.788,0:01:02.408 Remember that the first bit[br]is the sign bit. That's 0:01:02.408,0:01:06.390 going to tell you if it's a[br]positive or a negative 0:01:06.390,0:01:08.200 number. The next 3 digits. 0:01:10.290,0:01:11.700 Is your exponent? 0:01:13.000,0:01:15.925 And this exponent, these 3[br]bits twos complement notation 0:01:15.925,0:01:19.825 will tell you how many places[br]you need to move the radix 0:01:19.825,0:01:24.050 point either in to the right[br]or to the left and the last 0:01:24.050,0:01:25.675 part. The last four bits. 0:01:27.490,0:01:29.509 Is your normalized? 0:01:31.430,0:01:32.339 Month is self. 0:01:33.400,0:01:39.224 This is the number that you will[br]have to apply the exponent two 0:01:39.224,0:01:41.912 and move the radix point into 0:01:41.912,0:01:48.000 the right. Place to be able to[br]decode the binary number so. 0:01:49.270,0:01:56.359 Step one. Sign because the sign[br]equals to one. We have got a 0:01:56.359,0:01:57.856 negative number here. 0:02:01.500,0:02:03.459 Then Step 2. 0:02:04.590,0:02:10.796 Exponent Our exponent is[br]001. Well, that's a positive 0:02:10.796,0:02:16.813 number because it starts with[br]zero and it's positive one. So 0:02:16.813,0:02:23.377 my exponent is positive one, so[br]I will need to move my 0:02:23.377,0:02:28.300 normalized mantissa one place[br]into the positive direction that 0:02:28.300,0:02:31.035 three. My normalized mantissa is 0:02:31.035,0:02:36.174 0.1011. Apply the exponent[br]two. It move the radix .1 0:02:36.174,0:02:37.958 in the positive direction. 0:02:39.970,0:02:47.120 So the number the binary number[br]that is given to me here is 0:02:47.120,0:02:53.720 one data .011. Now I need to[br]decode it back into decimal. 0:02:54.930,0:03:00.143 This is one that's the radix[br]point. This is 1/2. This is 1/4 0:03:00.143,0:03:04.955 and this is an 8. So what I have[br]in here is. 0:03:05.470,0:03:11.794 1 + 1/4 plus an 8. Remember,[br]how can we act together? 0:03:11.794,0:03:18.118 Fractions need to make them to[br]be the same denominators, so it 0:03:18.118,0:03:24.442 will be 1 + 2 eight +18,[br]which is altogether one and 0:03:24.442,0:03:30.506 three eights. And remember,[br]we had one to start with, 0:03:30.506,0:03:35.519 so 10011011 in eight bits[br]floating point notation is 0:03:35.519,0:03:41.089 the same as minus one and[br]three eights in decimal. 0:03:44.280,0:03:50.391 Let's look at the[br]next example, which 0:03:50.391,0:03:53.010 is 11011100 again. 0:03:58.010,0:04:02.976 The first step is to identify[br]the sign. Now the sign is 1 0:04:02.976,0:04:06.496 again. So we have got a[br]negative number. 0:04:09.070,0:04:11.756 Then Step 0:04:11.756,0:04:17.660 2. Find[br]the exponent. 0:04:18.900,0:04:24.180 Remember the exponent is 101[br]now. This is in three Bits 2's 0:04:24.180,0:04:29.460 complement, so the 1st digit[br]tells me that this is a negative 0:04:29.460,0:04:34.740 number. So this is a negative[br]exponent, so it went through the 0:04:34.740,0:04:40.020 inversion process. So what I[br]need to do to find out what 0:04:40.020,0:04:44.420 positive equivalent is in here[br]is to redo that inversion 0:04:44.420,0:04:48.820 process, so copy the number[br]until you copy the one. 0:04:49.340,0:04:51.660 Then invert everything else. 0:04:52.280,0:04:57.348 So that zero becomes one. This[br]one becomes a 0, so this will be 0:04:57.348,0:05:00.606 the positive equivalent of this[br]negative number, and the 0:05:00.606,0:05:03.502 positive equivalent in here[br]using the place values. 0:05:04.200,0:05:08.000 This is equal to 0:05:08.000,0:05:14.640 R. Three, so this original[br]number is negative three, so our 0:05:14.640,0:05:16.624 exponent is negative 3. 0:05:17.230,0:05:19.870 And that 3. 0:05:20.600,0:05:22.550 Using the mantissa. 0:05:23.340,0:05:30.370 Now the normalized mantissa is[br]the last four bits. Remember, 0:05:30.370,0:05:37.400 it's always starts with 0.1100,[br]but what that Azar's done? 0:05:37.980,0:05:42.831 The exponent was negative three,[br]so the computer was stored to 0:05:42.831,0:05:48.123 move it 3 places to the negative[br]direction. So what does that 0:05:48.123,0:05:51.980 mean? One place to place 0:05:51.980,0:05:55.829 three places. Filling the zeros. 0:05:56.670,0:06:04.166 So the original number[br]was a very small 0:06:04.166,0:06:07.914 number O radix .0001100. 0:06:08.590,0:06:11.380 So what is this number? 0:06:12.060,0:06:18.664 Use the place values again this[br]is 1 radix point or half or 0:06:18.664,0:06:25.268 quarter on 8R16R32 and the rest[br]of them are zero, so we don't 0:06:25.268,0:06:30.856 really need to bother about[br]them. So this number here is 0:06:30.856,0:06:35.428 basically the sum of the 16th[br]and the 32. 0:06:35.980,0:06:39.580 Again, how can I add[br]fractions together? I need to 0:06:39.580,0:06:43.540 make them to be the same[br]denominator, so how can I 0:06:43.540,0:06:47.500 make 30 twos from sixteens? I[br]just need to double it. 0:06:48.920,0:06:55.820 So it's altogether 3 / 32.[br]And remember I had a negative 0:06:55.820,0:07:00.420 number because my assignment was[br]one so one. 0:07:00.950,0:07:07.742 1011100 As an 8 bits floating[br]point is exactly the same as 0:07:07.742,0:07:10.006 minus 3 / 32. 0:07:12.900,0:07:16.794 Let's do one more example of[br]this floating point notation and 0:07:16.794,0:07:19.272 let's look at what number is 0. 0:07:19.780,0:07:23.890 101[br]1011 0:07:26.060,0:07:29.504 Step one, find 0:07:29.504,0:07:36.941 the sign. The[br]first bit is 0, so this 0:07:36.941,0:07:39.393 is a positive number. 0:07:40.910,0:07:44.216 Then comes Step 0:07:44.216,0:07:51.650 2. Using[br]the exponent. 0:07:53.360,0:07:55.139 Now our exponent. 0:07:55.770,0:07:57.400 Is 101. 0:07:59.750,0:08:01.500 Which is a negative number. 0:08:02.190,0:08:06.654 So again, going through the[br]inversion process copied the 0:08:06.654,0:08:11.118 number until your Capital One,[br]then invert everything else. 0:08:12.140,0:08:15.398 And. This is again. 0:08:16.320,0:08:20.401 Positive three so this is still[br]negative. 3 The difference here 0:08:20.401,0:08:25.224 now will be that my month is a[br]is slightly different, so let's 0:08:25.224,0:08:28.934 look at the last step and deal[br]with the mantissa. 0:08:29.910,0:08:36.326 So I'm normalized mantissa[br]is 0.1011. The computer 0:08:36.326,0:08:42.742 was told to move[br]this mantissa or the 0:08:42.742,0:08:48.770 radix point. Three in the[br]negative direction, so it would 0:08:48.770,0:08:51.120 need to move it 123. 0:08:51.720,0:08:58.644 So 0.00.[br]So the original 0:08:58.644,0:09:04.812 number was 0.0001011.[br]The accompanying place 0:09:04.812,0:09:10.980 values are one[br]radix point 1/2 0:09:10.980,0:09:17.148 or quarter an[br]8 or 16 0:09:17.148,0:09:20.232 or 3264 and 0:09:20.232,0:09:27.538 128th. So I need to[br]talk together. Now is 1 / 16 + 0:09:27.538,0:09:34.498 1 / 64 + 1 / 128. Now[br]again to be able to add them 0:09:34.498,0:09:40.530 together I need to get them all[br]to be the same denominator. Now 0:09:40.530,0:09:45.634 this is a common denominator[br]because I can get 228 from 0:09:45.634,0:09:48.418 doubling all of them but at 0:09:48.418,0:09:51.410 different numbers. So from. 0:09:53.010,0:09:59.940 16 to get 228 what I've done. I[br]doubled 123 times. So that is 0:09:59.940,0:10:06.870 basically 16 * 8 going to give[br]me the 128. So what this is 0:10:06.870,0:10:14.790 telling me that 8 / 128 is the[br]same as 1 / 1664 and 120. There 0:10:14.790,0:10:21.720 is only one doubling point in[br]here, so that is just 2 / 128. 0:10:21.920,0:10:28.790 Plus 1 / 128, so[br]this is altogether giving me 0:10:28.790,0:10:35.660 8 + 2 is 10[br]plus one is 11 / 0:10:35.660,0:10:41.156 128 so 01011011 in eight[br]bits within point. 0:10:41.980,0:10:46.608 Is the same as 11 / 128?[br]Remember this time it was zero, 0:10:46.608,0:10:50.880 so this is a positive number and[br]for positive numbers we don't 0:10:50.880,0:10:52.660 write out the positive sign. 0:10:53.620,0:10:57.820 Now we went through the 8 bits[br]floating point notation and you 0:10:57.820,0:11:01.320 might find it still a little bit[br]confusing. That's absolutely 0:11:01.320,0:11:04.820 fine, because this is like an[br]orchestra you pulling together 0:11:04.820,0:11:07.970 everything that you've learned[br]about binary numbers. So you 0:11:07.970,0:11:11.120 putting together the two bits[br]complement notation, some normal 0:11:11.120,0:11:13.920 mathematical knowledge about[br]moving decimal places applied 2 0:11:13.920,0:11:18.820 in binary numbers and so on. So[br]this is probably one of the most 0:11:18.820,0:11:22.670 difficult questions that you can[br]get in binary numbers, but once 0:11:22.670,0:11:25.470 you understand them then you[br]will really know. 0:11:25.550,0:11:28.745 What needed to be known[br]about this system, and 0:11:28.745,0:11:32.295 you know how the computer[br]looks at the binary code. 0:11:33.410,0:11:38.350 And now it is your turn to try[br]these conversions. You will find 0:11:38.350,0:11:41.770 the answers to these questions[br]shortly after the questions 0:11:41.770,0:11:45.118 appear. So these are the[br]practice questions. 0:11:50.860,0:11:52.820 And here are the answers.