Line 52: | Line 52: | ||
&=& 15 \times 16^3 + 13 \times 16^2 + 10 \times 16^1 + 14 \times 16^0 + 15 \times 16^{-1} + 5 \times 16^{-2} + 15 \times 16^{-3} \\ | &=& 15 \times 16^3 + 13 \times 16^2 + 10 \times 16^1 + 14 \times 16^0 + 15 \times 16^{-1} + 5 \times 16^{-2} + 15 \times 16^{-3} \\ | ||
&=& 61440 + 3328 + 160 + 15 + 0.9375 + 0.01953125 + 0.003662109375 \\ | &=& 61440 + 3328 + 160 + 15 + 0.9375 + 0.01953125 + 0.003662109375 \\ | ||
− | &\cong& | + | &\cong& 64943.9606934_{10} |
+ | \end{eqnarray*} | ||
+ | </math> | ||
+ | Note that the final value is rounded as a result of fraction estimation. | ||
+ | |||
+ | |||
+ | For the final example we'll use the [[octal]] number system, i.e. a base-8 system. In the octal number system there are eight distinct digits: 0 through 7. Let's take the number <math>703.104_8</math>, | ||
+ | |||
+ | ::<math> | ||
+ | \begin{eqnarray*} | ||
+ | N_{8} &=& 703.104 \\ | ||
+ | &=& (d_2 d_1 d_0 \cdot d_{-1} d_{-2} d_{-3})_{16} \\ | ||
+ | &=& 7 \times 8^2 + 0 \times 8^1 + 3 \times 8^0 + 1 \times 8^{-1} + 0 \times 8^{-2} + 4 \times 8^{-3} \\ | ||
+ | &=& 448 + 3 + 0.125 + 0.0078125 \\ | ||
+ | &=& 451.1328125_{10} | ||
\end{eqnarray*} | \end{eqnarray*} | ||
</math> | </math> |
Revision as of 01:18, 28 November 2015
Number systems are a mathematical notation for representing numbers of a given set. They are the foundation for conveying, quantifying, and manipulating data.
Number systems are mainly classified according to notations (positional notation vs sign-value notation) and their base. Today, we largely use the Arabic numerals which is a base-10 positional notation numbering system. Machines on the other hand may use a different number system - such as the base-2.
Notation
In the positional notation, numbers are a string consisting of one or more juxtaposed digits. For example, fixed-point form number N takes the following form:
Where r is the radix or the number of digits in the number system and d are the digits defined for that given radix. The dot in the center is known as the radix point. It separates the integer part on the left from the fraction part on the right. Furthermore, the value of number N in base r can be represented in polynomial form as
Where d is the digit in the ith position.
notation examples (base 2, 8, 10 and 16)
For example, consider the following number . Note the 10. Subscripts are used to indicate a base; often, to avoid confusion, when presenting values in different basis. Following the polynomial equation stated above, we can express out number as:
Now consider the following number . Note that the subscript is 2 indicating the number is in base-2 - i.e. a number system with only 2 possible digits: 0 and 1. We can express this binary number in polynomial form as well:
Note that as part of the process we've actually converted the number to decimal.
In this example we'll use the hex number . In the Hexadecimal number system, the radix . Since the radix is 16, there are 16 distinguishable digits in this system. Those digits have traditionally been . Note that A through F are decimal 10 through 15, respectively.
Note that the final value is rounded as a result of fraction estimation.
For the final example we'll use the octal number system, i.e. a base-8 system. In the octal number system there are eight distinct digits: 0 through 7. Let's take the number ,