Chapter 1 – Number System
Introduction to Number System
A number system is an ordered set of symbols with rules for arithmetic operations and conversions. Every
number system has a set of unique characters or literals. The four different number systems are binary,
decimal, octal, and hexadecimal. This is essential in digital electronics number systems; it allows the
representation and manipulation of positive, negative, integer, and fractional numbers.
Binary System
There are only two digits in the binary system, namely, 0 and 1. Binary number system, where bi-means
two, and two symbols are used as '0' and '1'. It uses basic ten symbols or numbers from 0 to 9 but in
digital circuits. The base or radix of a binary number system is two. A binary digit '0' or '1' is called a bit.
Four bits form a nibble, and eight bits form a byte. We deal in larger units called kilobyte, megabyte, and
gigabyte.
Decimal number system
The decimal number system is used in our day-to-day Life has a base of 10 with digits 0-9. A number is
presented by its two values symbol value (any digit from 0 to 9) and positional value (in terms of base
value). Decimal numbers must be converted to binary to be represented in computer systems.
Octal number system
The octal number system is called the base-8 system as it has a total of eight digits (0–7). Decimal
numbers 0 to 7 match octal, but decimal 8 is octal 10. Octal numbers are easily converted to binary, with
each octal digit represented by a three-bit binary number.
Hexadecimal number system
The hexadecimal number system It consists of 16 unique symbols (0–9, A–F) and is called the base 16
system. Hexadecimal numbers are widely used in microprocessor work and can be easily converted to
binary, with each hex digit represented by a four-bit binary number.
Introduction to Binary Number System
Binary Number to Octal Number Conversion
Binary Number to Hexadecimal Number Conversion
Binary Number to Decimal Number Conversion
Binary to Decimal Conversion
To convert a binary numbers Into decimal number, following are the steps:
Step 1: Write the given binary Number
Step 2: Write the binary weightage below each number
Step 3: Cancel the weightage, which is placed below zero because any number multiplied by zero is zero.
Step 4: Add the remaining numbers.
Examples Of Binary to Decimal Conversion
1. Convert (110011)₂ into decimal
1 1 0 0 1 1
= 2⁵ + 2⁴ + 2³ + 2² + 2¹ + 2⁰
= 32 + 16 + + 2 + 1
= (51)₁₀
∴ (110011)₂ = (51)₁₀
2. If (100001)₂ = (x)₁₀ find X
1 0 0 0 0 1
= 32 + + 1
X = 33
∴ (100001)₂ = (33)₁₀
Fractional binary numbers:
To convert the mixed binary numbers containing integers and fractions, we can follow the same steps.
Example:
Convert (1100.1011)₂ into decimal
(1100.1011)₂ = (1 × 2³) + (1 × 2²) + (0 × 2¹) + (0 × 2⁰)
+ (1 × 2⁻¹) + (0 × 2⁻²) + (1 × 2⁻³) + (1 × 2⁻⁴)
= 8 + 4 + 0 + 0 + 0.5 + 0 + 0.125 + 0.0625
= (12.6875)₁₀
Introduction to binary number system
There are only two digits in the binary system, namely, 0 and 1. Binary number system, where bi means
two, and two symbols are used as '0' and '1'. It use basic ten symbols or numbers from 0 to 9 but in digital
circuits. The base or radix of a binary number system is two. A binary digit '0' or '1' is called a bit. Four
bits form a nibble, and eight bits form a byte. We deal in larger units called kilobyte, megabyte, and
gigabyte.
Advantages of binary code and its Positive and negative Logic System
1. Binary coding simplifies the design of digital circuits like computers, calculators, and other digital
systems.
2. Binary can represent large amounts of data compactly using bits and bytes (e.g., ASCII for
characters).
3. Different logic can be applied behind the two numbers, such as if we take a lamp, meter, or
electric signal to represent these numbers, then:
Example:
Logic 0 1
Lamp OFF ON
Voltmeter 0V +5V
4. It is very easy to perform mathematical and Logical operations and Conversion of binary to
decimal and decimal to binary.
5. The Binary Number system is more accurate, fast, and readable number system. It can be executed
quickly by digital systems, leading to better performance.
Positive and negative logic system:
In positive logic, the higher voltage level indicates level 1.
In negative logic, the higher voltage level indicates level 0.
Example: If levels are +5V and 0V, then:
In positive logic → +5V indicates level 1.
In negative logic → 0V indicates level 1.
In the case of a lamp:
Positive logic: level 1 = Lamp ON
Negative logic: level 1 = Lamp OFF
Radix and Binary Counting
Radix is a number, which indicates the base of a specific number system. This number represents the total
symbols of the system and the weightage or power of each digit.
Examples:
1. Decimal system radix is 10 → symbols are 0–9, weightage in powers of 10.
Example: (6834)₁₀ = 6×10³ + 8×10² + 3×10¹ + 4×10⁰
2. Binary system radix is 2 → symbols are 0 and 1.
Example: (101011)₂ = (1×2⁵) + (0×2⁴) + (1×2³) + (0×2²) + (1×2¹) + (1×2⁰)
Number System Radix Symbols
1. Decimal Number System → 10 → 0,1,...,8,9
2. Binary Number System → 2 → 0 and 1
3. Octal Number System → 8 → 0,1,...,7
4. Hexadecimal Number System → 16 → 0,1,...,9,A,B,...F
Decimal counting:
Decimal sequence: 0,1,2,...,9,10,11,...99,100 etc.
Binary sequence: 0,1,10,11,100,101,110,111,1000,1001,...
Binary Number Decimal Value
0 0
1 1
10 2
11 3
100 4
101 5
110 6
111 7
1000 8
1001 9
1010 10
1011 11
RELATED QUESTIONS
Write a binary representation of the following hexadecimal number: 98E
Try the following conversion: (1010111)₂ = (?)₁₀
Write a binary representation of the following hexadecimal number: 132.45
Write a binary representation of the following hexadecimal number: BCA1
Write a binary representation of the following hexadecimal number: 4026
Try the following conversion: (220)₈ = (?)₂
Try the following conversion: (11001010)₂ = (?)₁₀
Introduction to Decimal Number System Conversion
Decimal Number to Binary Number Conversion
Decimal Number to Octal Number Conversion
Decimal Number to Hexadecimal Number Conversion
Decimal to binary Conversion
A decimal number is converted into its binary equivalent number. Dividing the given number by two and
taking only remainders does this. This method of dividing by two is known as the "Double-Dabble
method." MSB represents "Most Significant Bit," which represents the first number in a given number,
which has the maximum weightage. LSB means the "Least Significant Bit," which represents the last
number that has the lowest weightage.
For example:
1. To convert decimal number into binary number, divide the given number by '2' till you get '1'
(29)₁₀ = (11101)₂
It can be verified by reverse process:
1 1 1 0 1
16 + 8 + 4 + + 1
= 29
2. Convert (102)₁₀ into binary
∴ (102)₁₀ = (1100110)₂
Fractional numbers:
To convert fractional numbers into decimals, multiply each bit by 2 and take the integer value out.
Example:
Convert (88.625)₁₀ into binary
∴ (88.625)₁₀ = (1011000.101)₂
Note: In case of odd fractional members, find the binary numbers up to 4 digits or 5 digits to use
approximation.
Introduction to Hexadecimal Number Systems
Hexadecimal Number to Decimal Number Conversion
Hexadecimal Number to Binary Number Conversion
Hexadecimal Number to Octal Number Conversion
Applications of Hexadecimal Number System
Introduction to Hexadecimal Number System
The hexadecimal number system It consists of 16 unique symbols (0–9, A–F) and is called the base 16
system. Each alphanumeric digit is represented as a group of 4 binary digits because 4 bits (2⁴ = 16) are
sufficient to represent 16 alphanumeric symbols. Hexadecimal numbers are widely used in
microprocessor work and can be easily converted to binary, with each hex digit represented by a four-bit
binary number.
Hex to decimal conversion
The decimal equivalent of a hexadecimal number equals the sum of all hexadecimal digits multiplied by
their weights. In the hexadecimal number system, the weight of each position of digit is in powers of 16.
Example:
1. (2C6E)₁₆
2 C 6 E
= (2 × 16³) + (C × 16²) + (6 × 16¹) + (E × 16⁰)
= (2 × 4096) + (12 × 256) + (6 × 16) + (14 × 1)
= 8192 + 3072 + 96 + 14
2. (3A.2F)₁₆
= 3 × 16¹ + 10 × 16⁰ + 2 × 16⁻¹ + 15 × 16⁻²
= (58.1836)₁₀
Decimal to Hexadecimal conversion
For conversion from decimal to hexadecimal, we can keep dividing the decimal number by 16 (for the
integer part) and multiplying by 16 for the fractional part. For the integer part, remainders are arranged in
reverse order, and for the fractional part, carries are arranged in forward order.
1. Integer part:
(928)₁₀ = (3A0)₁₆
2. Fractional part:
0.5 × 16 = 8.0 ↓
(0.5)₁₀ = (0.8)₁₆
Therefore:
(95.5)₁₀ = (5F.8)₁₆
Hex to Binary and Binary to Hex conversion
Hexadecimal to Binary Conversion:
To convert a hexadecimal number into a binary number, convert each hex digit into a 4-bit binary code,
just like 8421 BCD.
1. Convert (5AD)₁₆ into binary
5 A D
0101 1010 1101
2. Convert (C9F.2A)₁₆ into binary
C 9 F . 2 A
1100 1001 1111 . 0010 1010
Binary to Hexadecimal Conversion:
Convert a binary number into hexadecimal by grouping 4-bits starting from LSB towards MSB (for
integer part) and then replacing each group with its hexadecimal representation.
1. Convert (110100011111)₂ into hex
1101 0001 1111
= D 1 F
2. Convert (11110010.1110)₂ into hex
1111 0010 . 1110
= F 2 . E
RELATED QUESTIONS
Express the following decimal number into a hexadecimal number: 100.25
Express the following hexadecimal number into an equivalent decimal number.
Introduction to Octal Number System
Octal Number to Decimal Number Conversion
Octal Number to Binary Number Conversion
Octal Number to Hexadecimal Number Conversion
Introduction to Octal Number System
The octal number system is called the base-8 system as it has a total of eight digits (0–7). Decimal
numbers 0 to 7 match octal, but decimal 8 is octal 10. Octal numbers are easily converted to binary, with
each octal digit represented by a three-bit binary number. Octal number system was devised for compact
representation of the binary numbers.
Decimal to Octal conversion
Convert the given decimal number into Octal, like double-dabble method, where the given integer
number is divided by 8 and for fractional numbers, multiply by 8.
1. (175)₁₀
(175)₁₀ = (257)₈ ........ Ans.
2. (2470)₁₀
(2470)₁₀ = (4646)₈ ........ Ans.
Octal to Binary and Binary to Octal Conversion
Binary to Octal Conversion:
Binary numbers can be converted into equivalent octal numbers by making groups of three bits starting
from LSB and moving towards MSB for integer part of the number and then replacing each group of
three bits by its octal representation.
For the fractional part, the groupings of three bits are made starting from the binary point. If required, we
can add leading and trailing zeros.
Examples:
1. Convert (110100011111)₂ into Octal
= 110 100 011 111
= 6 4 3 7
2. Convert (110100101.110011)₂ into Octal
= 110 100 101 . 111 011
= 6 4 5 . 7 3
Octal to binary conversion:
Octal numbers can be converted into equivalent binary numbers by replacing each octal digit by its 3-bit
equivalent binary.
Examples:
1. Convert (523)₈ into binary
= 5 2 3
= 101 010 011
2. Convert (704.01)₈ into binary
= 7 0 4 . 0 1
= 111 000 100 . 000 001
Hex to Octal and Octal to Hex Conversion
Hexadecimal to Octal Conversion:
To convert a hex number into an octal, first convert hex into binary, and then make groups of 3-bits from
LSB and add zeros on the left and right sides if required. After making the groups, convert each 3-bit
binary into an octal equivalent.
Examples:
1. (5CA)₁₆ = (?)₈
5 C A
(0101 1100 1010)₂
= 010 111 001 010
= 2 7 1 2
∴ (5CA)₁₆ = (2712)₈
2. (3B.2E)₁₆ = (?)₈
3 B . 2 E
(0011 1011 . 0010 1110)₂
= 000 111 011 . 001 011 100
= 0 7 3 . 1 3 4
∴ (3B.2E)₁₆ = (073.134)₈
Octal to Hexadecimal Conversion:
To convert an octal number into a hex, first convert the octal into a binary, and then make groups of 4 bits
from LSB and add zeros on the left and right sides if required. After making the groups convert each 4-bit
binary into a hex equivalent.
Examples:
1. (537)₈ = (?)₁₆
5 3 7
(101 011 111)₂
= 0001 0101 1111
= 1 5 F
∴ (537)₈ = (15F)₁₆
2. (53.21)₈ = (?)₁₆
5 3 . 2 1
(101 011 . 010 001)₂
= 0010 1011 . 0100 0100
= 2 D . 4 4
∴ (53.21)₈ = (2D.44)₁₆
RELATED QUESTIONS
Write the binary equivalent of the following octal number: 2306
Express the following octal number into their equivalent decimal number: 6760
Convert the following binary number into an octal and hexadecimal number: 1110001000
Express the following octal number into their equivalent decimal number: 10.75
Convert the following binary number into an octal and hexadecimal number: 1010100
Write the binary equivalent of the following octal number: 65.203
Write the binary equivalent of the following octal number: 5610
Express the following octal number into their equivalent decimal number: 455
BCD
ASCII
EBCDIC CODES
BCD
BCD stands for Binary Coded Decimal. This code is useful for the conversion of numbers into binary
form. BCD numbers are binary-coded decimal numbers.
In BCD, each decimal digit is represented by its equivalent four-bit binary number. The circuits of pocket
calculators can process BCD numbers because you enter decimal numbers through the keyboard and see
decimal answers on an LED. Digital clocks, digital voltmeters, and electronic counters work with BCD
numbers.
Advantages of BCD
1. The length of the number is short.
2. Easy to convert to and from BCD.
3. Suitable for hexadecimal addition.
Example:
1. 100100111001BCD
= 1001 0011 1001
↓ ↓ ↓
9 3 9
There are some other codes, like 5421 BCD, 5311 BCD, etc. But the most common method is 8421 BCD.
ASCII and EBCDIC CODES
These codes are normally used for computer keyboards; ASCII code uses either 7-bit code or 8-bit code
to represent the numbers and the characters. ASCII stands for American Standard Code for
Information Interchange.
EBCDIC code is a similar 8-bit code that was developed by IBM, which is obtained by extending a six-bit
BCD code. It is an Extended BCD Interchange Code.
Example:
In ASCII, the code for CAT is easily obtained by writing the binary code for C, A and T.
C = 11 0011
A = 11 0001
T = 01 0011 (Refer to the ASCII 7-bit Chart)
CAT = (11 0001 11 0001 01 0011)
ASCII code Table:
×3 ×2 ×1 ×0
×6 ×5 ×4
010 011 100 101 110 111
0000 SP 0 @ P p
0001 ! 1 A Q a q
0010 " 2 B R b r
0011 # 3 C S c s
0100 $ 4 D T d t
0101 % 5 E U e u
0110 & 6 F V f v
0111 ' 7 G W g w
1000 ( 8 H X h x
1001 ) 9 I Y i y
1010 * : J Z j z
1011 + ; K k
1100 , < L l
1101 - = M m
1110 . > N n
1111 / ? O o
Introduction Binary Addition and Subtraction
1’s and 2’s Complement for subtraction
Introduction to Binary Addition & Subtraction
Binary Addition:
The rules for binary addition are given in table:
A B Sum Carry Result
0 0 0 0 0
0 1 1 0 1
1 0 1 0 1
1 1 0 1 10
For example,
1. (1011)₂ + (1100)₂
1 0 1 1
+ 1 1 0 0
---------------
1 0 1 1 1
↑
Carry
∴ (1011)₂ + (1100)₂ = (10111)₂
Binary Subtraction:
The rules for binary subtraction are given in table:
A B Difference Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
For example,
1. (1011)₂ – (0110)₂
1 0 1 1
- 0 1 1 0
---------------
0 1 0 1
∴ (1011)₂ – (0110)₂ = (0101)₂
These rules are to be strictly followed; only then can correct results be generated.
1’s and 2’s Complement for subtraction
Subtraction using One’s Complement:
In a binary number, if each 1 is replaced by 0 and each 0 by 1, the resulting number is known as the one’s
complement of the first number.
Steps to calculate 1’s complement subtraction:
1. Find binary of A
2. Find 1’s complement of B
3. Add step 1 with step 2
4. (i) If carry 1 is present, the answer is +ve (make End around carry).
(ii) If carry is absent, the answer is -ve (find 1’s complement).
Example:
1. 7 – 5:
7 → 0111
– 5 → 0101
One’s complement of 5 = 1010
Add: 0111 + 1010 = 1 0001
End around carry: 0001 + 1 = 0010
Subtraction using Two’s Complement:
If 1 is added to the one’s complement of a binary number, the resulting number is known as the two’s
complement of the binary number.
Steps to calculate 2’s complement subtraction:
1. Find binary of A
2. Find 2’s complement of B
3. Add step 1 with step 2
4. (i) If carry 1 is present, the answer is +ve (discard carry).
(ii) If carry is absent, the answer is -ve (find 2’s complement).
Example:
1. 7 – 5:
7 → 0111
– 5 → 0101
Two’s complement of 5 = 1011
Add: 0111 + 1011 = 1 0010
Discard carry → 0010
Answer = (0010)₂
Binary Multiplication and Division
Binary Multiplication:
Binary multiplication is similar to decimal multiplication. In binary, each partial product is either zero or
exactly the same as the multiplicand.
Example:
1. (101 × 110)₂ = (5 × 6)₁₀
1 0 1
×
0 0 0
+ 1 0 1 ×
+ 1 0 1 × ×
---------------
1 1 1 1 0 = (30)₁₀
Binary Division:
Binary division is obtained using the same procedure as decimal division.
Example:
1. Divide (1110101)₂ by (1001)₂
1101
----------------
1001 ) 1110101
1001
----
1011
1001
----
001001
1001
----
0000
Answer: (1101)₂