Information Technology - Number System And Codes
Number System And Codes
The Number System is simply the ways and methods to represent numbers. Aim of any number system is to deal with certain quantities that could be measured, monitored, recorded, manipulated arithmetically, observed and utilized.
The computer constitutes all forms of data and information in binary numbers. This means every value or number that is saved or fed into the computer system memory holds a defined number system. The data fed could contain but is not limited to audio, graphics, video, text file, numbers, etc.
We all are most familiar with the decimal number system because we use it every day. It is the base-10 or radix-10 system. Note that there is no symbol for “10” or for the base of any system. We count 123456789, and then insert a 0 in the first column and add a new left column, starting at 1 again. Then we count 1-9 in the first column again (People use the base-10 system because we have 10 fingers!).
Each column in our system stands for a power of 10 starting at 100. All computers use the binary system. The base or radix is the total number of digits used in a number system. The base is written after the number as a subscript, for instance, 10001112 (1000111 base 2), 5510 (55 to base of 10), 708 (70 base 8), etc.
Supported Number Systems
A Standard Computer Architecture supports the following number systems:
1. Binary Number System (Base),
2. Octal Number System (Base 8),
3. Decimal Number System (Base 10),
4. Hexadecimal Number System (Base 16).
The numerical value of a quantity can be expressed in either an analog or digital method of representation.
1. The Binary System (Base 2)
A Binary number system has only two digits, which are 0 and 1. Every number (value) is represented with 0 and 1 in this number system. The base of the binary number system is 2 because it has only two digits. Though DECIMAL (No. 3) is more frequently used in Number representation, BINARY is the number system form that the system/machine accepts. A binary number may have any number of bits. Consider the number 11001.01 1. Note the binary point (counterpart of the decimal point in decimal number system) in this number. Each digit is known as a bit and can take only two values 0 and 1. The leftmost bit is the highest-order bit and represents the most significant bit(MSB) while the lowest-order bit is the least significant bit(LSB).
Some Useful Definitions are:
1. Word is a binary number consisting of an arbitrary number of bits.
2. Nibble is a 4-bit word (one hexadecimal digit) 16 values.
3. A byte is an 8-bit word 256 values.
Binary To Decimal Conversion
100101B = (1*25)+(0*24)+(0*23)+(1*22)+(0*21)+(1*20)
= 32 + 0 + 0 + 4 + 0 + 1
Find the decimal equivalent of the binary number (11111)2
The equivalent decimal number is
To differentiate between numbers represented in different number systems, either the corresponding number system may be specified along with the number or a small subscript at the end of the number may be added signifying the number system. Example (1000)2 represents a binary number and is not one thousand.
Decimal To Binary Conversion
A decimal number is converted into its binary equivalent by its repeated divisions by 2. The division is continued till we get a quotient of 0. Then all the remainders are arranged sequentially with the first remainder taking the position of LSB and the last one taking the position of MSB.
2. Octal Number System
The octal number system has base-8 that is, there are 8 digits in this system. These digits are 0, 1, 2, 3, 4, 5, 6, and 7. The weight of each octal digit is some power of 8 depending upon the position of the digit. The octal number does not include the decimal digits 8 and 9. If any number includes decimal digits 8 and 9, then the number can not be an octal number.
Octal To Decimal Conversion
As has been done in the case of binary numbers, an octal number can be converted into its decimal equivalent by multiplying the octal digit by its positional value. For example: Convert 36.48 into a decimal number.
36.48 = 3 x 81 + 6 x 80 + 4 x 8-1
= 24 + 6 + 0.5
3. HexaDecimal Number System
The hexadecimal number system has base 16 that is it has 16 digits (Hexadecimal means'16'). These digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. The digits A, B, C, D, E, and F have equivalent decimal values 10, 11, 12, 13, 14, and 15 respectively. Each Hex (Hexadecimal is popularly known as hex) digit in a hex number has a positional value that is some power of 16 depending upon its position in the number.
Hex To Decimal Conversion
Hex to decimal conversion is done in the same way as in the cases of binary and octal to decimal conversions. A hex number is converted into its equivalent decimal number by summing the products of the weights of each digit and their values. This is clear from the example of the conversion of 514.AF16 into its decimal equivalent.
514. AF16 = 5 X 162 + 1 X 161 + 4 X 160 + 10 X 16-1 + 15 X 16-2
When numbers, letters or words are represented by a specific group of symbols, it is said that the number, letter or word is being encoded. The group of symbols is called the code.
1. BCD Code
BCD Code (BCD stands for Binary Coded Decimal) code, each digit of a decimal number is converted into its binary equivalent. The largest decimal digit is 9; therefore the largest binary equivalent is 1001. This is illustrated as follows:
951 10 = 1001 0101 0001
2. ASCII Code
The word ASCII is run acronym of American Standard Code for Information Interchange. This is the alphanumeric code most widely used in computers. The alphanumeric code is one that represents alphabets, numerical numbers, punctuation marks and other special characters recognized by a computer. The ASCII code is a 7-bit code representing 26 English alphabets, 0 through 9 digits, punctuation marks, etc. A 7-bit code has 27 = 128 possible code groups which are quite sufficient.
3. Gray Code
Gray Code is a form of binary that uses a different method of incrementing from one number to the next. With the Gray Code, only one bit changes state from one position to another. This feature allows a system designer to perform some error checking (i.e., if more than one bit changes, the data must be incorrect).