Digital Number Systems

In this tutorial, you will learn the fundamentals of number systems, including their definitions, common types such as decimal, binary, octal, and hexadecimal, and their representations. You will explore the conversion processes between different systems, the advantages of digital over analog systems, and the differences between various number systems. Additionally, you will gain insights into how counting operates in these systems and the significance of understanding these concepts in the context of digital technology.

Contents:

  1. What is Number System?
  2. Common Number Systems in Digital Technology
  3. Forms of Representations in Number Systems
  4. Radix R representation
  5. Binary Number System
  6. Binary Representation of (0.328125)10
  7. Decimal Number System
  8. Decimal Equivalent Number of (7033.52)8
  9. Octal Number System
  10. Octal Equivalent of (5673.640625)10
  11. Octal Equivalent Number of (11010101011111.101001000111)2
  12. Hexadecimal Number System
  13. Counting in All Number Systems
  14. Advantages of Digital Systems Over Analog Systems
  15. Differences Between Octal and Hexadecimal Number Systems
  16. Differences Between Decimal and Binary Number Systems

What is Number System?

The number system is the systematic way to represent numbers. It is the basis of all computational work in the world. Once a number system is defined, we can develop arithmetic for it to do calculations.

Some important points related to number systems are:

  • Any number system has a base also known as radix, which gives the number of unique symbols in that system. Radix must be ≥ 2, for any number system.
  • In all number systems, the symbols begin from 0 and go till 9. For radix ≥ 9, we include letters from the English alphabet as symbols in our number system to represent further numbers.
  • The base of a number can be written as a subscript. For example, (23)10 is a number in the base 10 number system.

Common Number Systems in Digital Technology

The most commonly used number systems are:

advertisement
  • Decimal Number System: This system has base ‘10’ and it has 10 distinct symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). This is the positional number representation, where value of each digit is determined by its position in a number.
  • Binary Number System: It has base ‘2’ i.e., it has two base numbers 0 and 1 and these base numbers are called as “bits”.
  • Octal Number System: It has base ‘8’ and it contains 8 distinct symbols (0, 1, 2, 3, 4, 5, 6, 7). It can be made from binary numbers by grouping them in a bunch of three bits.
  • Hexadecimal Number System: It has base “16” and it contains 16 different symbols to represent a number. This number system contains numeric digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) and alphabets (A, B, C, D, E and F) both. It can be made from binary numbers by grouping them in a bunch of four bits.

Forms of Representations in Number Systems

Number Systems have broadly four ways of representation. Different representations are used at different places as per requirement. Each form presents an extended view to look at numbers as well as removes ambiguity in number systems. The following figure shows the categories of its representation.

categories of Number System Representation

As shown in the above figure, the four ways of representation of number systems are: –

  1. Radix R representation: In this form, we show numbers as a part of different radix-based systems and develop the concepts of counting for them.
  2. BCD Codes: BCD stands for binary coded decimal. This form is mainly to represent all numbers in 0 and 1 form with the positional weights of binary system namely, 8 4 2 1 varied to different values. It aims to code data in terms of positional weights.
  3. Data representation: This is a form exclusively to differentiate between positive and negative numbers. It develops the concept of how to represent negative numbers in any number system.
  4. Fixed and Floating Point Representation: This form is aimed at devising a standard to represent fractional values in number systems with a certain amount of precision.

In this tutorial, we shall be seeing the radix r form of number systems representation

Radix R representation

There are four major radix-based systems in use, namely, the Binary number system, the Octal number system, the Decimal number system, and the Hexadecimal number system. Also, the rules will apply to any new radix-based number system that comes up.

Radix r implies 0 to r-1 symbols for that number system. For example,

  • Decimal number system has base 10: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  • Binary number system has base 2: 0, 1
  • Octal number system has base 8: 0, 1, 2, 3, 4, 5, 6, 7
  • Hexadecimal number system has base 16: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

Any number can be expressed in a number system with radix r as shown in the figure:

radix product form of a number

