Understanding Number Systems in Digital Circuits
Understanding Number Systems in Digital Circuits
Number System: Number System is a method of representing numbers with the help of a set of
symbols and rules; it is a mathematical notation used to represent quantities or values in various
forms.
• Humans understand decimal and computers understand binary, so we have two different
number systems.
• Binary can be long for large amount of data, so there are more systems like octal and
hexadecimal that allow binary sequence to be broken into groups making it less error-
prone and readable compared to binary.
As shown in the above Figure, binary is the foundation of all data representation in computers.
Let’s now explore the different number systems that enable this process.
Number systems provide a structured way to represent numbers, enabling arithmetic operations
and ensuring consistent, understandable notation.
• A number system uses a base (or radix) to represent values.
• The base refers to the number of unique digits, including zero, that a system uses to
represent numbers.
• Each system has its own set of rules for representing.
Let's discuss the various types of number systems in detail, along with the solved examples.
Decimal Number System
• The Decimal Number System is the standard system for denoting numbers.
• It is also called the base-10 system.
• Digits used in it are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
• Each digit in the number is at a specific place value that is powers of 10.
• From right to left - units has the place value as 100, Tens has the place value as 101,
Hundreds as 102, Thousands as 103, and so on.
Example:
10285 can be written as
10285 = (1 × 104) + (0 × 103) + (2 × 102) + (8 × 101) + (5 × 100)
10285 = 1 × 10000 + 0 × 1000 + 2 × 100 + 8 × 10+ 5 × 1
10285 = 10000 + 0 + 200 + 80 + 5
10285 = 10285
Binary numbers use base-2. To convert a decimal number to binary, follow the steps given below:
• Step 1: Divide the Decimal Number with the base of the number system to be converted
to. Here the conversion is to binary, hence the divisor will be 2.
• Step 2: The remainder obtained from the division will become the least significant digit
of the new number.
• Step 3: The quotient obtained from the division will become the next dividend and will
be divided by the base i.e. 2.
• Step 4: The remainder obtained will become the second least significant digit i.e. it will
be added to the left of the previously obtained digit.
Now, the steps 3 and 4 are repeated until the quotient obtained becomes 0, and the remainders
obtained after each iteration are added to the left of the existing digits.
After all the iterations are over, the last obtained remainder will be termed as the Most Significant
digit.
Decimal to Octal Conversion
Let’s look at an example of converting a decimal number to octal:
Hexadecimal uses base-16, with digits 0–9 and A–F (where A = 10, B = 11, C = 12, D = 13, E =
14, F = 15). Follow these steps:
• Step 1: Divide the Decimal Number with the base of the number system to be converted
to. Here the conversion is to Hex hence the divisor will be 16.
• Step 2: The remainder obtained from the division will become the least significant digit
of the new number.
• Step 3: The quotient obtained from the division will become the next dividend and will
be divided by base i.e. 16.
• Step 4: The remainder obtained will become the second least significant digit i.e. it will
be added to the left of the previously obtained digit.
Now, the steps 3 and 4 are repeated until the quotient obtained becomes 0, and the remainders
obtained after each iteration are added to the left of the existing digits.
NOTE: If the remainder is 10–15, use A–F (e.g., A = 10, B = 11, C = 12, D = 13, E = 14, F =
15).
Beyond conversions, the decimal system also supports techniques like complements, used in
subtraction and error detection.
9’s and 10’s Complement of Decimal (Base-10) Number
Complements are used in number systems to simplify subtraction and error detection in digital
systems. In the decimal system, the 9’s complement and 10’s complement are commonly used.
Steps to Find 9’s Complement: Steps to Find 10’s Complement:
1. Write the given decimal number. 1. Find the 9’s complement of the
number.
2. Subtract each digit from 9.
2. Add 1 to the least significant digit
Example : 9’s Complement of 2020
(LSB).
9-2=7
Example : 10’s Complement of 2020
9-0=9
• 9’s complement of 2020 = 7979
9-2=7
• Adding 1: 7979 + 1 = 7980
9-0=9
Thus, the 10’s complement of 2020 is 7980
Thus, the 9’s complement of 2020 is 7979.
Steps:
• Step 1: Multiply each digit of the Binary number with the place value of that digit, starting
from right to left i.e. from LSB to MSB.
• Step 2: Add the result of this multiplication and the decimal number will be formed.
Steps:
Step 1: Divide the binary number into groups of four digits starting from right to left i.e.
•
from LSB to MSB.
• Step 2: Convert these groups into equivalent hex digits.
Arithmetic Operations on Binary Numbers
We can easily perform various operations on Binary Numbers. Various arithmetic operations on
the Binary number include,
• Binary Addition
• Binary Subtraction
• Binary Multiplication
• Binary Division
Now, let's learn about the same in detail.
Binary Addition
The result of the addition of two binary numbers is also a binary number. To obtain the result of
the addition of two binary numbers, we have to add the digits of the binary numbers digit by
digit. The table below shows the rules of binary addition.
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
'OCTAL' is derived from the Latin word 'OCT' which means Eight. The number system with
base 8 and symbols ranging between 0-7 is known as the Octal Number System. Each digit of an
octal number represents a power of 8. It is widely used in computer programming and digital
systems. Octal number system can be converted to other number systems and visa versa.
For example, an octal number (10)8 is equivalent to 8 in the decimal number system, 001000 in
the binary number system and 8 in the hexadecimal number system.
Now, we will learn about the conversion of octal number system to other number systems one by
one.
Conversion from Octal to Other Number Systems
Octal Numbers are represented with digits 0-7 and with base 8. Conversion of a number system
means conversion from one base to another. Following are the conversions of the Octal Number
System to other Number Systems:
Octal to Decimal Conversion
Octal numbers are represented in base 8, but the decimal numbers are of base 10. Hence, to
convert an octal number to a decimal number, the base of that number is to be changed.
Example: (247)8 is to be converted to decimal:
• Step 1: Multiply each digit of the Octal number with the place value of that digit, starting
from right to left i.e. from LSB to MSB.
• Step 2: Add the result of this multiplication and the decimal number will be formed.
Octal to Binary Conversion
Octal numbers are represented in base 8, but the binary numbers are of base 2. Hence, to convert
an octal number to a binary number, the base of that number is to be changed.
Example: (247)8 is to be converted to binary
• Step 1: We need to convert the Octal number to Binary first. For that, follow the steps
given in the above conversion.
• Step 2: Now to convert the binary number to Hex number, divide the binary digits into
groups of four digits starting from right to left i.e. from LSB to MSB.
• Step 3: Add zeros before MSB to make it a proper group of four digits(if required)
• Step 4: Now convert these groups into their relevant decimal values.
• Step 5: For values from 10-15, convert it into Hex symbols i.e from A-F
Decimal to Octal Conversion
The image added below shows binary to octal conversion.
• Step 1: Convert the Hex symbols into their equivalent decimal values.
• Step 2: Write each digit of the Hexadecimal number separately.
• Step 3: Convert each digit into an equivalent group of four binary digits.
• Step 4: Combine these groups to form the whole binary number.
Hexadecimal to Octal Conversion: Convert hexadecimal to binary, group the binary digits into
sets of three (right to left), and convert each group to its octal equivalent.
Example: (B2E)16 is to be converted to hex
• Step 1: We need to convert the Hexadecimal number to Binary first. For that, follow the
steps given in the above conversion.
• Step 2: Now to convert the binary number to an Octal number, divide the binary digits
into groups of three digits starting from right to left i.e. from LSB to MSB.
• Step 3: Add zeros before MSB to make it a proper group of three digits(if required)
• Step 4: Now convert these groups into their relevant decimal values.
Let's now understand how to convert a given decimal number into its equivalent binary coded
decimal.
Example: Decimal to Binary Coded Decimal Conversion
The following example shows how a decimal number is converted to a BCD code ?
Convert (125)10 into its equivalent binary coded decimal (BCD) code.
Decimal number 1 2 5
BCD Weights 8 4 2 1 8 4 2 1 8 4 2 1
BCD Code 0 0 0 1 0 0 1 0 0 1 0 1
Hence, the binary coded decimal for (125)10 is (0001 0010 0101).
Binary Coded Decimal Addition
Binary coded decimal addition follows the rules of binary arithmetic, however there are some
extra things that require to be taken care of. The BCD addition of two BCD numbers is
performed as per the following steps
• Step 1 Perform addition of two BCD numbers by following the rules of binary addition.
• Step 2 If the result or sum is a 4-bit binary number which is less than or equal to 9, then
the sum is a valid BCD number.
• Step 3 If the sum is a 4-bit number that is greater than 9 or if a carry is generated, then it
is an invalid sum.
• Step 4 To obtain the corrected result/sum, add 6 (0110) to the 4-bit invalid sum. If a carry
is generated when 6 is added, then propagate and add this carry to the next 4-bit group.
This step is done to skip the six illegal BCD codes (i.e. 1010, 1011, 1100, 1101, 1110, and
1111).
After getting the knowledge of BCD addition and rules of binary addition, let us now consider
some solved examples to understand the BCD addition in detail.
Example 1
Perform the addition 30 + 15 in BCD scheme.
Solution : Given decimal numbers and their equivalent BCD representation is,
(30)10 = (0011 0000)BCD
(15)10 = (0001 0101)BCD
The BCD addition of the given numbers is as below
30 0011 0000
+ 15 + 0001 0101
45 0100 0101
Example 2
Perform addition 678 + 535 in Binary Coded Decimal.
Solution : Given decimal numbers and their BCD representation is,
• (678)10 = 0110 0111 1000
• (535)10 = 0101 0011 0101
The BCD addition is as below
+1 1 1
Tutorial Problems
• Find the sum of BCD numbers (0001 1001) and (0100 1000).
• Find the sum of decimal number 25 and 35 in BCD.
Conclusion
In conclusion, BCD addition is performed by adding individual digits of the decimal numbers
represented in 4-bit binary groups starting from the right most digit. If the sum term is not an
illegal BCD code and there is no carry output, then no correction is required. If the sum term is
an illegal BCD code or if a carry is produced, then 6 (0110) is added to the sum term of the group
to correct the result.
Logic gates :
Example :
Let’s say a certain logic two
numbers are equal
The rule would be “is equal”
If the two input numbers are
equal, it will go into its ON
position, indicating true
But we learned before that computers only think of things in terms of ON and OFF,
which to them is 1 and 0
So a computer wouldn’t take an input of 5 or 6 – all of the information need to be 0s and
1s
Reminder:
Input refers to the information you give the logic gate, and output refers to what it
spits out!
Let’s try this example again, keeping this rule in mind!
NOT gate truth table :
Input Output
A Y=
A
0 1
1 0
Input Output
A B Y = A.B
0 0 0
0 1 0
1 0 0
1 1 1
Input Output
A B Y=A+
B
0 0 0
0 1 1
1 0 1
1 1 1
LOGIC GATES USING SWITCH
NOR Gate
A NOR gate is a combination of an OR gate followed by a NOT gate. It outputs a 1 only
when all its inputs are 0; otherwise, it outputs 0.
Symbol and Truth Table
Realizing Basic Gates Using NAND and NOR
1) NOT gate using NAND gate
A OUTPUT
(NOT A)
0 1
1 0
2) AND gate using NOR gate : Circuit: Use three NOR gates. First, connect each input to a
NOR gate and then connect their outputs to the inputs of another NOR gate.
Truth Table:
A B OUTPUT
Y = A AND B
0 0 0
0 1 0
1 0 0
1 1 1
3) OR gate using NOR gate : Circuit: Use a combination of NOR gates, with the final gate
configured as a OR gate.
Truth Table:
A B OUTPUT
= A OR B
0 0 0
0 1 1
1 0 1
1 1 1
A B OUTPUT
Y = A NAND B
0 0 0
0 1 0
1 0 0
1 1 1
Special Purpose Gates : (EX-OR, EX-NOR) X-OR, X-NOR
An XOR gate is a difference detector. It produces a HIGH (1) output only when its inputs are
different from each other.
An XNOR gate is an equality detector. It produces a HIGH (1) output only when its inputs are
the same.
X-OR gate :
“XOR” an abbreviation for “Exclusively-OR.” The simplest XOR gate is a two-input digital
circuit that outputs a logical “1” if the two input values differ, i.e., its output is a logical “1” if
either of its inputs are 1, but not at the same time (exclusively).
Input Output
A B Y= A XOR B
0 0 0
0 1 1
1 0 1
1 1 0
Truth Table:
A B OUTPUT
= A XOR B
0 0 0
0 1 1
1 0 1
1 1 0
Truth Table:
A B OUTPUT
= A XOR B
0 0 0
0 1 1
1 0 1
1 1 0
X-NOR gate :
X-NOR gate using NAND gate
Truth Table:
A B OUTPUT
= A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1
A B OUTPUT
= A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1
Enable(E) = 1
S1 Y(Output)
0 T1
1 T2
4:1 Multiplexer
The 4 : 1 multiplexer has 4 inputs and 2
control signals.
Truth Table
Enable(E) = 1
S1 S2 Y(Output)
0 0 T1
0 1 T2
1 0 T3
1 1 T4
8 : 1 multiplexer
The 8 : 1 multiplexer has 8 inputs and 3
control signals.
Truth Table:
Enable(E) = 1
S1 S2 S3 Y(Output)
0 0 1 T1
0 1 0 T2
0 1 1 T3
0 1 1 T4
1 0 1 T5
1 1 0 T6
1 1 1 T7
1 1 1 T8
Applications of Multiplexers
• Transmission from the Computer System of a Satellite - Multiplexer is used to transmit
the data signals from the computer system of a spacecraft or a satellite to the ground
system by using a GSM satellite.
• Computer Memory - Multiplexers are used in computer memory to maintain a huge
amount of memory in the computers, and also to reduce the number of copper lines
required to connect the memory to other parts of the computer.
• Telephone Network - In telephone networks, multiple audio signals are integrated on a
single line of transmission with the help of a multiplexer.
Demultiplexers
Introduction
A demultiplexer performs the reverse operation of a multiplexer i.e. it receives one input and
distributes it over several outputs. It has only one input, n outputs, m select input. At a time only
one output line is selected by the select lines and the input is transmitted to the selected output
line. A de-multiplexer is equivalent to a single pole multiple way switch as shown in fig.
Demultiplexers in multiple variations.
1 : 2 demultiplexer 1: 4 demultiplexer
Truth table S1 S0
1 : 8 demultiplexer - 1 : 16 demultiplexer – A 1 : 16 demultiplexer
can be implemented using two 1 : 8
demultiplexers.
Applications of Demultiplexers
• Arithmetic Logic Unit - The output of the ALU is fed as an input to the De-multiplexer,
and the output of the demultiplexer is connected to a multiple register. The output of the
ALU can be stored in multiple registers.
• Serial to Parallel Converter - In this technique, serial data is given as an input to the De-
multiplexer at a regular interval, and a counter is attached to the demultiplexer at the
control input to detect the data signal at the output of the demultiplexer. When all data
signals are stored, the output of the demux can be read out in parallel.
Working of 1:4 demultiplexer can be understood using simple logic gates as shown below.
FLIP-FLOP
The flip-flop is a circuit that maintains a state until directed by input to change the state. A basic
flip-flop can be constructed using four-NAND or four-NOR gates. A flip-flop is popularly known
as the basic digital memory circuit. It has its two states as logic 1(High) and logic 0 (Low) states.
• A flip-flop is a sequential circuit which consists of a single binary state of information or
data.
• The digital circuit is a flip-flop which has two outputs and are of opposite states. It is also
known as a Bistable Multivibrator.
Types of Flip-Flops :
• SR Flip Flop • JK Flip Flop
• D Flip Flop • T Flip Flop
Logic diagrams and truth tables of the different types of flip-flops are as follows:
S-R Flip Flop
In the flip flop, with the help of preset and Block Diagram of S-R Flip Flop
clear when the power is switched ON, the
states of the circuit keeps on changing, that is
it is uncertain. It may come to set(Q=1) or
reset(Q’=0) state. In many applications, it is
desired to initially set or reset the flip flop that
is the initial state of the flip flop that needs to
be assigned. This thing is accomplished by the
preset(PR) and the clear(CLR).
D Flip Flop
The D Flip Flop Consists a single data input(D), a clock input(CLK),and two outputs: Q and Q'
(the complement of Q).
Block Diagram of D Flip Flop
T Flip Flop
The T Flip Flop consists of data input (T), a clock input (CLK), and two outputs: Q and Q' (the
complement of Q).
Block Diagram of T Flip Flop
Given Below is the Block Diagram of T Flip Flop
Circuit Diagram and Truth Table of T Flip Flop
Given Below is the Circuit Diagram and Truth Table of T Flip Flop
Applications of Flip-Flops
These are the various types of flip-flops being used in digital electronic circuits and the
applications of Flip-flops are as specified below.
Counters: The Flip Flop are used in the Counter Circuits for Counting pulse or events.
Frequency Dividers: The Flip Flop are used in Frequency Dividers to divide the frequency of a
input signal by a specific factor.
Shift Registers: The Shift registers consist of interconnected flip-flops that shift data serially.
Storage Registers: The Storage Resistor uses Flip Flop to store data in binary information.
Bounce elimination switch: The Flip Flop are used in Bounce elimination switch to eliminate
the contact bounce.
Data storage: The Flip Flop are used in the Data Storage to store binary data temporarily or
permanently.
Data transfer: The Flip Flops are used for data transfer in different electronic parts.
Latch: The Latches are the Sequential circuit which uses Flip Flop for temporary storage of data
Registers: The Registers are mode from the array of flip flop which are used to store data
temporarily.
Memory: The Flip Flops are the main components in the memory unit for data storage.