24ec102 Unit - II
24ec102 Unit - II
24ec102 Unit - II
proceeding:
This document is confidential and intended solely for the educational purpose
of RMK Group of Educational Institutions. If you have received this document
through email in error, please notify the system manager. This document
contains proprietary information and is intended only to the respective group /
learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender
immediately by e-mail if you have received this document by mistake and
delete this document from your system. If you are not the intended recipient
you are notified that disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.
24EC102 DIGITAL PRINCIPLES AND
SYSTEM DESIGN
(Lab Integrated)
Batch/Year: 2024-2028 / I
Created by:
Dr.V.Tamil Selvi
Dr.N.Padmavathi
Dr U.Nagabalan
Ms.S.Jayanthi
Mr.V.S.Prabhu
Ms.P.Santhoshini
Ms.R.M.Senthil Priya
1 Contents 5
2 Course Objectives 6
5 Course Outcomes 10
6 CO-PO/PSO Mapping 11
Lecture Plan (S.No., Topic, No. of Periods, Proposed
7 date, Actual Lecture Date, pertaining CO, Taxonomy 12
level, Mode of Delivery)
8 Activity based learning 13
Lecture Notes ( with Links to Videos, e-book reference
9 27
and PPTs)
10 Assignments 111
List of Exercise/Experiments:
Design of combinational circuits - Half and Full Adders, Half and Full Subtractors, Binary
Parallel Adder – Carry look ahead Adder, Magnitude Comparator, Decoder, Encoder, Priority
Encoder, Mux/De-mux, Parity Generator/Checker
List of Exercise/Experiments:
2. Design of adders
3. Design of subtractors.
4. Design of binary adder using IC7483
5. Design of Multiplexers & Demultiplexers.
6. Design of Encoders and Decoders.
7. Implementation of a boolean function using a multiplexer
Flip flops – SR, JK, T, D, Master/Slave FF – operation and excitation tables, Asynchronous
and Synchronous Counters Design - Shift registers, Universal Shift Register
List of Exercise/Experiments:
8. Design and implementation of 3 bit ripple counters.
9. Design and implementation of 3 bit synchronous counter
10. Design and implementation of shift registers
4.Syllabus
24EC102 DIGITAL PRINCIPLES AND SYSTEM DESIGN L T P C
3 0 2 4
(LAB INTEGRATED)
Basic memory structure ROM: PROM – EPROM – EEPROM –RAM – Static and dynamic
RAM – Programmable Logic Devices: Programmable Logic Array (PLA) – Programmable
Array Logic (PAL) – Implementation of combinational logic circuits using PLA, PAL.
K6 Create
K5 Evaluate
K4 Analyze
K3 Apply
K2 Understand
K1 Remember
6. CO – PO /PSO Mapping
Matrix
CO PO PO PO PO PO PO PO PO PO PO PO PO PS PS PS
1 2 3 4 5 6 7 8 9 10 11 12 O1 O2 03
1 3 2 1 1 - - - - - - - - 3 - -
2 3 3 2 2 - - - - - - - - 3 - -
3 3 3 2 2 - - - - - - - - 3 - -
4 3 3 2 2 - - - - - - - - 3 - -
5 3 3 2 2 - - - - - - - - 3 - -
6 3 2 1 1 - - - - - - - - 3
7. Lecture Plan – Unit 2 – COMBINATIONAL
LOGIC CIRCUITS
Number Taxo
Sl. Proposed Mode of
Topic of CO nomy
No. Date Delivery
Periods Level
Design of combinational 25.09.2024
Experiment
1 circuits – Half Adder 2 & CO2 K2
al Learning
and Full Adders 26.09.2024
Half and Full Experiment
2 1 27.09.2024 CO2 K2
Subtractors al Learning
Chalk &
3 Binary parallel Adder 1 28.09.2024 CO2 K2
Board/ PPT
Carry look ahead Adder, 30.09.2024 Chalk &
4 1 CO2 K2
Magnitude comparator Board/ PPT
Decoder, Encoder, 01.10.2024
Chalk &
5 Priority Encoder 2 & CO2 K2
Board/ PPT
03.10.2024
PPT &
Mux/De-Mux
6 1 04.10.2024 CO2 K2 Learning by
doing
Chalk &
Parity CO2
7 1 05.10.2024 K2 Board/ PPT
Generator/Checker
13
ACTIVITY BASED LEARNING
• Simulate a 4 bit parallel adder circuit using multisim.
14
ACTIVITY-PUZZLE WORKSHEET
• The simple switch-and-diode circuit shown here is an example of a
digital encoder. Explain what this circuit does, as the switch is moved
from position to position:
This encoder generates a three-bit binary code corresponding to the switch position
(one out of eight positions).
Follow-up question: trace the path of electron flow through the circuit with the switch
in position #3.
Challenge question: are there other codes (besides binary) that could possibly be
generated with a circuit of this general design?
15
• Identify which diode is failed in this circuit, given the
following truth table (showing the actual operation of the
encoder circuit, not what it should do):
Switch Output
position code
0 000
1 001
2 010
3 011
4 100
5 001
6 110
7 111
16
QUIZ
1. If A and B are the inputs of a half adder, the sum is given by __________
a)A AND B
b)A OR B
c)A XOR B
d) A EX-NOR B
Answer: c
2. A and B are the inputs of a half adder, the carry is given by __________
a) A AND B
b) A OR B
c) A XOR B
d) A EX-NOR B
Answer: a
3. If A, B and C are the inputs of a full adder then the sum is given by
__________
a) A AND B AND C
b) A OR B AND C
c) A XOR B XOR C
d) A OR B OR C
Answer: c
4. If A, B and C are the inputs of a full adder then the carry is given by
__________
a) A AND B OR (A OR B) AND C
b) A OR B OR (A AND B) C
c) (A AND B) OR (A AND B)C
d) A XOR B XOR (A XOR B) AND C
Answer: a
5. How many AND, OR and EXOR gates are required for the configuration of full
adder?
a) 1, 2, 2
b) 2, 1, 2
c) 3, 1, 2
d) 4, 0, 1
Answer: b
17
6. The full subtractor can be implemented using ___________
a) Two XOR and an OR gates
b) Two half subtractors and an OR gate
c) Two multiplexers and an AND gate
d) Two comparators and an AND gate
Answer: b
7. Let A and B is the input of a subtractor then the output will be ___________
a) A XOR B
b) A AND B
c) A OR B
d) A EXNOR B
Answer: a
9. What is a multiplexer?
a) It is a type of decoder which decodes several inputs and gives one output
b) A multiplexer is a device which converts many signals into one
c) It takes one input and results into many output
d) It is a type of encoder which decodes several inputs and gives one output
Answer: b
10. If the number of n selected input lines is equal to 2^m then it requires
_____ select lines.
a) 2
b) m
c) n
d) 2n
Answer: b
18
11. How many select lines would be required for an 8-line-to-1-line multiplexer?
a) 2
b) 4
c) 8
d) 3
Answer: d
12. The discrepancy of 0 output due to all inputs being 0 or D0, being 0 is
resolved by using additional input known as ___________
a) Enable
b) Disable
c) Strobe
d) Clock
Answer: a
15. A circuit that compares two numbers and determine their magnitude is called
____________
a) Height comparator
b) Size comparator
c) Comparator
d) Magnitude comparator
Answer: d
19
16. What type of logic circuit is represented by the figure shown below?
a) XOR
b) XNOR
c) AND
d) XAND
Answer: b
17. Which of the following logic expressions represents the logic diagram shown?
a) X=AB’+A’B
b) X=(AB)’+AB
c) X=(AB)’+A’B’
d) X=A’B’+AB
Answer: d
18. The Boolean expression Y = (AB)’ is logically equivalent to what single gate?
a) NAND
b) NOR
c) AND
d) OR
Answer: a
20. The carry look ahead adder is based on the principle of looking at the lower
order bits of ________ and ________ if a high order carry is generated.
a) Addend, minuend
b) Minuend, subtrahend
c) Addend, minuend
d) Augend, addend
Answer: d
20
21. The inverter can be produced with how many NAND gates?
a) 2
b) 1
c) 3
d) 4
Answer: b
24. How many select lines are required for a 1-to-8 demultiplexer?
a) 2
b) 3
c) 4
d) 5
Answer: b
21
Activity-Multiple Choice Quiz
3) In an odd parity scheme, what would be the correct parity bit for the
binary string: 1101 0001
a) 1 1101 0001
b) 0 1101 0001
c) 0101 0001
d) 1101 0001 0
4) In an odd parity scheme, what would be the correct parity bit for the
binary string: 1111 0111
a) 0 1111 0111
b) 1 1111 0111
c) 0 1011 0111
d) 1111 0111 1
22
5) In an even parity scheme, what would be the correct parity bit for the
binary string: 1000 0111
a) 1 1000 0111
b) 0 1000 0111
c) 0 1100 0111
d) 1000 0111 0
6) In an even parity scheme, what would be the correct parity bit for the
binary string: 1000 0110
a) 0 1000 0111
b) 1 1000 0110
c) 1000 0111 1
d) 0 1100 0111
7) In an even parity scheme, what would be the correct parity bit for the
binary string: 1000 0000
a) 1 1000 0000
b) 0 1000 0000
c) 1 1100 0000
d) 1000 0000 1
8) In an odd parity scheme, what would be the correct parity bit for the
binary string: 1010 1010
a) 1 1010 1010
b) 0 1010 1010
c) 1 1110 1010
d) 1010 1010 1
9) In an odd parity scheme, what would be the correct parity bit for the
binary string: 1010 1111
a) 1 1010 1111
b) 0 1010 1111
c) 1010 1111 1
10) In an odd parity scheme, what would be the correct parity bit for the
binary string: 1010 0011
a) 1 1010 0011
b) 0 1000 0111
c) 1 1100 0111
d) 1010 0111 1
23
8. ACTIVITY BASED LEARNING
PUZZLE
Across
[3] Timing signal is called as ___.
[4] One input many output is called as_____.
[7] A binary no. obtained by complementing every bit of a
no.
[10] AND, OR, and NOT are ____ gates
[12] (A+B)+C= A+(B+C) is expression for ____ law.
[14] Base of decimal number system
[15] A+BC= (A+B) . (A+C) is expression for ____ law.
[16] Circuit whose value depends on present input and
previous output
[18] Parity counter is application of ____ logic gate
12
ACTIVITY BASED LEARNING
DOWN
[1] A combinational circuit performs addition of two
numbers
[2] Theorem used to change AND logic to OR and vice
versa
[5] Memory information is easily read and altered in ____
memory.
[6] Memory is not required in _____ circuits.
[8] 7432 is IC no of ___ logic gate
[9] FlipFlops are ___ triggered circuit
[11] Universal Gate
[13] Basic building block of sequential circuit
[16] Format of following Boolean expression is Y=A
?B+AB ?
[17] If any one of input is 1 output is zero. This is ___
Gate
[18] Number of distinct value in octal number systems
25
Puzzle -Solution
9.Lecture Notes
Unit 2
UNIT II COMBINATIONAL LOGIC
CIRCUITS
Sl. No. Contents
2 Half Adder
3 Full Adder
4 Half Subtractor
5 Full Subtractor
8 Magnitude Comparator
9 Decoder
10 Encoder
11 Priority Encoder
12 Multiplexer
13 De-multiplexer
14 Parity Generator/Checker
Introduction to Combinational
Circuits
The digital system consists of two types of circuits, namely
The logic gate is the most basic building block of combinational logic. The logical
function performed by a combinational circuit is fully defined by a set of Boolean
expressions.
A combinational circuit consists of input variables, logic gates, and output variables.
The logic gates accept signals from inputs and output signals are generated
according to the logic circuits employed in it.
Binary information from the given data transforms to desired output data in this
process. Both input and output are obviously the binary signals, i.e., both the input
and output signals are of two possible states, logic 1 and logic 0.
Combinational
. m outputs
n inputs . circuits
. .
The information stored in the memory elements at any given time defines the
present state of the sequential circuit. The present state and the external circuit
determine the output and the next state of sequential circuits.
Classification of Logic
Circuits
Introduction to Combinational
Circuits
The sequential circuits can be classified depending on the timing of their signals:
• Synchronous sequential circuits
• Asynchronous sequential circuits.
In synchronous sequential circuits, signals can affect the memory elements only
at discrete instants of time.
The memory elements used in both circuits are Flip-Flops, which are capable of
storing 1- bit information.
Half Adder
Half Adder is a combinational circuit that can be used to add two binary bits. It
has two inputs that represent the two bits to be added and two outputs, with one
producing the SUM output and the other producing the CARRY.
The truth table of a half-adder, showing all possible input combinations and the
corresponding outputs are shown below.
Inputs Outputs
A B Carry (C) Sum (S)
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
Carry, C = A . B
The first one representing the SUM output is that of an EX-OR gate, the second
one representing the CARRY output is that of an AND gate.
Full Adder
A full adder is a combinational circuit that forms the arithmetic sum of three input
bits. It consists of 3 inputs and 2 outputs.
Two of the input variables, represent the significant bits to be added. The third
input represents the carry from previous lower significant position. The block
diagram of full adder is given by,
Full Adder:
The full adder circuit overcomes the limitation of the half-adder, which can be
used to add two bits only. As there are three input variables, eight different input
combinations are possible. The truth table is shown below,
Inputs Outputs
A B Cin Sum Carry
(S) (Cout)
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
The Boolean expressions for the SUM and CARRY outputs are given by the
equations,
The logic diagram of the full adder can also be implemented with two half-
adders and one OR gate is as follows,
4. HALF SUBTRACTOR
Binary Subtractor
Half Subtractor
• It has two inputs and two outputs as shown in the block diagram.
Block Diagram
• The truth table for the half subtractor is listed in the table. The Borrow output is
1 when A is 0 and B is 1. The difference output is 1 when both the inputs are
different.
Truth Table
• The simplified Boolean function for the two outputs can be obtained directly
from the truth table.
• The logic diagram of the half subtractor implemented in sum of products is
shown in the figure.
= X Y
Logic Diagram
Limitations:
Multidigit subtraction along with borrow of the previous digit
subtraction is not possible with half subtractor.
5. FULL SUBTRACTOR
Full Subtractor
Block Diagram
• The truth table for the full subtractor is listed in the table.
• The simplified Boolean function for the two outputs can be obtained directly
from the truth table.
• The logic diagram of the full subtractor implemented in sum of products is
shown in the figure.
Truth Table K Map for Difference
Logic Diagram
Implementation of Full Subtractor using two Half-Subtractors
• A full subtractor is formed by two half subtractors,
• It involves three inputs such as minuend, subtrahend and borrow.
• Borrow bit among the inputs is obtained from subtraction of two binary digits
and is subtracted from next higher order pair of bits, outputs as difference and
borrow.
The 4-bit binary adder using full adder circuits is capable of adding two 4-bit
numbers resulting in a 4-bit sum and a carry output as shown in figure below.
• Since all the bits of augend and addend are fed into the adder circuits
simultaneously and the additions in each position are taking place at the same
time, this circuit is known as parallel adder.
• Let the 4-bit words to be added be represented by, A3A2A1A0= 1111 and
B3B2B1B0= 0011.
44
• The bits are added with full adders, starting from the least significant position, to
form the sum it and carry bit. The input carry C0 in the least significant position
must be
• The carry output of the lower order stage is connected to the carry input of the
next higher order stage. Hence this type of adder is called ripple-carry adder.
• In the least significant stage, A0, B0 and C0 (which is 0) are added resulting in
sum S0 and carry C1. This carry C1 becomes the carry input to the second stage.
• Similarly in the second stage, A1, B1 and C1 are added resulting in sum S1 and
carry C2, in the third stage, A2, B2 and C2 are added resulting in sum S2 and
carry C3, in the third stage, A3, B3 and C3 are added resulting in sum S3 and C4,
which is the output carry. Thus the circuit results in a sum (S3S2S1S0) and a
carry output (Cout).
45
7. Carry Look ahead Adder
In Parallel adder, all the bits of the augend and the addend are available for
computation at the same time.
The carry output of each full-adder stage is connected to the carry input of the
next high-order stage. Since each bit of the sum output depends on the value
of the input carry, time delay occurs in the addition process. This time delay is
called as carry propagation delay.
For example, addition of two numbers (0011+ 0101) gives the result as 1000.
Addition of the LSB position produces a carry into the second position. This
carry when added to the bits of the second position, produces a carry into the
third position.
This carry when added to bits of the third position, produces a carry into the
last position. The sum bit generated in the last position (MSB) depends on the
carry that was generated by the addition in the previous position. i.e., the
adder will not produce correct result until LSB carry has propagated through
the intermediate full-adders.
This represents a time delay that depends on the propagation delay produced
in an each full-adder. For example, if each full adder is considered to have a
propagation delay of 30nsec, then S3 will not react its correct value until 90nsec
after LSB is generated. Therefore total time required to perform addition is
90+ 30 = 120nsec.
The method of speeding up this process by eliminating inter stage carry delay
is called look ahead-carry addition. This method utilizes logic gates to look
at the lower order bits of the augend and addend to see if a higher-order
carry is to be generated. It uses two functions: carry generate and carry
propagate.
Carry Look ahead Adder
Consider the circuit of the full-adder shown above. Here we define two functions:
carry generate (Gi) and carry propagate (Pi) as,
Carry generate, Gi = Ai Bi
Carry propagate, Pi = Ai ⊕ Bi
the output sum and carry can be expressed as,
Si = Pi ⊕ Ci
Ci+1 = Gi + Pi Ci
Pi (carry propagate) because it is the term associated with the propagation of the
carry from Ci to Ci+1.
The Boolean functions for the carry outputs of each stage and substitute for each
Ci
its value from the previous equation:
C1= G0 + P0C0
C2= G1 + P1C1 = G1 + P1 (G0 + P0C0)
= G1 + P1G0 + P1P0C0
Using a Look-ahead Generator we can easily construct a 4-bit parallel adder with a
Look-ahead carry scheme. Each sum output requires two exclusive-OR gates.
The output of the first exclusive-OR gate generates the Pi variable, and the AND gate
generates the Gi variable. The carries are propagated through the carry look- ahead
generator and applied as inputs to the second exclusive-OR gate.
All output carries are generated after a delay through two levels of gates. Thus,
outputs S1 through S3 have equal propagation delay times.
Carry Look ahead Adder
• The advantages of carry look ahead adder are-
The outcome of the comparison is specified by three binary variables that indicate
whether A < B, A = B, or A > B.
From the above truth table logical expressions for each output can be expressed as
follows:
A>B : AB’
A<B : A’B
A=B : A’B’ + AB
2-BIT MAGNITUDE COMPARATOR
The circuit for comparing two n -bit numbers has 2 X 2n entries in the truth table.
So, for comparing two 2-bit numbers, the truth table has 2 2x2=16 entries
A = A1 A0
B = B1 B0
Truth table for comparison of two 2-bit numbers
The comparison A<B can be logically expressed by the following Boolean function
F(A<B) = A1’B1 + A1’A0’B0 + A0’B1B0
K-map
for F(A>B)
The comparison A>B can be logically expressed by the following Boolean function
F(A>B) = A1B1’ + A1A0B0’ + A0B1’B0’
=( A0 ⊙ B0)(A1⊙ B1)
The comparison A=B can be logically expressed by the following Boolean function
F(A=B) =( A0 ⊙ B0)(A1⊙ B1)
Logic diagram for 2-bit Magnitude Comparator
4- BIT MAGNITUDE COMPARATOR
The circuit for comparing two n -bit numbers has 22n entries in the truth
table and becomes complicated, even with n = 3.
B = B3 B2 B1 B0
To find if A=B
The two 4-bit numbers A and B are said to be
equal if A3=B3 & A2=B2 & A1=B1 & A0=B0
E
3
E
2
E1
E0
9. DECODER
• A decoder is similar to Demultiplexer but without any data input. Most digital
systems requires decoding of data. Decoding is necessary in applications such as
data demultiplexing, digital display, digital to analog converters and memory
addressing. A decoder is a combinational circuit that converts binary information
of n input lines to a maximum of 2n unique output lines. Such that one of each
output line will be activated for only one of the possible combinations of inputs. The
general structure of decoder circuit is given below:
58
2-to-4 Line decoder
• Here the 2 inputs are decoded into 4 outputs, each output representing one of the
minterms of the two input variables
• As shown in the truth table, if enable input is 1 (EN= 1) only one of the outputs (Y0 –
Y3), is active for a given input.
• The output Y0 is active, i.e.., Y0= 1 when inputs A= B= 0,
• Y1 is active when inputs, A= 0 and B= 1,
• Y2 is active, when input A= 1 and B= 0,
• Y3 is active, when inputs A= B= 1.
3- to-8 Line Decoder
• 3-to-8 line decoder has three inputs (A, B, C) and eight outputs (Y0- Y7). Based on
the 3 inputs one of the eight outputs is selected.
• The three inputs are decoded into eight outputs, each output representing one of the
minterms of the 3-input variables. This decoder is used for binary-to-octal conversion.
The input variables may represent a binary number and the outputs will represent the
eight digits in the octal number system. The output variables are mutually exclusive
because only one output can be equal to 1 at any one time. The output line whose
value is equal to 1 represents the minterm equivalent of the binary number presently
available in the input lines.
59
3-to-8 line decoder
Now, let us implement the following two higher-order decoders using lower-order
decoders.
Required No of Decoder =m1/m2
m1 is the number of outputs of lower order decoder.
m2 is the number of outputs of higher order decoder.
Here, m1 = 4 and m2 = 8.
Required number of 2 to 4 decoders=8/4
Therefore, we require two 2 to 4 decoders for implementing one 3 to 8 decoder.
60
Implementation of one 3 to 8 decoder using
two 2 to 4 decoder
61
Truth table for 4 - to -16
decoder
Inputs Outputs
A3 A2 A1 A0 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7
0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 1 0 1 0 0 0 0 0 0
0 0 1 0 0 0 1 0 0 0 0 0
0 0 1 1 0 0 0 1 0 0 0 0
0 1 0 0 0 0 0 0 1 0 0 0
0 1 0 1 0 0 0 0 0 1 0 0
0 0 1 1 0 0 0 0 0 0 1 0
0 1 1 1 0 0 0 0 0 0 0 1
Inputs Outputs
A3 A2 A1 A0 Y8 Y9 Y10 Y11 Y12 Y13 Y14 Y15
1 0 0 0 1 0 0 0 0 0 0 0
1 0 0 1 0 1 0 0 0 0 0 0
1 0 1 0 0 0 1 0 0 0 0 0
1 0 1 1 0 0 0 1 0 0 0 0
1 1 0 0 0 0 0 0 1 0 0 0
1 1 0 1 0 0 0 0 0 1 0 0
1 0 1 1 0 0 0 0 0 0 1 0
1 1 1 1 0 0 0 0 0 0 0 1
4- to 16 Decoder using 2 to 4
decoders.:
4- to 16 Decoder using 2 to 4 decoders.:
Required number of lower order decoders= m2/m1=16/4=4
Therefore, we require two 2 to 4 decoders for implementing one 4 to 16 decoder.
Combinational Logic Implementation using
Decoder
Since any boolean function can be expressed as a sum of minterms, a decoder that
can generate these minterms along with external OR gates that form their
logical
sums, can be used to form a circuit of any boolean function.
input to the full adder, first and second bits and carry bit, are used as input to the
decoder. Let x, y and z represent these three bits. Sum and Carry outputs of a full
X
adder have the followingYtruth tables-E
Z S C
0 0 0 0 0
0 0 1 1 0
S=∑m (1, 2, 4, 7)
0 1 0 1 0 C=∑m (3,5,6,7)
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Implement, with a decoder and external OR gates, the combinational
circuit specified by the following three Boolean functions:
f1(A, B, C) = Σm(0,5,7)
f2(A, B, C) = Σm(2,3,4)
f3(A, B, C) =Σm(1,6,7)
Each segment is made up of a material that emits light when current is passed
through it. The segments activated during each digit display are tabulated as—
66
BCD to 7-Segment Display Decoder
Truth table
67
BCD to 7-Segment Display Decoder
68
BCD to 7-segment display decoder
Applications of decoders
• Decoders are used in counter system.
• They are used in analog to digital converter.
• Decoder outputs can be used to drive a display system.
69
10. ENCODERS
• An encoder is a digital circuit that performs the inverse operation of a decoder.
Hence, the opposite of the decoding process is called encoding. An encoder is a
combinational circuit that converts binary information from 2n input lines to a
maximum of ‗n‘ unique output lines.
• The general structure of encoder circuit is –
• It has 2n input lines, only one which 1 is active at any time and ‗n‘ output lines.
It encodes one of the active inputs to a coded binary output with ‗n‘ bits. In an
encoder, the number of outputs is less than the number of inputs.
Octal-to-Binary Encoder
• It has eight inputs (one for each of the octal digits) and the three outputs that
generate the corresponding binary number. It is assumed that only one input has
a value of 1 at any given time.
70
• The encoder can be implemented with OR gates whose inputs are determined
directly from the truth table. Output z is equal to 1, when the input octal digit is 1 or
3 or 5 or 7. Output y is 1 for octal digits 2, 3, 6, or 7 and the output is 1 for digits 4,
5, 6 or
• These conditions can be expressed by the following output Boolean functions:
• z= D1+ D3+ D5+ D7
• y= D2+ D3+ D6+ D7
• x= D4+ D5+ D6+ D7
• The encoder can be implemented with three OR gates. The encoder defined in the
below table, has the limitation that only one input can be active at any given time. If
two inputs are active simultaneously, the output produces an undefined
combination.
• For e.g., if D3 and D6 are 1 simultaneously, the output of the encoder may be 111.
This does not represent either D6 or D3. To resolve this problem, encoder circuits
must establish an input priority to ensure that only one input is encoded. If we
establish a higher priority for inputs with higher subscript numbers and if D3 and D6
are 1 at the same time, the output will be 110 because D6 has higher priority than
D3.
Octal-to-Binary Encoder
• Another problem in the octal-to-binary encoder is that an output with all 0‘s is
generated when all the inputs are 0; this output is same as when D0 is equal to 1.
The discrepancy can be resolved by providing one more output to indicate that at
least one input is equal to 1.
71
11. PRIORITY ENCODER
A priority encoder is an encoder circuit that includes the priority function. In priority
encoder, if two or more inputs are equal to 1 at the same time, the input having the
highest priority will take precedence.
• In addition to the two outputs x and y, the circuit has a third output, V (valid bit
indicator). It is set to 1 when one or more inputs are equal to 1. If all inputs are
0, there is no valid input and V is equal to 0.
• The higher the subscript number, higher the priority of the input. Input D3, has
the highest priority. So, regardless of the values of the other inputs, when D3 is
1, the output for xy is 11.
• D2 has the next priority level. The output is 10, if D2= 1 provided D3= 0. The
output for D1 is generated only if higher priority inputs are 0, and so on down the
priority levels.
Truth table
• Although the above table has only five rows, when each don‘t care condition is
replaced first by 0 and then by 1, we obtain all 16 possible input combinations.
For example, the third row in the table with X100 represents minterms 0100 and
1100.
• The don‘t care condition is replaced by 0 and 1 as shown in the table below.
72
K-map Simplification:
73
12. MULTIPLEXER
• A multiplexer or MUX, is a combinational circuit with more than one input line,
one output line and more than one selection line. A multiplexer selects binary
information present from one of many input lines, depending upon the logic status
of the selection inputs, and routes it to the output line. Normally, there are 2n input
lines and n selection lines whose bit combinations determine which input is
selected. The multiplexer is often labelled as MUX in block diagrams.
• A multiplexer is also called a data selector, since it selects one of many inputs
and steers the binary information to the output line.
The multiplexer acts like an electronic switch that selects one of the two sources.
4-to-1-line Multiplexer
• 4-to-1-line multiplexer has four (2n) input lines, two (n) select lines and one
output line. It is the multiplexer consisting of four input channels and information
of one of the channels can be selected and transmitted to an output line
according to the select inputs combinations. Selection of one of the four input
channel is possible by two selection inputs.
• Each of the four inputs I0 through I3, is applied to one input of AND gate.
Selection lines S1 and S0 are decoded to select a particular AND gate. The
outputs of the AND gate are applied to a single OR gate that provides the 1-line
output.
Function table:
• To demonstrate the circuit operation, consider the case when S1S0= 10. The AND
gate associated with input I2 has two of its inputs equal to 1 and the third input
connected to I2.
• The other three AND gates have at least one input equal to 0, which makes their
outputs equal to 0. The OR output is now equal to the value of I2, providing a
path from the selected input to the output.
2. F (x, y, z) = ∑m (1, 2, 6, 7)
Solution:
Implementation table:
3. F ( A, B, C) = ∑m (1, 2, 4, 5)
Solution:
• Variables, n= 3 (A, B, C) Select lines= n-1 = 2 (S1, S0)
• 2n-1 to MUX i.e., 22 to 1 = 4 to 1 MUX Input lines= 2n-1 = 22 = 4 (D0, D1, D2,
D3)
Implementation table
Multiplexer Implementation
4. F( P, Q, R, S)= ∑m (0, 1, 3, 4, 8, 9, 15)
Solution:
•Variables, n= 4 (P, Q, R, S)
•Select lines= n-1 = 3 (S2, S1, S0)
•2n-1 to MUX i.e., 23 to 1 = 8 to 1 MUX
•Input lines= 2n-1 = 23 = 8 (D0, D1, D2, D3, D4, D5, D6, D7)
Implementation table
Multiplexer Implementation
5. Implement the Boolean function using 8: 1 and also using 4:1 multiplexer
F (A, B, C, D) = ∑m (0, 1, 2, 4, 6, 9, 12, 14)
Solution:
• Variables, n= 4 (A, B, C, D)
•Select lines= n-1 = 3 (S2, S1, S0)
• 2n-1 to MUX i.e., 23 to 1 = 8 to 1 MUX
•Input lines= 2n-1 = 23 = 8 (D0, D1, D2, D3, D4, D5, D6, D7)
Implementation table
Implementation table
Multiplexer Implementation
Implementation table
• Multiplexer Implementation:
Implementation Table:
Multiplexer Implementation:
10. An 8×1 multiplexer has inputs A, B and C connected to the selection inputs S2,
S1, and S0 respectively. The data inputs I0 to I7 are as follows I1=I2=I7= 0;
I3=I5= 1; I0=I4= D and I6= D'.
Determine the Boolean function that the multiplexer implements.
Multiplexer Implementation
F (A, B, C, D) = ∑m (3, 5, 6, 8, 11, 12, 13).
13. DEMULTIPLEXER
• Demultiplex means one into many. Demultiplexing is the process of taking
information from one input and transmitting the same over one of several
outputs.
• A demultiplexer is a combinational logic circuit that receives information on a
single input and transmits the same information over one of several (2n) output
lines.
1-to-4 Demultiplexer
• 1-to-4 demultiplexer has a single input, Din, four outputs (Y0 to Y3) and two
select inputs (S1 and S0).
• The input variable Din has a path to all four outputs, but the input information is
directed to only one of the output lines. The truth table of the 1-to-4
demultiplexer is shown below.
• From the truth table, it is clear that the data input, Din is connected to the output
Y0, when S1= 0 and S0= 0 and the data input is connected to output Y1 when
S1= 0 and S0= 1. Similarly, the data input is connected to output Y2 and Y3
when S1= 1 and S0= 0 and when S1= 1 and S0= 1, respectively. Also, from the
truth table, the expression for outputs can be written as follows,
Y0= S1’S0’Din
Y1= S1’S0Din
Y2= S1S0’Din
Y3= S1S0Din
Logic diagram of 1-to-4 demultiplexer
1-to-8 Demultiplexer
1-to-8 demultiplexer has a single input, Din, eight outputs (Y0 to Y7) and three
select inputs (S2, S1 and S0). It distributes one input line to eight output lines
based on the select inputs. The truth table of 1-to-8 demultiplexer is shown below
• From the truth table, it is clear that the data input is connected with one of the
eight outputs based on the select inputs. Now from this truth table, the
expression for eight outputs can be written as follows:
• Now using the above expressions, the logic diagram of a 1-to-8 demultiplexer can
be drawn as shown below. Here, the single data line, Din is connected to all the
eight AND gates, but only one of the eight AND gates will be enabled by the
select input lines. For example, if S2S1S0= 000, then only AND gate-0 will be
enabled and thereby the data input, Din will appear at Y0. Similarly, the different
combinations of the select inputs, the input Din will appear at the respective
output.
Logic diagram of 1-to-8 demultiplexer
1. Design 1:8 demultiplexer using two 1:4 DEMUX.
94
Single Parity Check
• In this technique,
• One extra bit called as parity bit is sent along with the original data bits.
• Parity bit helps to check if any error occurred in the data during the transmission.
Steps Involved-
• Error detection using single parity check involves the following steps-
Step-01:
• At sender side,
• Total number of 1’s in the data unit to be transmitted is counted.
• The total number of 1’s in the data unit is made even in case of even parity.
• The total number of 1’s in the data unit is made odd in case of odd parity.
• This is done by adding an extra bit called as parity bit.
Step-02:
• The newly formed code word (Original data + parity bit) is transmitted to the
receiver.
Step-03:
• At receiver side,
• Receiver receives the transmitted code word.
• The total number of 1’s in the received code word is counted.
• Then, following cases are possible-
• If total number of 1’s is even and even parity is used, then receiver assumes that
no error occurred.
• If total number of 1’s is even and odd parity is used, then receiver assumes that
error occurred.
• If total number of 1’s is odd and odd parity is used, then receiver assumes that no
error occurred.
• If total number of 1’s is odd and even parity is used, then receiver assumes that
error occurred.
• Parity Check Example-
• Consider the data unit to be transmitted is 1001001 and even parity is used.
• At Sender Side-
• Total number of 1’s in the data unit is counted.
• Total number of 1’s in the data unit = 3.
• Clearly, even parity is used and total number of 1’s is odd.
• So, parity bit = 1 is added to the data unit to make total number of 1’s even.
• Then, the code word 10010011 is transmitted to the receiver.
• At Receiver Side-
• After receiving the code word, total number of 1’s in the code word is counted.
• Consider receiver receives the correct code word = 10010011.
• Even parity is used and total number of 1’s is even.
• So, receiver assumes that no error occurred in the data during the transmission.
• Advantages:
1. This technique is guaranteed to detect an odd number of bit errors (one, three,
five and so on).
2. If odd number of bits flip during transmission, then receiver can detect by
counting the number of 1’s.
• Limitations:
1. This technique can not detect an even number of bit errors (two, four, six and so
on).
2. If even number of bits flip during transmission, then receiver can not catch the
error.
KINDS OF PARITY BITS
• At the receiving end, each group of incoming bits is checked to see if the group
totals to an even or odd number. If a transmission error occurs, the transmission
is retried or the system halts and an error message is sent to the user.
PARITY CHECKER CIRCUIT
98
• The above truth table can be simplified using K-map as shown below.
• The above logic expression for the even parity checker can be implemented by
using three Ex-OR gates as shown in figure. If the received message consists of
five bits, then one more Ex-OR gate is required for the even parity checking.
b) Odd Parity Checker
• Consider that a three bit message along with odd parity bit is transmitted at the
transmitting end.
• Odd parity checker circuit receives these 4 bits and checks whether any error are
present in the data.
• If the total number of 1s in the data is odd, then it indicates no error, whereas if
the total number of 1s is even then it indicates the error since the data is
transmitted with odd parity at transmitting end.
• The below figure shows the truth table for odd parity checker.
Truth Table for Odd Parity Checker
• The truth table of the odd parity generator can be simplified by using K-map as
• If the four-bit received message consists of an odd number of 1 means, no error
has occurred. If it contains an even number of 1 means, an error has occurred.
• Odd parity checker for three input message signal and odd parity bit can be
implemented with three EX-NOR Gates.
• E = (A Ex-NOR B) Ex-NOR (C Ex-NOR D)
• the outputs of an EXNOR gate are the inverse to that of the EXOR gate.
• The output parity bit expression for this generator circuit is obtained as
P = (A ⊕ B ⊕C)’
• The logic circuit for odd parity generator is shown below
• The K-map simplification for the 2-bit message even parity generator is
From the above table, the simplified expression of parity bit can be given as:
Y= A’ B + A B’
Y= A ⊕ B
The above expression could be implemented using an Ex-OR gate. The logic
diagram is as shown below. The 2-bit message along with the parity bit is
transmitted to the receiving end where the checker circuit checks for the
error.
104
3-bit Odd Parity Generator
• Suppose at the transmitting end now we have a 3-bit message signal, and we
wish to transmit it using odd parity.
• Then, the parity bit generated, P, would be as a result of odd parity generation.
• The total number of 1s in the input bits must be odd for the odd parity bit. If the
total number of 1s in input bits is odd, then P gets the value 0, and if it is even
then, P is assigned the value 1.
3-bit Odd Parity Generator truth table
Parity Generator/ Checker
• A Parity is a very useful tool in information processing in digital computers to
indicate any presence of error in bit information. External noise and loss of signal
strength causes loss of data bit information while transporting data from one
device to other device, located inside the computer or externally. To indicate any
occurrence of error, an extra bit is included with the message according to the
total number of 1s in a set of data, which is called parity.
• If the extra bit is considered 0 if the total number of 1s is even and 1 for odd
quantities of 1s in a set of data, then it is called even parity. On the other hand,
if the extra bit is 1 for even quantities of 1s and 0 for an odd number of 1s, then
it is called odd parity.
• The message including the parity is transmitted and then checked at the
receiving end for errors. An error is detected if the checked parity does not
correspond with the one transmitted. The circuit that generates the parity bit in
the transmitter is called a parity generator and the circuit that checks the parity in
the receiver is called a parity checker.
Parity Generator:
• A parity generator is a combination logic system to generate the parity bit at the
transmitting side. A table illustrates even parity as well as odd parity for a
message consisting of three bits.
• If the message bit combination is designated as A, B, C and Pe, Po are the even
and odd parity respectively, then it is obvious from table that the Boolean applied
to a parity checker circuit expressions of even parity and odd parity are
Truth table
106
• If the message bit combination is designated as A, B, C and Pe, Po are the even and
odd parity respectively, then it is obvious from table that the Boolean expressions of
even parity and odd parity are applied to a parity checker circuit. The circuit that
checks the parity at the receiver side is called the parity checker. The parity checker
circuit produces a check bit and is very similar to the parity generator circuit. If the
check bit is 1, then it is assumed that the received data is incorrect. The check bit will
be 0 if the received data is correct. The table shows the truth table for the even parity
checker.
k-map Simplification
The circuit that checks the parity at the receiver side is called the parity checker. The
parity checker circuit produces a check bit and is very similar to the parity generator
circuit. If the check bit is 1, then it is assumed that the received data is incorrect. The
check bit will be 0 if the received data is correct. The table shows the truth table for the
even parity checker.
107
Logic Diagram
108
Video Links
Sl. Topic Video Link
No.
1 Combination Circuit Design https://www.youtube.com/w
atch?v=uv_RJ1
Pv71s
2 Arithmetic Circuits https://www.youtube.com/w
atch?v=NAqR-
OGjgoQ
3 Carry Look Ahead Adders https://www.youtube.co
m/watch?v=36hCiz
Ok4PA
4 Magnitude Comparator https://spocathon.page/vi
deo/lecture-
26-magnitude-comparator
5 Encoders and Decoders https://www.youtube.co
m/watch?v=RZQTTf
U9TNA
6 Multiplexers https://www.youtube.com
and /watch?v=kxHRk7
DeMultiplexers Yczac
7. Decoder, https://drive.google.com/driv
Multiplexer, e/folders/17Xdb8c6FPDczKrk
Demultiplexer KK7woEQhrTDfxZfWy?usp=sh
aring
E-BOOKS
E-Books
1. Digital Fundamentals_ Global Ed – Thomas L Floyd
eBooK Links:
https://www.ebooknetworking.net/ebooks/dpsd-godse-book.html
https://www.vidyarthiplus.com
ASSIGNMENTS
Assignment 1: Home Security System Logic Design
•The alarm should also go off if there's a breach in the door contact sensor.
a)Formulate the Boolean function for the security system's alarm trigger.
Express the function in terms of motion detection (M), nighttime (N), and
door contact breach (D). Provide the minterms, maxterms, Sum of Product
c)Design a logic circuit using appropriate logic gates to implement the security
•The elevator should only move between floors if a valid floor request button
•If the emergency stop button is pressed, the elevator should halt its
operation immediately.
a)Define the Boolean function for controlling the elevator's movement based
on the conditions: valid floor request (F), doors closed (D), and emergency
stop (E). Present the minterms, maxterms, SOP, and POS forms.
c)Create a logic circuit diagram using suitable logic gates to implement the
specifications:
•The heating element should turn on if the room temperature falls below a
•The cooling system should engage if the room temperature exceeds a certain
nighttime (N). Provide the minterms, maxterms, SOP, and POS expressions.
c)Design a logic circuit using suitable logic gate components to implement the
• A logic diagram is realized from the simplified boolean expression using logic
gates.
A full adder is a combinational circuit that forms the arithmetic sum of three input
bits. It consists of 3 inputs and 2 outputs
Part A - Questions & Answers
9. Give the truth table for full adder [CO2, K2]
10. Draw the logic diagram for full adder [CO2, K2]
11. Draw the logic diagram for full adder using two half adders [CO2, K2]
Part A - Questions & Answers
12. What is carry propagation delay? [CO2, K2]
In Parallel adder, all the bits of the augend and the addend are available for
computation at the same time. The carry output of each full-adder stage is connected
to the carry input of the next high-order stage. Since each bit of the sum output
depends on the value of the input carry, time delay occurs in the addition process. This
time delay is called as carry propagation delay.
14. What is the propagation time for an n-bit parallel adder? [CO2, K2]
For an n-bit parallel adder, there are 2n gate levels for the carry to propagate
through.
b)The outputs will not be correct unless the signals are given enough time to
propagate through the gates connected from the inputs to the outputs.
c)Since, all the arithmetic operations are implemented by successive additions, the
time consumed during the addition process is very critical.
Part A - Questions & Answers
16. Mention the two ways for reducing the carry propagation time [CO2, K2]
• A half subtractor calculates the difference (D) and borrow-out (B_out) for 1-bit
inputs A and B.
• A full subtractor extends the half subtractor by including a borrow-in (B_in) input.
It produces a difference and borrow-out.
Truth Table:
A B D B_out
0 0 0 0
0 1 1 1
1 0 0 0
1 1 0 0
Logic Expressions:
• Half Subtractor: D = A XOR B, B_out = A' AND B
• Full Subtractor: D = A XOR B XOR B_in, B_out = (A AND B') OR (B_in AND (A XOR
B'))
28) What is the significance of the carry input and carry output in a full
adder? (CO2, k1)
The carry input (C_in) represents the carry generated from the previous bit's
addition, while the carry output (C_out) indicates whether there is a carry generated
in the current bit position.
30) Briefly explain the concept of carry propagation and carry generation.
(CO2, k1)
A carry look-ahead adder significantly reduces the propagation delay in adding binary
numbers by calculating carry signals in advance. This results in faster addition
operations compared to the ripple carry adder.
Part B Questions
Q. Questions K CO
No. Level Mapping
1 What are the design procedures for combinational K1 CO2
circuit?
Swayam:
• Digital Circuits By Prof. Santanu Chattopadhyay IIT
Kharagpur
• https://swayam.gov.in/nd1_noc19_ee51/preview
Coursera:
• Digital Systems: From Logic Gates to Processors
offered by Universitat Autònoma de Barcelona
• https://www.coursera.org/learn/digital-systems
Classcentral.com:
• Online Course - Digital Electronic Circuits by
Indian Institute of
Technology, Kharagpur and NPTEL via Swayam
• https://www.classcentral.com/course/swayam-
digital-electronic-circuits- 12953
Udemy:
• Master The Digital Electronics- Minimisation And
Basic Gates – [Learn about the digital gates, boolean
algebra, k-map| Update your digital from base to pro]
• https://www.udemy.com/course/professional-digital-
electronics/
Real Time Applications
1. Error Detection in Computer Networks-
• When sender transmits data to the receiver, the data might get scrambled by noise or
data might get corrupted during the transmission.
2. Parity checking in a real-time digital communications system
• In a digital communication system for voice signals, a system and method for
improving the quality of a received signal.
• The invention comprises a system for arranging the data and parity bits in a data
frame and a corresponding method for analyzing and using the received frames.
• In the present invention, the data are conveyed in short independent segments, such
as one or a few ADPCM nibbles. The length of each segment is chosen to be short
enough that the loss of one segment of data from the received signal does not
significantly degrade the quality of the output analog signal.
• The transmitter generates a parity bit for each of these segments and composes
transmit frames by alternating data segments with their corresponding parity bits.
The receiver then receives each data segment along with its corresponding parity bit.
• This arrangement allows the receiver to identify specific received segments that
contain errors, and minimizes the receiver's delay between receiving the segment and
determining if contains an error.
• The invention also comprises a system and method for detecting such an erroneous
segment and blanking it. If a received frame contains more than a threshold number
of erroneous segments, then the remaining segments of the frame can be muted.
Subsequent frames can then also be muted until one of the subsequent frames
contains fewer than a second threshold number of errors.
127
Real time Applications
APPLICATION OF MULTIPLEXER
APPLICATION OF DEMULTIPLEXER
Real time Applications
APPLICATION OF ENCODER & DECODER
• Linear Encoders
Linear encoders deal with the movement of objects along a path or
line, such as in the cut-to-length application mentioned earlier. This
type of encoder makes use of a transducer to measure the
movement or distance between two points, sometimes employing a
cable (longer distances) or a small rod (shorter distances). In these
cases, a cable is run between the encoder transducer and the moving
object. As the object moves, the transducer gathers data from the
cable and produces an analog or digital output signal that is used to
establish the object’s movement or position.
• Rotary Encoders
Rotary encoders are used to provide feedback about the movement
of a rotating object or device, such as the shaft of a motor. The
rotary encoder converts the angular position of the moving shaft into
an analog or digital output signal that will then enable a control
system to establish the shaft’s position or speed.
131
• Rotary encoders may contain shafts or can be of a design that is
known as thru-bore encoders, meaning that they are capable of
being directly mounted on top of a rotating shaft such as that of a
motor. Thru-bore encoders are available with a wide variety of
sizes and feature clamp or set screw mounting options making
them suitable for attachment in machine design applications.
Flanges are used to position the encoder and to keep it from
rotating with the moving shaft.
• Angle encoders are similar to rotary encoders in that they monitor
and provide feedback on rotational movement, but they are
different in that angle encoders tend to offer higher accuracy.
• Both linear and rotary encoders are available as either absolute or
incremental encoders, which describes the desired signal output
for the encoder. With an absolute encoder, the output signal
generated by the device results in a unique set of digital bits that
correspond to a specific position of the object being measured.
Even if power is lost, the absolute encoder by its design can
determine the position of the object since there is a specific digital
signal associated with every position.
• Rotary absolute encoders are available in both single-turn and
multi-turn designs. Single-turn encoders are capable of providing
information within any one shaft rotation. Multi-turn encoders are
capable of providing information about the position over many
rotations of shaft position, even large numbers of rotations.
• Absolute encoders are used in applications where knowing the
exact position of an object is important. They are also used in
situations where the machine or process is inactive for a large
percentage of time or moves at a very slow rate.
• Incremental encoders use a simpler method of counting
movement and rely on establishing the position of the object by
counting the number of pulses and then using that count to
compute the position. Because they rely on pulse counting, there is
no unique digital signature that can be used to determine an
absolute position.
132
• Hence in the event of a power loss, incremental encoders must be
referenced to a home position or reference point so that the
counter can be reset and then used to compute relative
movement. One way to think about the difference is that
incremental encoders measure the relative movement against
some point of reference, whereas absolute encoders measure the
position directly using a unique signal code that directly reflects
the position.
Optical encoders are the most accurate of all the sensing methods. A
rotary optical encoder consists of a light source such as an LED and a
rotating disk that is patterned with a series of opaque lines and
alternating translucent slots. As the light passes through the rotating
disk, a photosensor mounted on the opposite side of the disk detects
the light and generates a sinusoidal electrical signal that corresponds
to the presence of light detected from the translucent slots and the
absence of light from the opaque lines. An electrical circuit then
converts the sinusoidal signal to a square wave signal, which is a
series of high and low pulses. These pulses are sent to a control
circuit that can be used to measure the pulse count as the encoder
rotates and use that data to determine a position for the rotating
shaft or to control some action based on movement or position.
133
• Magnetic encoders rely on the detection of a change in magnetic
flux to establish the movement and position of an object. A
magnetic rotary encoder consists of a magnetized disk that has a
number of magnetic poles located along its circumference. A
sensor is positioned next to the disk, and as the disk rotates, the
sensor detects the change in the magnetic field as the different
poles in the disk surface pass near the sensor. The changing
magnetic field is used to generate a sinusoidal output signal that
can be converted to a square pulse for counting by a control
circuit. The sensor used in these encoders can either make use of
the Hall effect, which detects a change in voltage or can be
a magnetoresistive sensor that can detect the change in the
magnetic field directly.
134
Quadrature encoders
• While single-channel encoders can be used to establish motion and
movement, they suffer from the limitation that they cannot sense
the direction of movement. In a rotary encoder, for example, a
clockwise movement will generate the same output signal as a
counter clockwise movement, therefore the electrical output of
the encoder cannot detect the direction of rotation, only the
magnitude of the motion. This shortcoming can be eliminated by
making use of what is known as a quadrature encoder.
• Quadrature encoders make use of two output channels whose
electrical output signals are out-of-phase. To accomplish this, the
code disk inside of a quadrature encoder will contain two tracks –
one for each of the two signal channels A and B. The coding of
these tracks on the code disk is such that when signals are
generated (say by using an optical light source), the square wave
pulse from channel A is electrically 90o out of phase with the
square wave pulse from channel B. For the case of a rotary
encoder that is rotating in a clockwise direction, for example, the
channel A square wave pulses will “lead” those of channel B, and
when the rotational direction is switched to counter clockwise, the
channel B pulses will lead those of channel A. The use of two signal
channels that are phase-shifted therefore allows the control circuit
receiving the encoder output pulses to distinguish directionality of
motion. The same principle applies to linear motion encoders.
• Incremental quadrature encoders often add an additional signal
channel called a marker or index that serves to establish a
reference point which can then be used to establish the position as
well as the direction of movement.
135
1. Multiplexers:
• A multiplexer (MUX) selects one of many input signals and forwards
the selected input to a single output line. Real-time applications
include:
• Data Routing in Communication Systems:
• Multiplexers are used to manage data transmission between multiple sources and a
single line, optimizing bandwidth and reducing data traffic in systems like fiber-optic
communications or satellite transmission.
• Processor Control and Signal Selection:
• In microprocessor systems, multiplexers are used to select between different data
sources or instructions for processing, enhancing the overall efficiency of the
processor.
• Real-Time Video Streaming:
• Multiplexers are used in video systems to combine multiple video signals for
transmission over a single channel, facilitating multi-camera surveillance systems or
broadcasting multiple video feeds.
• Data Acquisition Systems:
• In real-time data acquisition, multiplexers select various sensor signals to be
processed, minimizing the need for multiple ADCs (Analog-to-Digital Converters).
2. Encoders:
• An encoder converts multiple input signals into a coded output
signal, typically reducing the number of required lines. Applications
include:
• Keyboard Encoding:
• Keyboard encoders translate key presses into binary codes that are processed by the
computer, reducing the number of connections required between the keyboard and
processor.
• Robotic Control Systems:
• In robotic systems, encoders convert angular or linear positions of joints and motors
into digital signals, which are then used for feedback control.
• Wireless Communication:
• Encoders are used to encode data for efficient transmission over wireless channels,
reducing errors and ensuring proper signal reconstruction.
• Memory Address Decoding:
• Encoders simplify the process of selecting memory addresses in large-scale memory
systems, enabling efficient read/write operations in real-time computing.
136
3. Decoders:
• A decoder performs the reverse function of an encoder,
converting coded signals back into their original form or
selecting among many possible lines. Applications include:
• Real-Time Display Systems:
• Decoders are used in display systems to convert encoded video or graphical
data into a format that can be rendered on screens, enabling real-time video
playback.
• Microcontroller Systems:
• Decoders are often used in microcontroller-based applications for enabling
specific peripheral devices, such as selecting an I/O port for communication.
137
REAL TIME APPLICATIONS IN DAY TO DAY
LIFE AND TO INDUSTRY
• Other Examples:
Applications:
• A code converter is a logic circuit that changes data presented in one type of
binary code to another code of binary code. The following are some of the most
commonly used code converters:
141
K-map simplification
LOGIC DIAGRAM
142
Gray to Binary Converters
The truth table for the gray-to-binary code converter is shown below,
143
K-map
144
Now, the expressions can be implemented using EX-OR gates
Excess-3 is a modified form of a BCD number. The excess-3 code can be derived
from the natural BCD code by adding 3 to each coded number. For example, decimal
12 can be represented in BCD as 0001 0010. Now adding 3 to each digit we get
excess-3 code as 0100 0101 (12 in decimal). With this information the truth table for
BCD to Excess-3 code converter can be determined as,
145
BCD to Excess-3 Converters
K-map
146
Excess-3 to BCD Converter
Truth table:
• From the truth table, the logic expression for the Excess-3 code outputs can be
written as,
• B3= ∑m (11, 12) + ∑d (0, 1, 2, 13, 14, 15)
• B2= ∑m (7, 8, 9, 10) + ∑d (0, 1, 2, 13, 14, 15)
• B1= ∑m (5, 6, 9, 10) + ∑d (0, 1, 2, 13, 14, 15)
• B0= ∑m (4, 6, 8, 10, 12) + ∑d (0, 1, 2, 13, 14, 15)
147
K-map
148
• The steps involved in the BCD-to-binary conversion process are as follows:
• The value of each bit in the BCD number is represented by a binary equivalent or
weight.
• All the binary weights of the bits that are 1‘s in the BCD are added.
• the result of this addition is the binary equivalent of the BCD number
• Two-digit decimal values ranging from 00 to 99 can be represented in BCD by two
4-bit code groups. For example, 1910 is represented as,
149
BCD to Binary Converters (K-map)
150
151
Binary to BCD Converter
The truth table for binary to BCD converter can be written as,
From the truth table, the logic expression for the BCD code outputs can be written
as,
• B0= ∑m (1, 3, 5, 7, 9, 11, 13, 15)
• B1= ∑m (2, 3, 6, 7, 12, 13)
• B2= ∑m (4, 5, 6, 7, 14, 15)
• B3= ∑m (8, 9)
• B4= ∑m (10, 11, 12, 13, 14, 15)
152
K-map Simplification
153
Binary to BCD Converter
From the above K-map, the logical expression can be obtained as, B0= A
• B1= DCB’+ D’B
• B2= D’C+ CB
• B3= DC’B’
• B4= DC+ DB
Now, from the above expressions the logic diagram can be implemented as,
154
Gray to BCD Converter
The truth table for gray to BCD converter can be written as,
K-map simplification
155
K-map simplification
From the above K-map, the logical expression can be obtained as,
B0= (G0ÅG1) Å (G2ÅG3)
B1= G’2G1+ G’3G2G’1
B2= G’3G2+ G3G’2G’1
B3= G3G2G’1
B4= G3G’2+ G3G1
156
Gray to BCD Converter
Logic diagram
157
BCD to Gray Converter
The truth table and k-map for gray to BCD converter can be written as,
K-Map simplification
158
Logic diagram
159
16.Assessment Schedule (Proposed Date & Actual Date)
TEXT BOOK:
1. M. Morris Mano and Michael D. Ciletti, Digital Design, With an Introduction to the
Verilog HDL, VHDL, and System Verilog, 6th Edition, Pearson, 2018.
2. S.Salivahanan and S.Arivazhagan,Digital Circuits and Design, 5th Edition, Oxford
University Press, 2018.
REFERENCES:
1. A.Anandkumar, Fundamental of digital circuits, 4th Edition, PHI Publication,2016.
2. William Kleitz, Digital Electronics-A Practical approach to VHDL, Prentice Hall
International Inc, 2012.
3. Charles H.Roth, Jr. andLarry L. Kinney, Fundamentals of Logic Design, 7th Edition,
Thomson Learning, 2014.
4.Thomas L. Floyd, Digital Fundamentals, 11th Edition, Pearson Education Inc, 2017.
5. John.M Yarbrough, Digital Logic: Applications and Design, 1st Edition, Cengage
India, 2006.
building a fancy Car/Bike Turning Indicator Circuit using 555 Timer IC, with four LEDs
glowing one by one in a particular pattern and we can control the speed or frequency
of this LED indicator by simply turning a Potentiometer.
MINI-PROJECTS SUGGESTIONS
Digital Timer
Design a digital timer using counters and logic gates. The timer should have
adjustable preset values and count down to zero, triggering an alert when the
time elapses.
Digital Thermometer
Simulate a digital thermometer using logic gates. Create a system that reads
temperature values from sensors, converts them to binary representation, and
displays the temperature on a 7-segment display.
1. Multiplexer-Based Projects:
3. Decoder-Based Projects:
4. Demultiplexer-Based Projects:
Disclaimer:
This document is confidential and intended solely for the educational purpose of RMK Group of
Educational Institutions. If you have received this document through email in error, please notify the
system manager. This document contains proprietary information and is intended only to the
respective group / learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender immediately by e-mail if you
have received this document by mistake and delete this document from your system. If you are not
the intended recipient you are notified that disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.