in this video we're going to talk about number systems the first number system that you need to be familiar with is the decimal system now when you hear the word decimal what do you think of think of the prefix deci what does that mean when I hear the word deci i think of one-tenth of a whole for example there's ten decimeters in one meter i also think of the word decade a decade corresponds to 10 years and so deci is associated with 10 and in fact the decimal number system is a base 10 system and so what this means is that there's 10 different numbers in the decimal system 0 1 2 3 4 5 6 7 8 and 9. so that's a total of 10 numbers now this system is used for everyday counting for example 12 or 36 or 468 we use the decimal system to represent numbers and it works pretty well now the next system that you need to be familiar with is the binary system so when you hear the prefix buy what do you think of bi means two and so the binary system is a base two system it's very useful for computers or any type of digital circuits there's only two numbers here zero and one in a typical digital computer zero means off one means that the system is in the on state next we have the octosystem and when you hear the word octo or octa what do you think of i think of an octagon an octagon is basically a polygon with eight sides so octa means eight so the octal number system is a base eight system so there's eight numbers that we can use in the system the first being zero and then one two three four five six seven so that's a total of eight numbers including zero next we have the hexadecimal system now what is meant by the prefix hexa hexa think of a hexagon a hexagon has six sides and so hexa means six we know decimal corresponds to ten and so six plus ten will give us 16 therefore the hexadecimal system is a base 16 system and so the numbers are 0 1 2 3 4 5 6 7 8 9 so we have all ten numbers in the decimal system but we also have six letters and so those letters are a b c d e and f now a corresponds to 10 in the decimal system b in the hexadecimal system corresponds to 11 in the decimal system c is 12 d is 13 e is 14 f is 15. so that's a total of 16 numbers including zero now let's talk about how we can convert a decimal number to a binary number and into an octal and a hexadecimal number using the technique called successive division so let's say we have the number 348 if you see a subscript 10 that means it's in the base 10 system which means it's a decimal number so the first thing you want to do is take 348 and divide it by two so if you type that in you'll get exactly 174 so it's 174 remainder is zero next take 174 and then divide that by two so that's exactly 87 so it's 87 remainder zero next if we take 87 and divided by two we're going to get 43.5 so it's 43 remainder one but first let's write it like this so this 43 gets transferred here and then to get the remainder one you multiply two by point five and that will give you the remainder one i'm going to write my answer like this for now now if we take 43 and divide that by two that's going to be 21.5 which is 21 remainder one and then we need to take 21 divide that by two so that's 10.5 which is 10 remainder 1 and then 10 divided by 2 is exactly 5 so 5 remainder 0 and then 5 divided by 2 is 2.5 so 2 remainder one and then two divided by two is exactly one so one remainder is zero and then one divided by i'm running out of space here one divided by two that's 0.5 so 0 remainder 1. what we have on top is the least significant bit and this here is the most significant bit now you can find your answer just by looking at all of the remainder values which is here and so that's the binary number that's equivalent to 348 so you need to read it from the bottom to the top so the answer is 1 0 1 0 and then 1 1 1 0 0. so that's how we can convert a decimal number into a binary number using successive division now let's convert this number into an octal number in the base eight system so if we look at the last example where we converted 348 into a binary number we were dividing it by two because binary it's based on the base two system by means two the octal system is based on the base eight system so instead of dividing it by two and collecting the remainders we're going to divide it by eight this time so 3 48 divided by eight that's going to be 43.5 so this is 43 remainder now to find the remainder multiply 8 by 0.5 so 8 times 0.5 is 4 so it's 43 remainder 4. next take 43 and divide it by 8. and this will give you five point three seven five so it's five remainder and then multiply the eight by point three seven five eight times point three seven five that will give you three next take the five and divided by eight now five is less than eight so we can say that eight goes into five zero times with a remainder of five but if you do five divided by eight you're going to get 0.625 and so the 0 gets transferred here and then if you multiply 8 by 0.625 you should get this number the original number that you started with which will go here so this is the most significant digit and above we have the least significant digit so we're going to read it from the bottom to the top so 348 base 10 as a decimal number is equivalent to 5 3 4 or 534 in the octal system and so that's how you can convert a decimal number into an octal number using successive division now let's talk about how to convert the decimal number into a hexadecimal number using successive division so let's use the same number 348. let's convert it to a hexadecimal number now the hexadecimal number is basically a number in the base 16 system so this time instead of dividing by 2 or 8 we're going to divide by 16. so if we take 348 and divided by 16 this will give us 21.75 and so that's 21 remainder to find the remainder multiply 16 by 0.75 so 16 times 0.75 that's 12. so it's 21 remainder 12. now let's take 21 and then let's divide that by 16. so 21 divided by 16 is 1.3125 and so we have one remainder now let's multiply 16 by 0.3125 and that's going to give us five so it's a one remainder five next take one divided by 16 now we know one doesn't go into 16 so 16 goes into one zero times with a remainder of whatever you see here in this case a remainder of one and so we're going to read it this way so we have a 1 a 5 and a 12. now 12 because it's larger than 9 we need to convert it to a letter so remember 10 corresponds to a 11 corresponds to b and 12 corresponds to c so it's 1 5 c so therefore we could say this 348 in the base 10 system is 1 5c in the base 16 system and so that's how we can convert a decimal number into a hexadecimal number using successive division
تعليقات
إرسال تعليق