Electronics Class Notes — Number System

Teacher: Prof P. M. Sarun • NPHC504 • MONSOON - 2026-2027 • Last updated:

Number System

The language we use to communicate with each other is comprised of words and characters. We understand numbers, characters and words. But this type of data is not suitable for computers. Computers only understand the numbers. So, when we enter data, the data is converted into the electronic pulse. Each pulse is identified as code and the code is converted into numeric format by ASCII. It gives each number, character and symbol a numeric value (number) that a computer understands. So, to understand the language of computers, one must be familiar with the number systems.

The number system or the numeral system is the system of naming or representing numbers. We know that a number is a mathematical value that helps to count or measure objects and it helps in performing various mathematical calculations. There are different types of number systems in Maths like decimal number system, binary number system, octal number system, and hexadecimal number system. In this article, we are going to learn what is a number system in Maths, different types, and conversion procedures with many number system examples in detail.

Number System in Maths

A number system is defined as a system of writing to express numbers. It is the mathematical notation for representing numbers of a given set by using digits or other symbols in a consistent manner. It provides a unique representation of every number and represents the arithmetic and algebraic structure of the figures. It also allows us to operate arithmetic operations like addition, subtraction, multiplication and division.

The value of any digit in a number can be determined by:

  1. The digit
  2. Its position in the number
  3. The base of the number system

Before discussing the different types of number system examples, first, let us discuss what is a number?

Definition of Number

A number is a mathematical value used for counting or measuring or labelling objects. Numbers are used to performing arithmetic calculations. Examples of numbers are natural numbers, whole numbers, rational and irrational numbers, etc. 0 is also a number that represents a null value.

A number has many other variations such as even and odd numbers, prime and composite numbers. Even and odd terms are used when a number is divisible by 2 or not, whereas prime and composite differentiate between the numbers that have only two factors and more than two factors, respectively.

In a number system, these numbers are used as digits. 0 and 1 are the most common digits in the number system, that are used to represent binary numbers. On the other hand, 0 to 9 digits are also used for other number systems. Let us learn here the types of number systems.

Types of Number Systems

There are various types of number systems in mathematics. The four most common number system types are:

  1. Decimal number system (Base - 10)
  2. Binary number system (Base - 2)
  3. Octal number system (Base - 8)
  4. Hexadecimal number system (Base - 16)

Floating-point representation

Floating-point number representation is a fundamental concept in computer science and mathematics, essential for accurately representing real numbers in a digital format. This method allows computers to handle a wide range of numerical values, including both very small and very large numbers, with a compromise between precision and range. The details of floating-point representation, its components, and properties, are provided with few illustrative examples.

Basics of Floating-Point representation

Floating-point numbers are expressed in scientific notation as (±m) × 2e, where "m" represents the significand or mantissa, "e" denotes the exponent, and the sign bit indicates the sign of the number. The base, usually 2, is chosen to reflect the binary nature of computers. The IEEE 754 standard is commonly used for floating-point representation, providing single (32-bit) and double (64-bit) precision formats.

To accommodate large and small numbers, real numbers are written in floating point representation. Decimal floating point representation (also called scientific notation) has the form:

Floating Point representation
Floating Point representation

One digit is written to the left of the decimal point, and the rest of the significant digits are written to the right of the decimal point. The number 0.dddddd is called the mantissa. p represents the order of magnitude of the number having the base 10, which is also known as exponent. The first digit is zero for the number starting with a digit smaller than 5. Binary floating point representation has the form: \(1.bbbbbb \times 2^{bbb}\) (\(b\) is a decimal digit).

Example 1:

  • Decimal floating point form:
    \(8662.32\) written as \(8.66232 \times 10^3\) having order \(O(10^3)\)
    \(0.0000027191\) written as \(2.7191 \times 10^{-6}\) having order \(O(10^{-6})\)
  • Binary floating point form:
    \(1.0101 \times 2^{1010}\) having order \(O(2^{1010})\)
    \(1.01 \times 2^{-10}\) having order \(O(2^{-10})\)

Components of Floating-Point Representation:

  • Sign Bit (s): This bit determines whether the number is positive or negative.
  • Exponent (e): It represents the scale factor applied to the significand. In IEEE 754, it is represented using an offset binary or biased notation.
  • Significand (m): Also known as the mantissa, this is the main part of the floating-point number. It consists of a fraction and an implicit leading bit (except for special cases).

Storage of number in Computer

The computer stores the values of the exponent and the mantissa separately, while the leading 1 in front of the decimal point is not stored. According to the IEEE-754 standard (1985), computers store numbers and carry out calculations in single precision (32-bit) or in double precision (64-bit). In single precision, the numbers are stored in a string of 32 bits (4 bytes), and in double precision in a string of 64 bits (8 bytes). In both cases the first bit stores the sign (0 corresponds to + and 1 corresponds to -) of the number. The next 8 bits in single precision (11 bits in double precision) are used for storing the exponent. The following 23 bits in single precision (52 bits in double precision) are used for storing the mantissa.

