- Number Systems Decoded. - In many IT-related fields of study, it is extremely valuable to have a good understanding of the number sys- tems that are often encountered. - Despite the intended use, numbers are constructed in the same way and follow the same basic set of rules.. - Understanding those rules is the key to advancing your appreciation of numbers.. - These are the decimal, binary, and hexa- decimal number systems.. - These alternative number systems have three things in common: a base number (sometimes called a radix). - Each number system employs:. - A Base or radix value around which the number system is organized. - A Positional Notation meaning that the position in which a digit appears conveys information about the significance or weight of that digit. - Figure A Number System Names, Bases, and Digits. - Each number system has a name: Decimal, Binary, and Hexadecimal. - Since “hexadecimal” does not flow trip- pingly off our tongues, we often simply say “Hex” instead.. - The decimal number system is encountered most commonly. - This is the number system that everyone learns as a child. - Binary is the frank language of computers. - It is the number sys- tem that is used to confuse students.. - It turns out to be very simple to convert from hex to binary – you will learn how.. - The “base” value for a number system is simply the number around which the system is organized. - You do see the pattern, don’t you? If base 10 has ten digits to work with, and base 2 has two digits to work with, then base 16 must have – how many digits? You guessed it, sixteen. - These symbols are letters of the alphabet. - Someone might point out to you that there are 3 windows in the classroom. - The digit 3 conjures up something in your brain – the notion of the quantity 3. - In like manner, I could note that there are B desks in the classroom. - That should make you think of the quantity 11, hence 11 desks are present.. - The number is structured in a very orderly way. - To begin with, note that the digits all come from the decimal symbol set and 9) and that the symbol 5 appears twice in the number.. - We us the term “positional notation” to reflect the fact that the 5 appearing in the rightmost position is interpret- ed differently than the one appearing two positions to the left. - That is to say that the position in which a digit appears has everything to do with the significance or weight that we attach to it. - The rightmost position is the “ones place.” To the left is the “tens place.” To the left again is the “hundreds place,” and so on. - (Just what you’d expect? This is the base 10 number system, after all.). - A careful analysis of our example value reveals that the number 1585 is intended to convey to us, as readers of the number, a quantity that is comprised of 1 thousand, 5 hundreds, 8 tens, and 5 ones.. - That is pretty simple, right? There are no surprises here. - But what about the other number systems? They must be different somehow.. - The rightmost position in a binary number is the ones place, as it was in the decimal example. - (See Figure D.) But as we progress to the left, each position carries a weight that is 2 times the one on its right. - So in binary values you have only 2 digits to work with, zeroes and ones, and the “places” in the numbers are each weighted 2 times the position to their right. - Second, as noted previously, some people cringe seeing letters of the alphabet in numbers.. - Just as the regular-old-every- day digit 5 makes you think of the number of fingers on. - your hand, the hex digit C should make you think of the number of doughnuts that come in a package. - What is different is that as you move to the left, each position carries a weight that is 16 (get it, base 16) times the position on the right. - You have learned that three number systems are used commonly in IT: decimal. - Also, these number systems are structured in a similar manner. - For deci- mal the set consists of the digits 0…9, for binary there are only 0s and 1s, and for hex the digits 0…9 and A…F are used.. - Each of the number systems employs a positional notation in which a given digit’s position within a number dictates the weight that we associate with it. - As you move to the left, the positions carry a weight that is the base value times its right-hand neighbor. - Recognizing the Number System. - The number system being used is very often conveyed by the context in which you observe the number. - But if you were reading a paper on binary masking (whatever that is) you might reasonably assume that the value is binary. - Mathematicians use subscripts to indicate the number system. - Decimal to Binary Conversion. - Converting a decimal value to binary is like making change at a cash register. - So a binary 1100 is the representation for a decimal 12.. - Only replace the bin-o-bucks with “Hex-A-Bucks. - The denominations of the bills are 1s, 16s, 256s, and 4096s. - So the value 23 is the hex representation of the decimal value 35.. - Extend the hex-a-bucks analogy from the previous exercises to convert in the opposite direction, from hex to decimal this time.. - You get:. - That is five 16s and four 1s. - Recall that the symbol E depicts the quantity 14 in decimal. - So that is one 16 and 14 10 1s. - Hexadecimal to Binary. - Hex to binary is very easy. - Here is what the hex digits look like in binary:. - Simply write binary 1011 in place of the hex B followed by binary 1000 in place of the 8. - In place of the 4 write 0100, in place of the F write 1111, and in place of the 1 write 0001. - You get . - Working from right to left in the binary value, substitute one hex digit for each group of four binary digits. - An example is the best way to appreciate this.. - If the number of binary digits (bits) is not a multiple of four, then just pad it on the left with additional zeroes.. - Binary value to be converted . - Helpful Tools for Working with Number Systems. - There is no shortage of tools to help you work with the number systems. - Toward the upper left of the calculator you will see a group box that contains four radio buttons: Hex, Dec, Oct, and Bin. - The Bin button has been clicked in the figure above and a binary value entered into the calculator . - Clicking on the Hex button, the calculator converts the binary value to hex: 2B6. - You can use this technique to convert between any of the supported number sys- tems. - If you are curious, Oct stands for the octal, or base 8, number system.. - The program con- verts any number that you enter here to each of the number sys- tems that we learned about. - A note: the Number Converter. - you may have to click the Type of Input Value button to cor- rect the Number Converter if it guesses wrong.. - Notice that the leftmost eight bits has the 8 and 2 bits on – that’s the 10. - Each of the next two groups of eight bits only have the 1 bit on – that is the 1s you see in the address. - Do you see how this works? Each of those decimal numbers that appears in the dotted-decimal address con- verts to an 8 bit binary number. - Bin-o-Bucks. - These codes are actually binary values that we use to represent each of the commonly used letters, digits, and special characters. - What is the ASCII code for “f”?. - It is easy to spot – “f” is encoded as the hex value 66. - Okay, but what is the binary code. - that is not shown in the table.. - Simply convert the hex 66 to binary. - Each of the 6s translates to binary 0110. - The length of the frame is sometimes encoded in the 13th and 14th bytes of the Ethernet header. - The dump shows the hex value 0026 in that part of the header. - Neither likes hexadecimal – hex is just a great shorthand for binary.. - All of the number systems have three things in common:. - They all rely upon “positional notation” to convey the significance of the digits within a given number Conversion between these systems is a common chore. - You can do it manually by applying your knowledge of these number systems. - Or, you might prefer to use one of the tools, like calculators or reference tables, to assist in this.. - Good luck working with these numbers in the future.. - Mays also acts as a consultant in the fields of general networking and security.
Xem thử không khả dụng, vui lòng xem tại trang nguồn hoặc xem
Tóm tắt