NUMBER SYSTEM
A number system is a way of writing numbers using specific symbols or digits. It helps us
represent numbers mathematically. There are different types of number systems, such as the
decimal, binary, octal, and hexadecimal systems.
Types of Number Systems
Based on the base value and the number of allowed digits, number systems are of many
types.
The four common types of Number Systems are:
Decimal Number System
Number system with a base value of 10 is termed a Decimal number system. It uses 10 digits
i.e. 0-9 for the creation of numbers. Here, each digit in the number is at a specific place with
a place value of a product of different powers of 10. Here, the place value is termed from
right to left as first place value called units, second to the left as Tens, so on Hundreds,
Thousands, etc.
For example, 10264 has place values as,
(1 × 104) + (0 × 103) + (2 × 102) + (6 × 101) + (4 × 100)
= 1 × 10000 + 0 × 1000 + 2 × 100 + 6 × 10 + 4 × 1
= 10000 + 0 + 200 + 60 + 4
= 10264
Binary Number System
Number System with base value 2 is termed as Binary number system. It uses 2 digits i.e. 0
and 1 for the creation of numbers. The numbers formed using these two digits are termed
Binary Numbers. The binary number system is very useful in electronic devices and
computer systems because it can be easily performed using just two states ON and OFF i.e. 0
and 1.
● Decimal Numbers 0-9 are represented in binary as: 0, 1, 10, 11, 100, 101, 110, 111,
1000, and 1001
● For example, 14 can be written as (1110)2, 19 can be written as (10011)2 and 50 can
be written as (110010)2.
Octal Number System
Octal Number System is one in which the base value is 8. It uses 8 digits i.e. 0-7 for the
creation of Octal Numbers. Octal Numbers can be converted to Decimal values by
multiplying each digit with the place value and then adding the result.
Octal Numbers are useful for the representation of UTF-8 numbers.
Example,
● (135)10 can be written as (207)8
● (215)10 can be written as (327)8
Hexadecimal Number System
The Number System with base value 16 is termed as Hexadecimal Number System. It uses 16
digits for the creation of its numbers. Digits from 0-9 are taken like the digits in the decimal
number system but the digits from 10-15 are represented as A-F i.e. 10 is represented as A,
11 as B, 12 as C, 13 as D, 14 as E, and 15 as F.
Hexadecimal Numbers are useful for handling memory address [Link] hexadecimal
number system provides a condensed way of representing large binary numbers stored and
processed.
Examples,
● (255)10 can be written as (FF)16
● (1096)10 can be written as (448)16
● (4090)10 can be written as (FFA)16
Binary Coded Decimal (BCD)
Binary Coded Decimal (BCD) is a binary encoding system in which each decimal digit is
represented by a fixed number of binary bits, typically four. Instead of converting the entire
decimal number into a binary number, BCD represents each decimal digit separately as its
binary equivalent.
● BCD powers digital systems like clocks and calculators, making decimal displays
possible.
● It’s the go-to choice for systems with human interaction, like digital displays and data
entry tools.
● BCD makes arithmetic easier by treating each decimal digit separately.
● Embedded systems rely on BCD for fast and efficient decimal operations.
Working of Binary Coded Decimal
In BCD, each decimal digit (0-9) is converted into its 4-bit binary equivalent. For example:
● Decimal 0 is represented as 0000 in BCD.
● Decimal 1 is represented as 0001 in BCD.
● Decimal 2 is represented as 0010 in BCD and so on.
For instance, the decimal number 57 would be represented in BCD as two separate 4-bit
binary numbers:
● Decimal 5 becomes 0101
● Decimal 7 becomes 0111
So, 57 in BCD is represented as 0101 0111.
Truth Table for Binary Coded Decimal
Decimal
Number BCD
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
Decimal
Number BCD
7 0111
8 1000
9 1001
ASCII Code (American Standard Code for Information
Interchange)
🔹 Introduction
The ASCII code is a character encoding system developed in the early 1960s to allow
computers and electronic devices to represent and exchange textual data (letters, numbers,
punctuation marks, etc.) using binary numbers.
Computers can only understand binary (0s and 1s), so ASCII provides a standardized way to
map human-readable characters to machine-readable binary codes.
🔹 Structure of ASCII Code
ASCII uses 7 bits to represent each character.
This means it can represent 2⁷ = 128 different characters, numbered from 0 to 127.
In modern computers, each ASCII character is stored in 8 bits (1 byte) for convenience, with
the 8th bit often used for:
● Error checking (parity)
● Or later extended versions like Extended ASCII (8-bit, 256 characters)
🔹 Categories of ASCII Characters
Category Decimal Range Example
Control characters 0–31 Non-printable (e.g., Enter, Tab, Backspace)
Printable characters 32–126 Letters, digits, symbols
Space character 32 (represents blank space)
Digits 48–57 ‘0’ to ‘9’
Uppercase letters 65–90 ‘A’ to ‘Z’
Lowercase letters 97–122 ‘a’ to ‘z’
Delete 127 Used to delete a character
🔹 Examples
Character Decimal Code Binary (7-bit) Binary (8-bit stored)
A 65 1000001 01000001
B 66 1000010 01000010
a 97 1100001 01100001
0 48 110000 00110000
@ 64 1000000 01000000
Space 32 0100000 00100000
🔹 How ASCII Works
Let’s take an example:
When you type the word "Cat" on your keyboard:
● C → ASCII code 67 → binary 01000011
● a → ASCII code 97 → binary 01100001
● t → ASCII code 116 → binary 01110100
So, the computer stores it as:
01000011 01100001 01110100
Thus, what we see as text, the computer stores and processes as binary data.
🔹 Why ASCII is Important
1. Standardization – ASCII provided a universal standard for text communication
across different devices and systems.
2. Data transmission – Used in networking, file formats, and communication protocols.
3. Simplicity – Easy to implement in hardware and software.
4. Foundation for other encodings – Modern character encodings like UTF-8 (used in
the web and Unicode) are based on ASCII.
🔹 Limitations
● ASCII can only represent 128 characters, which is fine for English but not for other
languages (like Hindi, Chinese, Arabic, etc.).
● To overcome this, Extended ASCII (8-bit, 256 characters) and later Unicode
(UTF-8, UTF-16) were developed to support global scripts.
Importance of Number Systems in Computing
● Data representation: Used to store and manipulate data.
● Arithmetic operations: Essential for calculations and processing.
● Communication: Helps in data transmission between hardware and software.
● Memory addressing: Used for efficient data storage and retrieval.
Advantages of Number System in Computer Organization
● Efficient data representation: Different number systems allow efficient storage and
processing of numerical data.
● Binary logic compatibility: The binary system aligns with electronic circuits and
logic gates.
● Error detection and correction: Helps in detecting and correcting data transmission
errors.
● Memory optimization: Number systems like hexadecimal reduce memory
consumption by compactly representing large binary numbers.
Disadvantages of Number System in Computer Organization
● Complexity in conversion: Converting between different number systems can be
time-consuming and prone to errors.
● Human readability: Binary and hexadecimal numbers are difficult to interpret
directly by humans.
● Limited precision: Fixed-point representations have precision limitations, affecting
computations.
● Learning curve: Understanding various number systems and conversions requires
practice and learning.
Conversion Between Number Systems
1. Decimal to Binary Conversion
Example: Convert 25 to binary:
1. Divide by 2: 25 / 2 = 12, remainder 1
2. 12 / 2 = 6, remainder 0
3. 6 / 2 = 3, remainder 0
4. 3 / 2 = 1, remainder 1
5. 1 / 2 = 0, remainder 1
Binary representation: 11001
2. Binary to Decimal Conversion
Example: Convert 1011 to decimal: 1×23+0×22+1×21+1×20=8+0+2+1=111 \times 2^3 + 0
\times 2^2 + 1 \times 2^1 + 1 \times 2^0 = 8 + 0 + 2 + 1 = 11
3. Decimal to Hexadecimal Conversion
Example: Convert 254 to hexadecimal:
1. Divide by 16: 254 / 16 = 15, remainder 14 (E)
2. 15 / 16 = 0, remainder F
Hexadecimal representation: FE
Binary arithmetic is one of the fundamental concepts in the field of digital electronics and
computer engineering. It is basically the mathematics of binary numbers allow to perform
various arithmetic operations on binary numbers. We know that the binary number system
has two digits, i.e., 0 and 1 which are used to represent the ON or OFF states of the digital
systems. Hence, binary arithmetic forms the foundation of the digital computing.
In this chapter, we will discuss the following four main binary arithmetic operations −
● Binary Addition
● Binary Subtraction
● Binary Multiplication
● Binary Division
Lets discuss each of these binary arithmetic operations in detail along with solved examples.
Binary Addition
In binary arithmetic, the process of adding two binary numbers is called binary addition.
Where, the binary numbers consist of only 0 and 1. In the binary addition, a carry is
generated when the sum is greater than 1.
Rules of Binary Addition
The addition of two binary numbers is performed according to these rules of binary
arithmetic −
0+0=0
0+1=1
1+0=1
1+1=10(Sum=0&Carry=1)
Let us consider some examples to understand the binary addition.
Example 1
Add two binary numbers, 1101 and 1110.
Solution
The binary addition of the given binary numbers is described below −
Explanation
Add 1 (rightmost bit of first number) and 0 (rightmost bit of the second number). It gives 1 +
0 = 1 (thus, write down 1 as sum bit).
Add 0 (second rightmost bit of first number) and 1 (second rightmost bit of the second
number). It gives 0 + 1 = 1 (write down 1 as sum bit).
Add 1 (third rightmost bit of first number) and 1 (third rightmost bit of second number). It
gives 1 + 1 = 10 (write down 0 as sum and 1 as carry).
Add 1 (leftmost bit of the first number), 1 (leftmost bit of second number) and 1 (carry). It
gives 1 + 1 + 1 = 11 (write down 1 as sum and 1 as carry).
Write the end around carry 1 in the sum.
Thus, the result is 11011.
Example 2
Add 1010 and 11011.
Solution
The binary addition of given numbers is explained below −
Explanation
Add 0 (rightmost bit of first number) and 1 (rightmost bit of second number). It gives 0 + 1 =
1 (write down 1 as sum).
Add 1 (second rightmost bit of first number) and 1 (second rightmost bit of second number).
It gives 1 + 1 = 10 (write down 0 as sum and 1 as carry).
Add 0 (third rightmost bit of first number), 0 (third rightmost bit of second number), and 1
(carry). It gives 0 + 0 + 1 = 1 (write down 1 as sum).
Add 1 (leftmost bit of first number) and 1 (second leftmost bit of second number). It gives 1
+ 1 = 10 (write down 0 as sum and 1 as carry).
Add 1 (leftmost bit of second number) and 1 carry. It gives 1 + 1 = 10 (write down 0 as sum
and 1 as the end around carry).
Hence, the sum of 1010 and 11011 is 100101.
Binary Subtraction
In binary arithmetic, binary subtraction is a mathematical operation used to find the
difference between two binary numbers.
In binary subtraction, each bit of the binary numbers is subtracted, starting from the rightmost
bit.
Also, a borrow bit can be taken from higher bits if require.
Rules of Binary Subtraction
The binary subtraction is performed as per the following rules of binary arithmetic −
00=0
10=1
01=1(borrow1fromthenexthigherbit)
11=0
Let us see some examples to understand the binary subtraction.
Example 1
Subtract 1100 from 1101.
Solution
The subtraction of given binary numbers is given below −
1101 1100 = 0001
Explanation
Subtract 0 (rightmost bit of second number) from 1 (rightmost bit of first number). It gives 1
0 = 1 (write down 1 as difference).
Subtract 0 (second rightmost bit of second number) from 0 (second rightmost bit of first
number). It gives 0 0 = 0 as result.
Subtract 1 (third rightmost bit of second number) from 1 (third rightmost bit of first number).
It gives 1 1 = 0 as result.
Subtract 1 (leftmost bit of second number) from 1 (leftmost bit of first number). It gives 1 1 =
0 as result.
Thus, the difference of 1101 and 1100 is 0001.
Example 2
Subtract 101 from 1111.
Solution
The subtraction of given binary numbers is explained below −
Explanation
Subtract rightmost bits: 1 1 = 0
Subtract second rightmost bits: 1 1 = 1
Subtract third rightmost bits: 1 1 = 0
Subtract leftmost bits: 1 0 = 1
Thus, the result is 1010.
Example 3
Subtract 1011 from 1101.
Solution
The binary subtraction of 1101 and 1011 is given below −
Explanation
Subtract rightmost bits: 1 1 = 0.
Subtract second rightmost bits: 0 1 = 1. A borrow 1 is taken from the next higher bit.
Subtract third rightmost bits: 0 0 = 0. The 1 borrow is given to previous bit.
Subtract leftmost bits: 1 1 = 0.
Thus, the difference of 1101 and 1011 is 0010.
Binary Multiplication
In binary arithmetic, binary multiplication is the process of multiplying two binary numbers
and obtain their product.
In binary multiplication, we multiply each bit of one binary number by each bit of another
binary number and then add the partial products to obtain the final product.
Rules of Binary Multiplication
The multiplication of two binary numbers is performed as per the following rules of binary
arithmetic −
0×0=0
0×1=0
1×0=0
1×1=1
It is clear that the binary multiplication is similar to the decimal multiplication. Let us
understand the binary multiplication with the help of solved examples.
Example 1
Multiply 1101 and 11.
Solution
The binary multiplication of given numbers is described below −
Explanation
Multiply the rightmost bit of the second number, 1 by each bit of the first number (1101).
Now, shift the partial product one position to the left to perform the next multiplication.
Multiply the leftmost bit of the second number, 1 by each bit of the first number (1101).
Finally, sum up all the partial products to obtain the final product.
Hence, the product of 1101 and 11 is 100111.
Example 2
Multiply 11011 and 110.
Solution
The multiplication of given binary numbers is demonstrated below −
Explanation
Multiply rightmost bit of the second number (0) by each bit of the first binary number
(11011).
Shift the partial product one position to the left.
Multiply the second rightmost bit of the second number (1) by each bit of the first binary
number (11011).
Again, shift the partial product one position to the left.
Multiply the leftmost bit of the second number (1) by each bit of the first number.
Then, sum up all the partial products to obtain the final product.
Hence, the product of 11011 and 110 is 10100010.
Binary Division
Binary division is one of the basic arithmetic operations used to find the quotient and
remainder when dividing one binary number by another.
Rules of Binary Division
The following rules of binary arithmetic are utilized while diving one binary number by
another −
0÷0=Undefined
0÷1=0withRemainder=0
1÷0=Undefined
1÷1=1withRemainder=0
Binary Division Procedure
● Start dividing from the leftmost bits of the dividend by the divisor.
● Multiply the quotient obtained by the divisor and subtract from the dividend.
● Bring down the next bits of the dividend and repeat the division process until all the
bits of given divided are used.
Let us consider some solved examples to understand the binary division.
Example 1
Divide 110011 by 11.
Solution
The division of the given binary numbers is explained below −
110011 11 = 10001
In this example of binary division, the quotient obtained is 10001 and the remainder is 0.
Example 2
Divide 11011 by 10.
Solution
The binary division of 11011 by 10 is explained below −
11011 10 = 1101
In this example, the quotient is 1101 and the remainder is 1.