As shown in the figure,

  • The point separating the fractional part and integral part is known as the radix point.
  • For the integer part: For n digits, we multiply the digits with positive powers of the radix, starting from power 0, moving left from digit0 to digitn-1.
  • For fractional part: For n digits, we multiply the digits with negative powers of the radix, starting from power -1, moving right from digit1 to digitn.
  • The leftmost digit of a number is known as Most Significant Bit (MSB) as it has the highest power of radix multiplied with it.
  • The rightmost digit of a whole number is known as Least Significant bit (LSB) as it has the least power of the radix multiplied with it. LSB may change in case it is a fractional number.

Also, numbers from different radix-based number systems are interconvertible. Radix-based number systems are also known as positional numeral systems as each digit contributes to the overall value of the number according to its position in the number.

Binary Number System

The binary number system is a base-2 number system. Some important points related to it are as follows:

  • A binary digit is known as a bit.
  • In the binary number system, we have two digits namely 0 and 1. So all binary numbers are sequences of zeros and ones.
  • All codes directly understandable by computers are stored in binary.
  • The radix point is known as the binary point.
  • A group of four bits is known as a nibble.
  • A group of eight bits is known as a byte.
  • Higher units used are kilobytes (KB), megabytes (MB), gigabytes (GB), and terabytes (TB). 1024 bytes make a kilobyte, 1024 kilobytes make a megabyte, and so on.
  • The binary number system was introduced because electronic switches used in hardware usually can have two states: ON or OFF.
  • 0 represents OFF or logic LOW and 1 represents ON or logic HIGH in positive logic. In negative logic, 0 is considered as HIGH and 1 as LOW.

Example: (10101)2 is a binary number.
(10101.10)2 = 1 x 24 + 0 x 23 + 1×22 + 0 x 21 + 1 x 20 + 1 x 2-1 + 0 x 2-2

advertisement

Binary Representation of (0.328125)10

The following steps must be followed to convert fractional decimal into binary number:

  • First, we need to multiply the fractional part by ‘2’.
    0.328125 × 2 = 0.65625
  • After first multiplication integral part of the product is the first digit before binary point. Later only fraction part of the first product is multiplied by 2 as shown below.
    0.65625 → 0
    0.65625 × 2 = 1.3125
  • The integral part after second multiplication is the digit before binary point, and so on.
    1.31250 → 1
    0.31250 × 2 = 0.62500
  • Multiplication by 2 only on the fraction will continue until the fractional part becomes zero.
    0.62500 → 0
    0.62500 × 2 = 1.25000
    1.25000 → 1
    0.25000 × 2 = 0.50000
    0.50000 → 0
    0.50000 × 2 = 1.00000
    1.00000 → 1
  • Now the fractional part is 0. So, the integer digits will be the answer after binary point.
    (0.65625)10 = (0.010101)2

Decimal Number System

The decimal number system is a base-10 number system. Some points related to it are as follows: –

  • It is the most widely used number system in real life.
  • It has 0-9 characters.
  • The expansion of a number as a product of positional weights and powers of the radix, in any base, always gives the equivalent of the number in the decimal system.
  • The radix point is known as the decimal point.
  • In the decimal system, to represent a negative number in the real world, a minus symbol is put in front of it. In digital systems, 9’s and 10’s complements are used to represent negative decimal numbers.
  • The decimal number system is advantageous as it is easy to use and is friendlier in its arithmetic operations.

Example of decimal number: 5432.10
(5432.10)10 = 5 x 103 + 5 x 102 + 5 x 101 + 5 x 100 + 1 x 10-1 + 0 x 10-2

Decimal Equivalent Number of (7033.52)8

The following steps can be followed to convert an octal number into a decimal number:

  • An octal number can be converted to decimal equivalent by multiplying each octal digit by its positional weight.
  • Base for octal number system is 8. The decimal equivalent of integral part of the octal number will be: (7033)8 = 7 × 83 + 0 × 82 + 3 × 81 + 3 × 80
    = 3584 + 0 + 24 + 3
    = 3611
  • For fractional part, the positional weight will start from 8-1, multiplying the digit just after the octal point.
    (.52)8 = 5 × 8-1 + 2 × 8-2
    = 5/8 + 2/64
    = 0.65625
  • Now, after combining both integral and fractional part, we will get the desired decimal equivalent number.
    (7033.52)8 = 3611 + 0.65625
    = (3611.65625)10

Octal Number System

