Unformatted text preview: Computer Number Systems Number system refers to the list of digits (and alphabets) that we use to process all its information. For example, we use the decimal or base 10 number system to represent all our numerical information. All the numbers we work consist of different combinations of digits 0, 1, 2,……,9 and therefore this particular number system is referred to as the base 10 (all information represented using 10 digits) number system. During the early development of computers, the binary coded number system was employed. The binary number system consists of all the information being represented using different combinations only two digits (0 and 1). All data (numbers, text, symbols, etc. alike) in a computer is thus stored in this form. This type of language is used in computers as it is easy to make a computer understand the difference between two digits instead of having it understand a whole set of information. There are other types of numbers systems that have also been commonly used when working with computers. These include: 1.
2.
3.
4. Binary (Base 2) – 0 and 1 Octal (Base 8) – 0, 1, 2,……, and 8 Decimal (Base 10) – 0, 1, 2,……, and 9 Hexadecimal (Base 16) – 0, 1, 2,……, 9, A, B, C, D, E, F In the earlier days of computer programming, all coding was required to be done in the base two binary language; such languages are known as lower level computer languages. Higher level computer languages include the programming languages that are commonly used today (FORTRAN, VBA, C++, etc.). Though these languages are only an intermediate language; the computers still work in binary format. It is therefore good to know the basic conversions between binary and decimal number systems. Conversion from Binary to Decimal: As stated earlier, a binary number is a number obtained using combinations of just 0s and 1s. Consider a four bit (4 digit) binary number 0101. For converting this binary number into the common decimal form we are familiar with, we need to multiply each digit with its corresponding power of two and add all the numbers together. This is very similar to how we can represent the decimal numbers as powers of 10. Consider a decimal number of 1653. This number can be broken down into powers of 10 as follows: 100s Digit 1000s Digit 0s Digit 10s Digit 1653 = 1 * 103 + 6 * 102 + 5 * 101 + 3 * 100 Thus, the number 1653 can be read as 1 times 1000 added to 6 times 100 added to 5 times 10 plus 3. Notice that each individual digit is multiplied with 10 (which is the base number for the system) raised to the power of the digit location (starting at 0 for the rightmost digit before decimal). As explained earlier, binary numbers can be converted to their decimal equivalents following a similar procedure. The difference in the method though is that instead of multiplying each digit with 10 raised to the power of digit location, we need to multiply individual digits with 2 (which is the base number for binary number system) raised to the power of the digit location. Thus, the binary number example 0101 can be broken down into powers of 2 as follows: 4s Digit 8s Digit 0s Digit 2s Digit 0101 = 0 * 23 + 1 * 22 + 0 * 21 + 1 * 20 0101 = 0 + 4 + 0 + 1 (0101)Binary = (5)Decimal OR (0101)2 = (5)10 Example 2: 4s Digit Binary Number = 1101 0s Digit 2s Digit 8s Digit (1101)2 = 1 * 23 + 1 * 22 + 0 * 21 + 1 * 20 (1101)2 = 8 + 4 + 0 + 1 (1101)2 = (13)10 Example 3: Binary Number = 00110101 64s Digit 128s Digit 16s Digit 32s Digit 8s Digit 4s Digit 0s Digit 2s Digit (00110101)2 = 0 * 27 + 0 * 26 + 1 * 25 + 1 * 24 + 0 * 23 + 1 * 22 + 0 * 21 + 1 * 20 (00110101)2 = 0 + 0 + 32 + 16 + 0 + 4 + 0 + 1 (00110101)2 = (53)10 Decimal Equivalents for 4 bit (4‐digit) binary numbers: Binary 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
View
Full Document
 Spring '08
 staff
 two digits, 4 bit, binary format., 4 digit, 10 digits, four bit

Click to edit the document details