memory
64-bit Memory space

The value of the exponent is entered with a bias. A bias means that a constant is added to the value of the exponent. The bias is introduced in order to avoid using one of the bits for the sign of the exponent (since the exponent can be positive or negative). The smallest and largest values of the exponent plus bias are reserved for zero and infinity (Inf) or not-a-number (NaN) due to invalid mathematical operation. The 11 bits for the exponent plus bias store values between \(-1023\) and \(1024\). If the exponent plus bias and mantissa are both zero, then the number actually stored is 0. If the exponent plus bias is \(2047\) the number stored is Inf if the mantissa is zero, and it is NaN if the mantissa is not zero. In single precision, \(8\) bits are allocated to the value of the exponent and the bias is \(127\).

Not every number can be accurately written in binary form since a finite number of bits is used. That means, only a finite number of exact values in decimal format can be stored in binary form. For example: \(0.1\) cannot be represented exactly in the finite binary format in the single precision memory space. The irrational numbers cannot be represented exactly in any format. The exact values are approximated. The errors that are introduced are small in one step, but when many operations are executed, the errors can grow to such an extent that the final answer is affected.

The interval between numbers that can be represented depends on their magnitude. In double precision, the smallest value of the mantissa that can be stored is \(2^{-52} \sim 2.22 \times 10^{-16}\). This is also the smallest possible difference in the mantissa between two numbers.

The smallest positive number that can be expressed in double precision is \(2^{-1022} \sim 2.2 \times 10^{-308}\) and the closest negative number to zero is \(-2.2 \times 10^{-308}\). Any number between \(-2.2 \times 10^{-308}$ and $2.2 \times 10^{-308}\) cannot be stored in memory leading to underflow error.

The largest positive number that can be expressed in double precision is approximately \(2^{1024} \sim 1.8 \times 10^{308}\) and the largest negative number expressed approximately in double precision is \(-2^{1024} \sim -1.8 \times 10^{308}\). Any number larger than \(1.8 \times 10^{308}\) or smaller than \(-1.8 \times 10^{308}\) leads to overflow error.

Data Storage
Data Storage possible in 64-bit memory space

Single Precision vs. Double Precision:

Single precision uses 32 bits with 1 bit for the sign, 8 bits for the exponent, and 23 bits for the significand. Double precision employs 64 bits with 1 bit for the sign, 11 bits for the exponent, and 52 bits for the significand. Double precision offers higher accuracy but requires more memory and computation.

Precision and Accuracy:

Floating-point representation involves a trade-off between precision and range. As the range increases, the precision decreases. Not all decimal numbers can be accurately represented due to the finite number of bits. This can lead to rounding errors and loss of precision in calculations.

Special Cases:

  • Zero: It can be represented as positive or negative zero with all bits of exponent and significand set to zero.
  • Infinity: It occurs when the exponent overflows. Positive and negative infinities are used to represent values that are too large in magnitude to be represented.
  • NaN (Not-a-Number): It arises from undefined operations like division by zero or taking the square root of a negative number. NaN is used to signal errors and propagate them in calculations.

Rounding Errors:

Due to the finite precision of floating-point numbers, rounding errors accumulate in complex calculations. Comparisons of floating-point values should be handled with caution, using an epsilon value for tolerance.

Example 2: Representing 123.456 in Single Precision

Decimal: 123.456 = 1.23456 × 102

Binary of 123.456: 1111011.01110100011110101110000101000100001011010001111...

Approximate Single Precision: 1.11101101110100011110101 × 26

Example 3: Representing -0.00123 in Double Precision

Decimal: -0.00123 = -1.23 × 10-3

Binary of 0.00123: 0.00000010000100110111...

Approximate Double Precision: -1.000010010110111... × 2-10

Decimal Number System

The decimal number system is also known as Base 10 Number System because has 10 different digits or symbols from 0 to 9 to describe the value. In other words a Decimal numbers system has a base of 10. In the decimal number system, the positions successive to the left of the decimal point represent units, tens, hundreds, thousands and so on. This system is expressed in decimal numbers. Every position shows a particular power of the base which is 10.

Decimal number representation
Decimal number representation

Example 4: Decimal Number System

The decimal number 1457 consists of the digit 7 in the units position, 5 in the tens place, 4 in the hundreds position, and 1 in the thousands place whose value can be written as:

\[(1\times10^{3}) + (4\times10^{2}) + (5\times10^{1}) + (7\times10^{0})\] \[(1\times 1000) + (4\times100) + (5\times10) + (7\times1)\] \[1000 + 400 + 50 + 7\] \[1457\]