From WikiChip
Difference between revisions of "number system"

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& ~64943.9606934_{10}
+
     &\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:

Equation upper N Subscript r Baseline equals left-parenthesis d Subscript n minus 2 Baseline d Subscript n minus 1 Baseline ellipsis d 2 d 1 d 0 dot d Subscript negative 1 Baseline d Subscript negative 2 Baseline d Subscript negative 3 Baseline ellipsis d Subscript negative m Baseline right-parenthesis Subscript r

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

Equation upper N Subscript r Baseline equals sigma-summation Underscript i equals negative m Overscript n minus 1 Endscripts d Subscript i Baseline r Superscript i Baseline equals left-parenthesis d Subscript n minus 2 Baseline r Superscript n minus 2 Baseline plus d Subscript n minus 1 Baseline r Superscript n minus 1 Baseline plus ellipsis plus d 1 r Superscript 1 Baseline plus d 0 r Superscript 0 Baseline plus d Subscript negative 1 Baseline r Superscript negative 1 Baseline plus d Subscript negative 2 Baseline r Superscript negative 2 Baseline plus d Subscript negative m Baseline r Superscript negative m Baseline right-parenthesis Subscript r

Where d is the digit in the ith position.

notation examples (base 2, 8, 10 and 16)

For example, consider the following number Equation 49835.5825 Subscript 10 . 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 Equation 10101110.011 Subscript 2 . 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 Equation upper F upper D upper A upper E period upper F Baseline 5 upper F 16 . In the Hexadecimal number system, the radix Equation r equals 16 . Since the radix is 16, there are 16 distinguishable digits in this system. Those digits have traditionally been Equation StartSet 0 comma 1 comma 2 comma 3 comma 4 comma 5 comma 6 comma 7 comma 8 comma 9 comma upper A comma upper B comma upper C comma upper D comma upper E comma upper F EndSet . 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 Equation 703.104 Subscript 8 ,