The octal number system is a base-8 number system. Some points related to it are as follows: –

  • The octal number system has 8 characters ranging from 0 – 7.
  • The radix point is known as the octal point.
  • Three binary bits can represent octal numbers.
  • It has the benefit of not requiring additional symbols over the hexadecimal number system.
  • It is originated with 8 being the base for all computing platforms. For example, we have 8 bits making a byte. Further, we have 16-bit, 32-bit, 64-bit systems all of which are multiples of 8.
  • In computer systems, octal numbers are identified with a prefix of 0o.
  • The octal number system is used in aviation for transmitting codes to ground stations.

Example of an octal number: 721
(721)8 = 7 x 82 + 2 x 81 + 1 x 80

Octal Equivalent of (5673.640625)10

For decimal to octal conversion we need to divide the decimal number into integral and fractional part.

  • For integral part, the number is repeatedly divided by ‘8’ until the quotient becomes zero. The remainders in the reverse order will be the octal equivalent number. It can be easily understood by the following diagram:
    decimal to octal conversion
  • From the above diagram (5673)10 = (13051)8.
  • For fractional part, the fractional part of the number is repeatedly multiplied by ‘8’. It can be easily understood by the following diagram:
    fractional part of the number is repeatedly multiplied by ‘8’
  • From the diagram, when the fractional part becomes zero, we stopped multiplication by ‘8’ and the integral numbers after each multiplication can be combined together to get the answer i.e. (.640625)10 = (.51)8
  • Now, combining both integral and fractional part, we will get the desired equivalent octal number.
    (5673.640625)10 = (13051.51)8

Octal Equivalent Number of (11010101011111.101001000111)2

The conversion of binary point number into its octal equivalent can be understood by a simple diagram given below.

binary point number into its octal equivalent
  • For left side of the radix point, we group the bits in a bunch of three from LSB (Least significant bit) as shown in the diagram.
  • Here, one zero at MSB (Most significant bit) is added to make a complete group of three bits.
  • For right side of the radix point, we group the bits in a bunch of three from MSB as shown in the diagram.
  • Then we convert each group of three bits into its octal equivalent number.
  • Finally, after combining the octal equivalent numbers we get the answer as:
    (11010101011111.101001000111)2 = (32537.5107)8

Hexadecimal Number System

The hexadecimal number system is a base-16 number system. Some major points about it are as follows: –

  • Hexadecimal has 16 symbols ranging from 0- F.
  • Hexadecimal is a friendlier form of representing binary as each hexadecimal digit can be shown by four binary bits.
  • The prefix 0x is used in computer systems to identify hex numbers. Alternatively, the letter H can be added at the end.
  • The symbols A-F have equivalent values of 10-15 respectively. While expanding a hexadecimal number, these values are multiplied in place of the symbols.
  • Hexadecimal system usage: Color coding is done in hex, assembly languages use hexadecimal for encoding opcodes, IP addresses use hexadecimal notation. In short, hexadecimal is the most widely used system in programming.

Example of a hexadecimal number: A23 or A23H
(A23)16 = 10 x 162 + 2 x 161 + 3 x 160

Counting in All Number Systems

In any base system, after we exhaust the last most symbol the next counting begins from 10. As 10 on expanding in any base, gives the base number itself. For example,

  • In binary after 1 comes 2, and 2 in binary is represented by 10, as on expanding, 1 x 21 + 0 x 20 = 2
  • In octal after 7 comes 8, and 8 in octal is represented by 10, as on expanding, 1 x 8 1 + 0 x 80 = 8

Generally, every time we hit the end of the character set while counting, we increment the left digit’s value by one and repeat the available character set. For example, in hexadecimal, after F comes 10, 11……..19, 1A, 1B…..1F, after which comes 20….2F…….FF, 100, 101… and so on.

Here is a table that shows counting in each number system from 0 to 16. Notice the 10 in each number system and where it occurs.

BINARY OCTAL DECIMAL HEXADECIMAL
0000 0 0 0
0001 1 1 1
0010 2 2 2
0011 3 3 3
0100 4 4 4
0101 5 5 5
0110 6 6 6
0111 7 7 7
1000 10 8 8
1001 11 9 9
1010 12 10 A
1011 13 11 B
1100 14 12 C
1101 15 13 D
1110 16 14 E
1111 17 15 F
10000 20 16 10

