Name:



Name: ____________Computer Number Systems PacketNumber Systems are used to express numbers using digits or symbols. Most number systems are fairly straight forward. But there are a couple, like the Roman Numerals that can a bit more complex. Understanding how they work and how they relate to each other is important for computers. This is because computers work using the binary number system since a zero and a one can be easily represented using ground and positive voltage. There are others like octal and hexadecimal that are also used frequently.The key aspect of the number systems that we will look at is the base. The base indicates the number of digits for each place. The one that we use is base 10 (decimal). The 10 digits that we use in this are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Why do we use this over something else like base 8?..... It is for no other reason than the fact that we are born with 10 fingers and that is what all humans learn to count with.NamesMost number systems can be referred to using their base like base 5, base 7, and base 9. Some are so common that they are referred to using their actual name. They are:base 2 – binarybase 8 – octalbase 10 – decimalbase 16 – hexadecimalWhen we write out the numbers, we can indicate what base they are in by using a subscript. (Example – 359010)CountingCounting in the systems that we will look at will all function the same way for each one. You already learned counting in the decimal number system in elementary school. Lets review!We will start counting with our first digit which is 0. Then we run through all our other digits from 1 all the way to 9. Then when we run out of digits, we change the 9 back to our first digit 0. But at the same time we add a 1 to the next position. As we progress to 9 each position, it will revert to 0 and a 1 is added to the next position. So a 9,999 will transition to 10,000 as each 9 goes to 0 and 1 gets added to the next position.The other thing to keep in mind is that the last digit in each set is one less than the base. So octal, which is base 8, has digits 0, 1, 2, 3, 4, 5, 6, 7. Notice that, since we start counting at 0, that gives us a total of 8 digits.HexadecimalHexadecimal has 16 digits but we only are familiar with 10. So we use the letters A through F to replace the numbers 10 through 15. Why? For no other reason other than we are familiar with those symbols and they are already on a standard keyboard.Counting ChartDecimalOctalBinaryHexadecimalBase 5Base 6Base 901234567891011121314151617181920212223242526272829303132Adding NumbersAdding again works that same way that it did in elementary school. We add the numbers in each position and if the sum goes over the base, we subtract the base and carry a 1 to the next position. When we add 48 with 78, we first add the 8 with 8 and get a 16. The 6 (16-10) stays at the ones place and we add a 1 to the tens place. For the tens place we add 1 + 4 + 7 and get a 12. We leave the 2 (12-10) and carry a 1. So the result will be 126.Examples111 1 11101102+ 1101002101010101st : 0 + 0 = 02nd : 1 + 0 = 13rd : 1 + 1 = 2 → 2 - 2 = 0, carry 14th : 1 + 0 + 0 = 15th : 1 + 1 = 2 → 2 - 2 = 0, carry 16th : 1 + 1 + 1 = 3 → 3 - 2 = 1, carry 17th : 1 + 1 = 2 → 2 - 2 = 0, carry 18th : 11 11 517418+3265481046151st : 1 + 4 = 52nd : 4 + 5 = 9 → 9 - 8 = 1, carry 13rd : 1 + 7 + 6 = 14 → 14 - 8 = 6, carry 14th : 1 + 1 + 2 = 45th : 5 + 3 = 8 → 8 - 8 = 0, carry 16th : 11 1 CA97116+E2954161AD2C51st : 1 + 4 = 52nd : 7 + 5 = 12(C)3rd : 9 + 9 = 18 → 18 - 16 = 2, carry 14th : 1 + 10(A) + 2 = 13(D)5th : 12(C) + 14(E) = 26 → 26 - 16 = 10(A), carry 16th : 1Adding Binary Numbers102+ 121012+ 121012+ 110210102+ 111210112+ 111012101112+ 100121010112+ 1110102101110102+ 1111110121101102+ 10101121110112+ 100111210101112+ 10101102111111112+ 111111112Adding Numbers in Different Bases7528+55381023+11134025+31151678+41782123+12032045+341575216+5531665B16+AA316E3A16+85B164559+58393234+11141536+54361057+6157181010+9215107248+1578Converting Numbers to Decimal EquivalentsA number in base b can be converted to its equivalent in base 10 by using place values. Given 1394210, what do the individual digits represent?13942 10 = 1(10)4 + 3(10)3 + 9(10)2 + 4(10)1 + 2(10)0 = 10,000 + 3000 + 900 + 40 + 2Likewise, the digits in the base 2 number 110101 represent powers of the base 2.110101 2 = 1(2)5 + 1(2)4 + 0(2)3 + 1(2)2 + 0(2)1 + 1(2)0 = 1(32) + 1(16) + 0(8) + 1(4) + 0(2) + 1(1) = 32 + 16 + 0 + 4 + 0 + 1 = 5310The same can be done for any other base such as converting 13F16 to base ten.13F16 = 1(16)2 + 3(16)1 + F(16)0= 1(256) + 3(16) + 15(1)= 256 + 48 + 15= 319 10Or to converting 3758 to base ten.3758 = 3(8)2 + 7(8)1 + 5(8)0= 3(64) + 7(8) + 5(1)= 192 + 56 + 5= 253 10Converting Numbers to Decimal Equivalents Practice1012 =10102 =1011012 =1101010.112 =2716 =13AD16 =34178 =110213 =Converting from Binary to HexadecimalConverting back and forth from binary to hexadecimal is straight forward. This is because 4 binary digits matches exactly with one hexadecimal digit. To covert from decimal to hexadecimal, just look up each hexadecimal digit and write out the equivalent set four binary digits. To go the other way, circle groups of four binary digits and write out the equivalent hexadecimal digit. This should be done from right to left and fill in any leading zero’s00000100012001030011401005010160110701118100091001A1010B1011C1100D1101E1110F1111Example 1:8D316 = ? 28D310001101011132744461567623634795640539915555494Example 2:100010111002 = ? 1601000101110045CConverting from Binary to Hexadecimal Practice10110110111011000101101121000111010111101011101100100101001012A7F316D239AE16Converting from Decimal to other BasesOne way to do this is to repeatedly divide the decimal number by the base in which it is to be converted, until the quotient becomes zero. As the number is divided, the remainders - in reverse order - form the digits of the number in the other base. This is also referred to as the divide and conquer algorithm.Examples539893619701600173410 → 110110001102173410 → 6C616173410 → 330683275937103864009423404113700Some things to note:The remainders go in reverse order. So the remainder left at the end is the most significant digit. And the first remainder that you obtained is the least significant digit.When we got a remainder of 12 for hexadecimal, we put a C when we wrote out our hexadecimal number.Converting from Decimal to BaseX Practice4710 =___________227410 =___________2771210 =___________24542510 =___________24710 =___________827410 =___________8771210 =___________164542510 =___________16771210 =___________164542510 =___________16 ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download