# Introduction to Number Systems

The symbols used in most of the western world to express numeric values are a version of the Hindu-Arabic number system, a *positional decimal* number system developed by Hindu and Indian mathematicians during the ninth century, later adopted by Arabic mathematicians and carried by them to many parts of Europe. The system has ten symbols, each representing one of the ten integer values from 0 to 9. It is generally assumed that the use of a number system based on ten symbols (a *decimal* number system) is based on the fact that early man first learned to count using the fingers and thumbs on both hands, allowing them to count up to ten with relative ease. The set of symbols we use to represent the numerals 0 to 9 are only one of several that have been used. The symbols themselves are only important in the sense that they provide a way of identifying the different numeric values for the purposes of communicating them to others. The properties of a given number system depend only on the *number* of symbols used, and whether or not the number system is *positional*.

The number systems we are interested in (including the decimal number system most of us are familiar with), are all positional systems. Consider the number 123.456 as an example. The number is a *floating point* number, i.e. it has a *fractional* part represented by numerals that appear to the right of the decimal point. The numeral in the first position before the decimal point (3) represents the value 3×10^{0} (three multiplied by ten to the power zero), which equates to three since any number to the power of zero is one. The numeral in the second position to the left of the decimal point (2) represents the value 2×10^{1}, or 20 (any number to the power of one is itself). The numeral in the third position to the left of the decimal point (1) represents the value 1×10^{2}, or one hundred. Each numeral in a decimal number must be multiplied by ten to a power that depends on the position of the numeral within the number, relative to the decimal point that separates the integer part of the number from the fractional part (if any). The position is significant, because it specifies the *magnitude* of the value represented by each numeral. The three numerals to the right of the decimal point in the above example (4, 5 and 6) represent the values 4×10^{-1}, 5×10^{-2}, and 6×10^{-3} respectively.

There are many different number systems, with the main difference between them being the number of symbols used (referred to as the *base* or *radix* of the number system). *Decimal* numbers have the base *ten*, *binary* numbers (which are very important in computing) have the base *two*, *octal* numbers have the base *eight*, and *hexadecimal* numbers have the base *sixteen*. Binary, octal and hexadecimal numbers are also used in computing. Hexadecimal numbers are especially important in the field of computing, because they provide a convenient way of expressing binary values. Each hexadecimal digit can be used to represent a group of four binary digits (or *bits*), and a pair of hexadecimal digits can be used to represent a *byte* (a group of eight binary digits).

The importance of the binary number system, which as the name suggests has only two symbols (0 and 1) is that it is the only number system that modern digital computers actually "understand". It should be remembered that at the heart of these devices is a central processing unit (CPU) that is essentially a finite state machine consisting of transistors and micro-circuitry that provides hundreds of millions of interconnected high-speed switches. The state of each individual switch can be either on or off, so each switch can only represent a 1 or a 0. Although they can process huge amounts of data and carry out millions of calculations per second, the underlying machine operations that achieve this are all based on the manipulation of binary values using various types of logic circuit. Even the data stored in working memory (RAM) and on magnetic or optical disks is physically stored as binary data – billions of individual binary digits ("bits"), all having the value 0 or 1. While integer values in other number bases can be represented exactly using a binary number system, many *real numbers* (those with fractional values) cannot. Such values are therefore approximated, although the degree of *precision* achieved increases with the number of bits used in their representation, at the cost of requiring more storage space in working memory or on disk.