1 | P a g e How a Number System Works There are different numbering systems used in digital electronic circuits and computers. However, the numbering system used in one type of circuit may be different to that of another type of circuit, for example, the memory of a computer would use hexadecimal numbers while the keyboard uses decimal numbers. Then the conversion from one number system to another is very important with the four main forms of arithmetic being. Decimal – The decimal numbering system has a base of 10 (MOD-10) and uses the digits from 0 through 9 to represent a decimal number value. Binary – The binary numbering system has a base of 2 (MOD-2) and uses only two digits a “0” and a “1” to represent a binary number value. Octal – The octal numbering system has a base of 8 (MOD-8) and uses 8 digits between 0 and 7 to represent an octal number value. Hexadecimal – The Hexadecimal numbering system has a base of 16 (MOD-16) and uses a total of 16 numeric and alphabetic characters to represent a number value. Hexadecimal numbers consist of digits 0 through 9 and letters A to F. Long binary numbers are difficult to both read or write and are generally converted into a system more easily understood or user friendly. The two most common derivatives based on binary numbers are the Octal and the Hexadecimal numbering systems, with both of these limited in length to a byte (8-bits) or a word (16-bits). Octal numbers can be represented by groups of 3-bits and hexadecimal numbers by groups of 4-bits together, with this grouping of the bits being used in electronic or computer systems in displays or printouts. The grouping together of binary numbers can also be used to represent Machine Code used for programming instructions and control such as an Assembly Language. Number systems are used to describe the quantity of something or represent certain information. Because of this, I can say that the word "calculator" contains ten letters. Our number system, the decimal system, uses ten symbols. Therefore, decimal is said to be Base Ten. By describing systems with bases, we can gain an understanding of how that particular system works. When we count in Base Ten, we count starting with zero and going up to nine in order. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, … Once we reach the last symbol, we create a new placement in front of the first and count that up. 8, 9, 10, 11, 12, … , 19, 20, … This continues when we run out of symbols for that placement. So, after 99, we go to 100. The placement of a symbol indicates how much it is worth. Each additional placement is an additional power of 10. Consider the number of 2853. We know this number is quite large, for example, if it pertains to the number of apples in a basket. That's a lot of apples. How do we know it is large? We look at the number of digits.
2 | P a g e Each additional placement is an additional power of 10, as stated above. Consider this chart. 103 102 101 100 digit digit digit digit *1000 *100 *10 *1 Each additional digit represents a higher and higher quantity. This is applicable for Base 10 as well as to other bases. Knowing this will help you understand the other bases better. Binary Number System Binary is another way of saying Base Two. So, in a binary number system, there are only two symbols used to represent numbers: 0 and 1. When we count up from zero in binary, we run out of symbols much more frequently. 0, 1, … From here, there are no more symbols. We do not go to 2 because in binary, a 2 doesn't exist. Instead, we use 10. In a binary system, 10 is equal to 2 in decimal. We can count further. Binary 0 1 10 11 100 101 110 111 1000 1001 1010 Decimal 0 1 2 3 4 5 6 7 8 9 10 Just like in decimal, we know that the more digits there are, the larger the number. However, in binary, we use powers of two. In the binary number 1001101, we can create a chart to find out what this really means. 2 6 2 5 2 4 2 3 2 2 2 1 2 0 1 0 0 1 1 0 1 64+0+0+8+4+0+1 87 Since this is base two, however, the numbers don't get quite as large as it does in decimal. Even still, a binary number with 10 digits would be larger than 1000 in decimal. The binary system is useful in computer science and electrical engineering. Transistors operate from the binary system, and transistors are found in practically all electronic devices. A 0 means no current, and a 1 means to allow current. With various transistors turning on and off, signals and electricity is sent to do various things such as making a call or putting these letters on the screen. Computers and electronics work with bytes or eight digit binary numbers. Each byte has encoded information that a computer is able to understand. Many bytes are stringed together to form digital data that can be stored for use later.
3 | P a g e Octal Number System The Octal Number System is another type of computer and digital base number system. The Octal Numbering System is very similar in principle to the previous hexadecimal numbering system except that in Octal, a binary number is divided up into groups of only 3 bits, with each group or set of bits having a distinct value of between 000 (0) and 111 ( 4+2+1 = 7 ). Octal is another number system with less symbols to use than our conventional number system. Octal is fancy for Base Eight meaning eight symbols are used to represent all the quantities. They are 0, 1, 2, 3, 4, 5, 6, and 7. When we count up one from the 7, we need a new placement to represent what we call 8 since an 8 doesn't exist in Octal. So, after 7 is 10. Octal 0 1 2 3 4 5 6 7 10 11 12… 17 20… 30… 77 100 Decimal 0 1 2 3 4 5 6 7 8 9 10… 15 16… 24… 63 64 Just like how we used powers of ten in decimal and powers of two in binary, to determine the value of a number we will use powers of 8 since this is Base Eight. Consider the number 3623 in base eight. 8 3 8 2 8 1 8 0 3 6 2 3 1536+384+16+3 1939 Each additional placement to the left has more value than it did in binary. The third digit from the right in binary only represented 23-1, which is 4. In octal, that is 83-1 which is 64.
4 | P a g e Decimal Number 3-bit Binary Number Octal Number 0 000 0 1 001 1 2 010 2 3 011 3 4 100 4 5 101 5 6 110 6 7 111 7 8 001 000 10 (1+0) 9 001 001 11 (1+1) Continuing upwards in groups of three In the decimal system each decimal place is a power of ten. For example: In the octal system each place is a power of eight. For example: By performing the calculation above in the familiar decimal system we see why 112 in octal is equal to 64+8+2 = 74 in decimal. Examples: 278 = 2×81 +7×80 = 16+7 = 23 308 = 3×81 +0×80 = 24 43078 = 4×83 +3×82 +0×81 +7×80 = 2247 Octal = 723 Decimal= 7×8²+2×8¹+3×8⁰ = 467 Binary = 111010011 Hex = 1D3
5 | P a g e Hexadecimal Number System The hexadecimal system is Base Sixteen. As its base implies, this number system uses sixteen symbols to represent numbers. Unlike binary and octal, hexadecimal has six additional symbols that it uses beyond the conventional ones found in decimal. But what comes after 9? 10 is not a single digit but two… Fortunately, the convention is that once additional symbols are needed beyond the normal ten, letters are to be used. So, in hexadecimal, the total list of symbols to use is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. In a digital display, the numbers B and D are lowercase. When counting in hexadecimal, you count 0, 1, 2, and so on. However, when you reach 9, you go directly to A. Then, you count B, C, D, E, and F. But what is next? We are out of symbols! When we run out of symbols, we create a new digit placement and move on. So after F is 10. You count further until you reach 19. After 19, the next number is 1A. This goes on forever. The one main disadvantage of binary numbers is that the binary string equivalent of a large decimal base-10 number can be quite long. When working with large digital systems, such as computers, it is common to find binary numbers consisting of 8, 16 and even 32 digits which makes it difficult to both read or write without producing errors especially when working with lots of 16 or 32-bit binary numbers. One common way of overcoming this problem is to arrange the binary numbers into groups or sets of four bits (4-bits). These groups of 4-bits uses another type of numbering system also commonly used in computer and digital systems called Hexadecimal Numbers. Hexadecimal 9 A B C D E F 1 0 11 … 1 9 1 A 1 B 1C … 9F A0 Decimal 9 10 1 1 1 2 1 3 1 4 1 5 1 6 17 2 5 26 27 28 15 9 16 0 Digits are explained as powers of 16. Consider the hexadecimal number 2DB7. 163 162 161 160 2 D B 7 8192+3328+176+7 11703
6 | P a g e As you can see, placements in hexadecimal are worth a whole lot more than in any of the other three number systems. Decimal Number 4-bit Binary Number Hexadecimal Number 0 0000 0 1 0001 1 2 0010 2 3 0011 3 4 0100 4 5 0101 5 6 0110 6 7 0111 7 8 1000 8 9 1001 9 10 1010 A 11 1011 B 12 1100 C 13 1101 D 14 1110 E 15 1111 F 16 0001 0000 10 (1+0) 17 0001 0001 11 (1+1) Continuing upwards in groups of four Each hexadecimal digit represents four binary digits (bits), and the primary use of hexadecimal notation is a human-friendly representation of binary-coded values in computing and digital electronics. One hexadecimal digit represents a nibble, which is half of an octet or byte (8 bits). For example, byte values can range from 0 to 255 (decimal), but may be more conveniently represented as two hexadecimal digits in the range 00 to FF. Hexadecimal is also commonly used to represent computer memory addresses.
7 | P a g e As an example, the hexadecimal number 2AF316 can be converted to an equivalent decimal representation. Observe that 2AF316 is equal to a sum of (200016 + A0016 + F016 + 316), by decomposing the numeral into a series of place value terms. Converting each term to decimal, one can further write: (216 × 163 ) + (A16 × 162 ) + (F16 × 161 ) + (316 × 160 ), (2 × 4096) + (10 × 256) + (15 × 16) + (3 × 1), or 10995. Example 2 Hex = 4A2 Decimal= 4×16²+10×16¹+2×16⁰ = 1186 Signed decimal = 1186 Binary = 10010100010