Advantages of Digital Systems Over Analog Systems

Digital systems have many advantages over analog systems which are explained below.

  • Easy to Design: Digital systems are easier to design because digital circuits having only two voltage levels, LOW and HIGH. Whereas, analog system signals have continuous numerical values, so they are complicated to design.
  • Accuracy: Digital systems are more accurate and precise than analog systems because digital circuits have major advantage of containing switching circuits. Switching circuits provide greater accuracy when they are used in digital circuits.
  • Easy to Store Information: Digital circuits contain different types of semiconductor memories like flash memory, hard drives etc. They have very large capacity to store digital data and they are also very easy to operate.
  • Versatility: Digital Systems are very easy to program and reprogram as per the demands of user and it is very versatile. However, in analog systems, the available options for programming are limited.
  • Noise: The effect of noise in analog system is more because in analog systems we work with the exact continuous values which is usually noise friendly but in digital system, we only work with range of values so, noise effect is very less.
  • Reliability: As compared to analog systems, digital systems are more reliable because digital information can be encrypted and decrypted easily. In analog systems it is very difficult to control errors but in digital systems errors can be controlled with proper error detection and correction techniques.

Differences Between Octal and Hexadecimal Number Systems

The differences between octal and hexadecimal number system are listed below.

Parameters Octal Number System Hexadecimal Number System
Representation It uses 8 symbols or digits to represent all the numbers. It uses 16 different symbols for representing numbers.
Base The base for octal number system is 8. The base for hexadecimal number is 16.
Bits It can be made from binary numbers by grouping them in a bunch of three bits. It can be made from binary numbers by grouping them in a bunch of four bits.
Symbols It contains only digits, 0 to 8. It contains digits as well as alphabets.
Simplicity & difficulty It is difficult to remember a large decimal number in octal as it uses only eight digits to represent a number. It is easy to remember a large decimal number in hexadecimal as it uses 16 different symbols, which makes a large number comparatively small.
Example 37 (Equivalent to 31 in decimal). 3A (Equivalent to 58 in decimal).

Differences Between Decimal and Binary Number Systems

The differences between decimal and binary number system are listed below.

Parameters Decimal Number System Binary Number System
Symbols It uses 10 symbols or digits to represent all the numbers. It uses 2 different symbols or digits for representing numbers.
Base The base for decimal number system is 10. The base for hexadecimal number is 2.
Bits It does not have the concept of bits. It has two base numbers 0 and 1 and these base numbers are called as “Bits”.
Uses It is mostly used in mathematical calculations we perform in our daily life. Computer and other digital electronic devices only understand binary language.
Systems It is mostly used by analog signals and systems as they are continuous in nature. Binary number system is used by digital signals and systems as they are discrete in nature.
Representation Easy to represent and remember large numbers using decimal numbers. Easy to represent but difficult to remember as they are very long for large numbers.
Examples 6, 234, 199, 201 11, 10001, 10101011, 10010

Key Points to Remember

Here is a list of key points to remember about “Number System”.

  • Any number system with radix r has 0 to (r-1) symbols in it. Radix ≥ 2 for any number system.
  • All radix-based number systems are interconvertible.
  • There are four types of number systems representations: – Radix-based, BCD codes, Data, and fixed and floating-point representations.
  • Decimal (base 10 {0-9}), Hexadecimal (base 16 {0-F}), Octal (base 8 {0-7}) and Binary (base 2 {0,1}), are the generally used radix-based number systems.
  • MSB stands for the most significant bit and LSB stands for the least significant bit. MSB is the leftmost bit and LSB is the rightmost bit.
  • In the hexadecimal number system, A-F has values 10-15 respectively.
  • In the hexadecimal number system, A-F has values 10-15 respectively.
  • 10 in any number system is numerically equivalent to the base of that number system.
  • While counting in any number system, on reaching the end of the available character set, we increment the left bit by 1 and repeat 0 to r-1 characters.
  • Converting decimal fractions to binary involves repeatedly multiplying the fractional part by 2 and taking the integer part as the next binary digit.
  • Digital systems are generally more advantageous than analog systems due to ease of design, accuracy, storage capacity, and reliability.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.