December 10, 2024

Decimal number system

Decimal number system

The decimal number system, also known as the base-10 system, is the number system that we commonly use in everyday life, which uses 10 digits (0-9) to represent numbers. However, computers primarily use the binary number system, which is a base-2 system, to perform operations and store data.

In the binary number system, there are only two digits, 0 and 1. Each digit in a binary number is referred to as a “bit” (short for binary digit). Computers use bits as the fundamental unit of data storage and processing. The binary system is well-suited for computers because electronic circuits can easily represent and manipulate two distinct states (0 and 1).

To work with decimal numbers in computers, conversion between decimal and binary is required. The conversion involves representing decimal numbers using sequences of bits. In most modern computers, a fixed number of bits, typically 8, 16, 32, or 64, are used to store each decimal number. These groups of bits are commonly referred to as “bytes.”

To convert a decimal number to binary, the number is divided by 2 repeatedly, and the remainders are noted. The binary representation is obtained by arranging the remainders in reverse order. For example, to convert the decimal number 10 to binary:

10 ÷ 2 = 5, remainder 0
5 ÷ 2 = 2, remainder 1
2 ÷ 2 = 1, remainder 0
1 ÷ 2 = 0, remainder 1

Reading the remainders from bottom to top gives the binary representation: 1010.

Conversely, to convert a binary number to decimal, each bit is multiplied by an increasing power of 2, starting from the rightmost bit. The results are summed to obtain the decimal value. For example, to convert the binary number 1010 to decimal:

1 * 2^3 = 8
0 * 2^2 = 0
1 * 2^1 = 2
0 * 2^0 = 0

Adding the results: 8 + 0 + 2 + 0 = 10.

Computers perform these conversions internally when working with decimal numbers, allowing them to process and manipulate decimal values using binary arithmetic. Additionally, programming languages often provide libraries or built-in functions to facilitate conversion between decimal and binary representations.

Suggested readings:

First Year B Pharm Notes, Syllabus, Books, PDF Subjectwise/Topicwise

F Y B Pharm Sem-IF Y B Pharm Sem-II
BP101T Human Anatomy and Physiology I TheoryBP201T Human Anatomy and Physiology II – Theory
BP102T Pharmaceutical Analysis I TheoryBP202T Pharmaceutical Organic Chemistry I Theory
BP103T Pharmaceutics I TheoryBP203T Biochemistry – Theory
BP104T Pharmaceutical Inorganic Chemistry TheoryBP204T Pathophysiology – Theory
BP105T Communication skills TheoryBP205T Computer Applications in Pharmacy Theory
BP106RBT Remedial BiologyBP206T Environmental sciences – Theory
BP106RMT Remedial Mathematics TheoryBP207P Human Anatomy and Physiology II Practical
BP107P Human Anatomy and Physiology PracticalBP208P Pharmaceutical Organic Chemistry I Practical
BP108P Pharmaceutical Analysis I PracticalBP209P Biochemistry Practical
BP109P Pharmaceutics I PracticalBP210P Computer Applications in Pharmacy Practical
BP110P Pharmaceutical Inorganic Chemistry Practical
BP111P Communication skills Practical
BP112RBP Remedial Biology Practical