Dte Notes
Dte Notes
Dte Notes
1-1
Chapter 1
NUMBER SYSTEM AND CODES
6 Hours
8 Marks
1V
LOW
0V
Figure 1.3: Positive Logic
If logic state ‘0’ is represented by a higher voltage level (or current level)
and logic state ‘1’ is represented by a lower voltage level (or current level), it is
called as negative logic system. E.g. If 0V and +5V are the two voltage levels
and +5V is used for representing ‘0’ and 0V is used for representing ‘1’, this is a
negative logic system.
5V
LOW
3.5 V
1V
HIGH
0V
Figure 1.4: Negative Logic
Logic Families
1-4
Characteristics of logic families (or
Characteristics of digital ICs)
Speed of operation
It is desirable that a digital IC should have high speed of operation. Speed
of operation of a circuit is specified in terms of propagation delay time (i.e. lesser
the propagation delay time → higher the speed of operation).
There are two delay times.
𝑡𝑝𝐻𝐿→ Delay time when output goes from HIGH state to LOW state
𝑡𝑝𝐿𝐻→ Delay time when output goes from LOW state to HIGH state
Propagation delay time is computed as the average of these two delay
times as,
𝑡𝑝𝐻𝐿 + 𝑡𝑝𝐿𝐻
𝑡𝑝 =
2
1-5
The two delay times are computed by finding the time difference 50%
voltage levels of input and output waveforms as shown in figure 1.5.
tpLH tpHL
Power Dissipation
For operation of every electronic circuit, certain amount of electric power is
required. Out of supplied power, some power gets dissipated in electronic
circuits. This is due to wastage of power across electronic components. i.e.
Power dissipation is nothing but wastage of power across electronic
components or devices within a circuit. Power dissipation of a circuit is
expressed in terms of milliwatt (mW).
If power dissipation for a circuit is less, the circuit requires less power to
be supplied to it. So, power dissipation should be as less as possible
Figure of Merit
It is always desirable for an electronic circuit to have less power
dissipation (for reducing power requirements). But when power dissipation is
reduced in an electronic circuit, its speed of operation also gets reduced (In other
words, propagation delay gets increased).
As per above discussion, there is a trade-off between power dissipation
and speed of operation (which is denoted in terms of propagation delay). So,
instead of the two parameters speed of operation and power dissipation, a single
parameter called figure of merit is used for comparison of logic families. Figure
of merit is a product of propagation delay and power dissipation.
𝐹𝑖𝑔𝑢𝑟𝑒𝑜𝑓𝑚𝑒𝑟𝑖𝑡 = 𝑝𝑟𝑜𝑝𝑎𝑔𝑎𝑡𝑖𝑜𝑛𝑑𝑒𝑙𝑎𝑦 × 𝑝𝑜𝑤𝑒𝑟𝑑𝑖𝑠𝑠𝑖𝑝𝑎𝑡𝑖𝑜𝑛
Figure of merit is measured in terms of Pico-Joules (𝑛𝑠 × 𝑚𝑊 = 𝑝𝐽)
Fan–out
Generally, output of one logic gate feeds input to several other gates.
Practically, it is not possible to drive unlimited number of logic gates from
output of a single logic gate.
Fan–out is the maximum number of similar gates that can be driven by a
logic gate. As shown in figure 1.6, if the driver gate is capable of driving at the
most N gates, fan–out of the driver gate is N.
If we try to drive more than N gates, current supply required to drive the
gates may become lesser than the minimum requirement (in case of HIGH
state) or current sink by the driver gate may become greater than its sink
capacity (in case of LOW state).
1-7
Fan–in
Noise Immunity
Unwanted signal is called as noise. Stray electric or magnetic fields may
induce noise in the input to the digital circuits. Due to noise, input voltage may
drop below VIH or may rise above VIL. Both the circumstances will result in
undesired operations of the digital circuit.
Every circuit should have ability to tolerate the noise signal. This ability
of tolerating noise signal is called as noise immunity. Measure of noise
immunity is called as noise margin. The noise margin at logic ‘1’ state and
logic ‘0’ state are computed as,
Logic ‘1’ state noise margin: ∆1 = 𝑉𝑂𝐻 − 𝑉𝐼𝐻
Logic ‘0’ state noise margin: ∆0 = 𝑉𝑂𝐿 − 𝑉𝐼𝐿
Operating Temperature
Operating temperature is range of temperature in which an IC functions
properly. An IC is selected for a specific application depending on its operating
temperature. Generally the range of operating temperature is within −550𝐶 to
+1250𝐶.
1-8
Logic Families
Bi-MOS Logic
Bipolar Families MOS Families
Family
Resistor
Diode Logic (DL) Transistor Logic PMOS Family NMOS Family
(RTL)
Transistor
Diode Transistor
Transistor CMOS Family
Logic (DTL)
Logic (TTL)
Emitter Integrated
Coupled Logic Injection Logic
(ECL) (I2L)
1-10
propagation delay
= 22ns (max.) for LOW-to-HIGH transition at the output
= 15ns (max.) for HIGH- to-LOW output transition
worst-case noise margin=0.4V
fan-out=10
operating temperature range
=0°C to 70°C (74- series)
=−55°C to +125°C (54-series)
speed–power product=100pJ
1-11
VIL (buffered devices) =1.5V (for VDD =5V)
=3.0V (for VDD = 10V)
=4.0V (for VDD = 15V)
VIL (unbuffered devices) =1.0V (for VDD =5V)
=2.0V (for VDD = 10V)
=2.5V (for VDD =15V)
VOH =4.95V (for VDD =5V)
=9.95V (for VDD =10V)
=14.95V (for VDD =15V)
VOL=0.05V
VDD =3– 15V
propagation delay (buffered devices) =150ns (for VDD =5V)
=65ns (for VDD =10V)
=50ns (for VDD =15V)
propagation delay (unbuffered devices)=60ns (for VDD =5V)
=30ns (for VDD =10V)
=25ns (for VDD =15V)
noise margin (buffered devices) =1.0V (for VDD =5V)
=2.0V (for VDD =10V)
=2.5V (for VDD = 15V)
noise margin (unbuffered devices) =0.5V (for VDD =5V)
=1.0V(for VDD =10V)
=1.5V(for VDD =15V)
Output transition time (for VDD =5Vand CL=50pF)
=100ns (buffered devices)
=50–100ns (for unbuffered devices)
power dissipation per gate (for f =100kHz)=0.1mW
speed–power product (for f =100kHz)=5pJ
Number System
Number system is one of the most important and basic topic in digital
electronics. It is important to understand a number system as it helps in
understanding how data is represented before processing it in digital system.
Important characteristics of number systems are:
- Independent digits used (radix or base).
- Place value of different digits.
- Maximum numbers that can be represented using given number of
digits.
N → A number
b → Base or radix of the number system
n → Number of digits in Integer part
m → Number of digits in Fractional part
𝑑𝑛−1 → Most Significant Digit (MSD)
𝑑−𝑚 → Least Significant Digit (LSD)
Each digit (i.e. 𝑑𝑖 and 𝑑−𝑓) must be within the range from 0 to b–1
including the boundaries.
Example 1:
(6251)8 = 6 × 83 + 2 × 82 + 5 × 81 + 1 × 80
=6 × 512 + 2 × 64 + 5 × 8 + 1 × 1
=3072 + 128 + 40 + 1
=(3241)10
1-16
Example 2:
(37.40)8 = 3 × 81 + 7 × 80 + 4 × 8−1 + 0 × 8−2
=3 × 8 + 7 × 1 + 4 × 0.125 + 0 × 0.0625
=24 + 7 + 0.5 + 0
=(31.5)10
1-17
Converting the integer part (293)10:
Divisor Dividend Remainder
2 293 --
2 146 1
2 73 0
2 36 1
2 18 0
2 9 0
2 4 1
2 2 0
2 1 0
-- 0 1
(293)10 = (100100101)2
Converting the fractional part (0.52)10:
Fraction Multiplier Result Carry
.52 2 .04 1
.04 2 .08 0
.08 2 .16 0
.16 2 .32 0
.32 2 .64 0
.64 2 .28 1
.28 2 .56 0
.56 2 .12 1
. .
. .
. .
(0.52)10 = (. 10000101)2
Therefore,
(293.52)10 = (100100101.10000101)2
Example 2:
(63.25)10 = (? )2
As a first step, the number should be separated in integer part and
fractional parts as,
(63.25)10 = (63)10 + (0.25)10
Converting the integer part (63)10:
Divisor Dividend Remainder
2 63 --
2 31 1
2 15 1
2 7 1
2 3 1
2 1 1
-- 0 1
1-18
(63)10 = (111111)2
Converting the fractional part (0.25)10:
Fraction Multiplier Result Carry
.25 2 .5 0
.5 2 .0 1
(0.25)10 = (. 01)2
Therefore,
(63.25)10 = (111111.01)2
(293)10 = (445)2
1-19
Converting the fractional part (0.52)10:
Fraction Multiplier Result Carry
.52 8 .16 4
.16 8 .28 1
.28 8 .24 2
.24 8 .92 1
.92 8 .36 7
.36 8 .88 2
.88 8 .04 7
.04 8 .32 0
. .
. .
(0.52)10 = (. 41217270)2
Therefore,
(293.52)10 = (445.41217270)2
Example 2:
(63.25)10 = (? )8
As a first step, the number should be separated in integer part and
fractional parts as,
(63.25)10 = (63)10 + (0.25)10
Converting the integer part (63)10:
Divisor Dividend Remainder
8 63 --
8 7 7
-- 0 7
(63)10 = (77)8
Converting the fractional part (0.25)10:
Fraction Multiplier Result Carry
.25 8 .0 2
(0.25)10 = (. 2)8
Therefore,
(63.25)10 = (77.2)8
(293)10 = (125)16
Converting the fractional part (0.52)10:
Fraction Multiplier Result Carry
.52 16 .32 8
.32 16 .12 5
.12 16 .92 1
.92 16 .72 14(E)
.72 16 .52 11(B)
.52 16 .32 8
.32 16 .12 5
Results will be repeated
(0.52)10 = (. 851𝐸𝐵)16
Therefore,
(293.52)10 = (125.851𝐸𝐵)16
Example 2:
(63.25)10 = (? )16
As a first step, the number should be separated in integer part and
fractional parts as,
(63.25)10 = (63)10 + (0.25)10
Converting the integer part (63)10:
Divisor Dividend Remainder
16 63 --
16 3 15(F)
-- 0 3
(63)10 = (3𝐹)16
1-21
Converting the fractional part (0.25)10:
Fraction Multiplier Result Carry
.25 16 .0 4
(0.25)10 = (. 4)16
Therefore,
(63.25)10 = (3𝐹. 4)16
1-22
For converting a binary number into octal number both the integer part
and the fractional part of the binary number are split into groups of three bits
starting from radix point (in binary number system it may be called as binary
point). If the outermost groups are not complete (i.e. of three bits), then
sufficient number of 0’s are added to make them complete (on left side of
leftmost group and on right side of rightmost group). Then each group is
replaced by its octal equivalent as shown in table 1.2.
Example 1:
(1010101.0101)2 = (? )8
The binary number is split into groups of three bits from binary point.
1 010 101 . 010 1
Here the first group and the
last group are incomplete. For completing them 0’s are added on left side of first
group and on right side of last group.
001 010 101 . 010 100
Then octal equivalent of each
group of bits is written.
001 010 101 . 010 100
1 2 5 . 2 4
Therefore, (1010101.0101)2 =
(125.24)8
Example 2:
(11010.01)2 = (? )8
The binary number is split into groups of three bits from binary point.
11 010 . 01
Here the first group and the last group
are incomplete. For completing them 0’s are added on left side of first group and
on right side of last group.
011 010 . 010
Then octal equivalent of each group
of bits is written.
011 010 . 010
3 2 . 2
Therefore,
(11010.01)2 = (32.2)8
1-20
Hexadecimal to Binary and Binary to Hexadecimal conversion
While converting hexadecimal number into its binary equivalent, each
hexadecimal digit is replaced by its four-bit binary equivalent. The binary
equivalents of all independent hexadecimal digits are shown in table 1.3.
(273. 𝐴2)16 =
(001001110011.1010
0010)2
Example 2:
(𝐸𝐵. 25)16 = (? )2
1-20
Each hexadecimal digit is replaced by its four-bit binary equivalent.
E B . 2 5
Therefore, 1110 1011 . 0010 0101
(𝐸𝐵. 25)16 =
(11101011.00100101)2
1-21
integer part and the fractional part of the binary number are split into groups of
four bits starting from radix point (in binary number system it may be called as
binary point). If the outermost groups are not complete (i.e. of four bits), then
sufficient number of 0’s are added to make them complete (on left side of leftmost
group and on right side of rightmost group). Then each group is replaced by its
octal equivalent as shown in table 1.3.
Example 1:
(100101101.01011)2 = (? )16
The binary number is split into groups of four bits from binary point.
1 0010 1101 . 0101 1
Here the first group and the
last group are incomplete. For completing them 0’s are added on left side of first
group and on right side of last group.
0001 0010 1101 . 0101 1000
Then hexadecimal
equivalent of each group of bits is written.
0001 0010 1101 . 0101 1000
1 2 D . 5 8
Therefore,
(100101101.01011)2 = (12𝐷. 58)16
Example 2:
(11010.01)2 = (? )16
The binary number is split into groups of four bits from binary point.
1 1010 . 01
Here the first group and the last group
are incomplete. For completing them 0’s are added on left side of first group and
on right side of last group.
0001 1010 . 0100
Then octal equivalent of each group
of bits is written.
0001 1010 . 0100
1 A . 4
Therefore, (11010.01)2 = (1𝐴. 4)16
1-23
2 3 7 . 4 1
010 011 111 . 100 001
(237.41)8 = (010011111.100001)2
Then the binary number is converted into its hexadecimal equivalent
0 1001 1111 . 1000 01
0000 1001 1111 . 1000 0100
0 9 F . 8 4
Example 2:
(+53)10 = (00110101)𝑠𝑖𝑔𝑛−𝑏𝑖𝑡𝑚𝑎𝑔𝑛𝑖𝑡𝑢𝑑𝑒
Example 3:
(+33)10 = (00010001)𝑠𝑖𝑔𝑛−𝑏𝑖𝑡𝑚𝑎𝑔𝑛𝑖𝑡𝑢𝑑𝑒
Using 1’s complement binary representation, when eight bits are used;
numbers in the range –127 to +127 can be represented. In an n-bit
representation, range of numbers those can be represented using 1’s
complement representation are −(2𝑛−1 − 1) to +(2𝑛−1 − 1).
Example 1:
(+53)10 = (00110101)2′𝑠𝑐𝑜𝑚𝑝𝑙𝑒𝑚𝑒𝑛𝑡
Example 2:
(+33)10 = (00010001)2′𝑠𝑐𝑜𝑚𝑝𝑙𝑒𝑚𝑒𝑛𝑡
Example 3:
(−53)10 = (? )2′𝑠𝑐𝑜𝑚𝑝𝑙𝑒𝑚𝑒𝑛𝑡
1-25
Then, for finding its 2’s complement, first its 1’s complement is found as
00110101
11001010
Then by adding 1 in the result we get 2’s complement as,
11001010
+ 1
--------------------
11001011
Therefore,
(−53)10 = (11001011)2′𝑠𝑐𝑜𝑚𝑝𝑙𝑒𝑚𝑒𝑛𝑡
Example 4:
(−33)10 = (? )2′𝑠𝑐𝑜𝑚𝑝𝑙𝑒𝑚𝑒𝑛𝑡
Using 2’s complement binary representation, when eight bits are used;
numbers in the range –128 to +127 can be represented. In an n-bit
representation, range of numbers those can be represented using 1’s
complement representation are −(2𝑛−1) to +(2𝑛−1 − 1).
This is the most popular method of representing signed numbers. It is
become popular due to two reasons.
1. It is easy to generate 2’s complement of a binary number.
2. Arithmetic operations in 2’s complement method are easy.
1-26
11001.0110 = 0.110010110 × 2+5 = 0.110010110𝑒 + 0101
0.000110110 = 0.110110 × 2−3 = 0.110110𝑒 − 0011
The most commonly used format for representing floating point numbers
is IEEE-754 standard. This standard defines two basic formats as single
precision and double precision.
In single precision format, 8 bits are used for representing exponent and
24 bits are used for representing. Within 8 bits of exponent one bit is used for
representing sign of exponent and remaining 7 bits are used for representing
magnitude of exponent. So value of exponent can range from –127 to +127. (from
2−127to 2+127. i.e. from 10−38to 10+38). From 24 bits reserved for mantissa, one
bit is used as sign bit and remaining 23 bits are used for representing
magnitude of mantissa.
In double precision format, 11 bits are used for representing exponent and
53 bits are used for representing. Within 11 bits of exponent one bit is used for
representing sign of exponent and remaining 10 bits are used for representing
magnitude of exponent. So value of exponent can range from –1024 to +1024.
(from 2−1024to 2+1024. i.e. from 10−308to 10+308). From 53 bits reserved for
mantissa, one bit is used as sign bit and remaining 52 bits are used for
representing magnitude of mantissa.
Binary Arithmetic
Up to this point, we have studied various methods of data representation.
Now, it is important to study data manipulation. We can perform two types of
operations on binary data – arithmetic operations and logic operations.
Arithmetic operations include addition, subtraction, multiplication and division.
These operations are discussed here. Various logic operation like AND, OR,
NOT are discussed in chapter 2.
Binary Addition
Basic rules for performing binary addition are given below in table 1.4.
Table 1.4: Rules for binary addition
A B A+B
0 0 0
0 1 1
1 0 1
1 1 0 with carry 1
Some examples of performing binary addition are given below.
1-27
Example 1:
(1001110)2 + (11110)2 = (? )2
1 0 0 1 1 1 0
+ 1 1 1 1 0
C 1 1 1 1
1 1 0 1 1 0 0
Binary Subtraction
Basic rules for performing binary subtraction are given below in table 1.5.
Table 1.5: Rules for binary subtraction
A B A–B
0 0 0
0 1 1 with borrow 1
1 0 1
1 1 0
Some examples of performing binary subtraction are given below.
Example 1:
(1001110)2 − (11110)2 = (? )2
1 0 0 1 1 1 0
– 1 1 1 1 0
B 1 1
0 1 1 1 1 0 0
Example 2:
(11110000)2 − (11000111)2 = (? )2
1 1 1 1 0 0 0 0
– 1 1 0 0 0 1 1 1
B 1 1 1 1
0 0 1 0 1 0 0 1
1-28
Binary Multiplication
Basic rules for performing binary multiplication are given in table 1.6.
Table 1.6: Rules for binary multiplication
A B AXB
0 0 0
0 1 0
1 0 0
1 1 1
Some examples of performing binary multiplication are given below.
Example 1:
(1001110)2 × (110)2 = (? )2
1 0 0 1 1 1 0
X 1 1 0
0 0 0 0 0 0 0
+ 1 0 0 1 1 1 0 X
+ 1 0 0 1 1 1 0 X X
1 1 1
1 1 1 0 1 0 1 0 0
1-29
Binary Division
Binary division is performed similar to decimal division. Some examples
of performing binary division are given below.
Example 1:
(11110000)2 ÷ (1010)2 = (? )2
Q 0 0 0 1 1 0 0 0
1 0 1 0 1 1 1 1 0 0 0 0
- 1 0 1 0
0 1 0 1 0
- 1 0 1 0
R 0 0 0 0 0 0 0
1-30
Example 2
(1001111)2 ÷ (110)2 = (? )2
Q 0 0 0 1 1 0 1
1 1 0 1 0 0 1 1 1 1
- 1 1 0
1 1
0 0 1 1 1
- 1 1 0
0 0 1 1 1
- 1 1 0
R 0 0 1
1-31
Some examples are shown below.
Example 1:
(83)10 + (39)10 = (? )10
Step 1: 1’s complement representation of numbers
(83)10 = 01010011
(39)10 = 00100111
1-32
The above subtraction can be represented in terms of addition as,
(83)10 + (−39)10 = (? )10
Step 1: 1’s complement representation of numbers
(83)10 = 01010011
(−39)10 =?
(39)10 = 00100111
00100111
11011000
(−39)10 = 11011000
Step 2: Simple Binary addition
0 1 0 1 0 0 1 1
+ 1 1 0 1 1 0 0 0
1 1 1
1 0 0 1 0 1 0 1 1
Step 3: Carry generated out of MSB is added to LSB of result.
0 0 1 0 1 0 1 1
+ 1
1 1
0 0 1 0 1 1 0 0
Step 4: As MSB is 0, result is positive and it is,
00101100 = (+44)10
∴ (83)10 − (39)10 = (+44)10
1-33
Two’s complement Arithmetic
Arithmetic operations discussed in 1.3.7 deals with unsigned binary
numbers only. For signed numbers, the arithmetic operations depend on the
way how they are represented. When signed numbers are represented using
two’s complement representation, we have to perform addition or subtraction by
using the steps discussed below.
As these rules deal with signed numbers, we can represent any
subtraction operation in terms of addition as shown in following examples.
𝐴 − 𝐵 = 𝐴 + (−𝐵)
−𝐴 − 𝐵 = (−𝐴) + (−𝐵)
−𝐴 − (−𝐵) = (−𝐴) + 𝐵
Following are the steps for performing 2’s complement addition
(subtraction also – First subtraction should be represented as addition).
1. Represent both the numbers using 2’s complement representation.
2. Perform simple binary addition.
3. If any carry is generated out of MSBs, ignore it.
4. If MSB is 0, result is positive. Find equivalent of result.
5. If MSB is 1, result is negative. Find 2’s complement of result and then its
equivalent.
1-34
Example 3:
(83)10 − (39)10 = (? )10
Above subtraction can be represented in terms of addition as,
(83)10 + (−39)10 = (? )10
Step 1: 2’s complement representation of numbers
(83)10 = 01010011
(−39)10 =?
(39)10 = 00100111
00100111
11011000
11011000
+ 1
--------------------
11011001
(−39)10 = 11011001
Step 2: Simple Binary addition
0 1 0 1 0 0 1 1
+ 1 1 0 1 1 0 0 1
1 1 1 1 1
1 0 0 1 0 1 1 0 0
Step 3: Carry generated out of MSB is ignored.
Step 4: As MSB is 0, result is positive and it is,
00101100 = (+44)10
∴ (83)10 − (39)10 = (+44)10
1-35
Binary Coded Decimal (BCD) Code
Each decimal digit is represented by a four-bit code. The BCD codes of all
the decimal digits 0 through 9 are shown below.
Table 1.7: BCD Codes
Decimal Digit BCD Code
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
Some examples of BCD code representation are shown below. Also their
binary equivalents are shown.
Example Decimal Number BCD Code Binary equivalent
1 14 00010100 1110
2 83 10000011 01010011
3 122 000100100010 01111010
4 39 00111001 00100111
5 293.52 001010010011.01010010 100100101.10000101
6 13.25 00010011.00100101 1101.01
From above examples, it can be easily observed that more number of bits
is required for representing a number using BCD code as compared to simple
binary equivalent. This is disadvantage of BCD code. BCD arithmetic is also
somewhat critical. But even then, BCD code is convenient and useful code for
input and output operations.
Decimal to BCD conversion and BCD to Decimal conversion are very easy
as only the table 1.7 is used for doing the conversion.
BCD is also known as 8-4-2-1 code as the bits in the code have weights as
8, 4, 2 and 1.
1-36
Table 1.8: Other BCD Codes
Decimal Digit 4221 BCD 5421 BCD
Code Code
0 0 0 0 0 0 0 0 0
1 0 0 0 1 0 0 0 1
2 0 0 1 0 0 0 1 0
3 0 0 1 1 0 0 1 1
4 1 0 0 0 0 1 0 0
5 0 1 1 1 1 0 0 0
6 1 1 0 0 1 0 0 1
7 1 1 0 1 1 0 1 0
8 1 1 1 0 1 0 1 1
9 1 1 1 1 1 1 0 0
BCD Arithmetic
Method of performing BCD arithmetic is different from binary arithmetic.
There are different rules for doing so.
BCD Addition
There are various methods for performing BCD addition. One of them is
discussed below.
Rules for performing BCD addition are,
1. Represent both the decimal numbers in their BCD codes.
2. Perform simple binary addition.
3. If any digit (4 bits) in the result contains invalid BCD code or a carry
is generated out of a digit (4 bits), add 0110 to each such digit (4 bits).
1-37
Example 1:
(83)10 + (39)10 = (? )10
Step 1: BCD code representation of numbers
(83)10 = 10000011
(39)10 = 00111001
Step 2: Simple Binary addition
1 0 0 0 0 0 1 1
+ 0 0 1 1 1 0 0 1
1 1
1 0 1 1 1 1 0 0
Step 3: As both digits of result contain invalid BCD codes,
1 0 1 1 1 1 0 0
+ 0 1 1 0 0 1 1 0
1 1 1 1 1 1
1 0 0 1 0 0 0 1 0
(000100100010)𝐵𝐶𝐷 = (122)10
∴ (83)10 + (39)10 = (122)10
Example 2:
(29)10 + (58)10 = (? )10
1-38
Step 1: BCD code representation of numbers
(29)10 = 00101001
(58)10 = 01011000
Step 2: Simple Binary addition
0 0 1 0 1 0 0 1
+ 0 1 0 1 1 0 0 0
1 1 1 1
1 0 0 0 0 0 0 1
Step 3: As carry is generated from least significant digit to next
digit 0110 is added to lest significant digit,
1 0 0 0 0 0 0 1
+ 0 1 1 0
1 0 0 0 0 1 1 1
(10000111)𝐵𝐶𝐷 = (87)10
∴ (29)10 + (58)10 = (87)10
Example 3:
(637)10 + (463)10 = (? )10
Step 1: BCD code representation of numbers
(637)10 = 011000110111
(463)10 = 010001100011
Step 2: Simple Binary addition
0 1 1 0 0 0 1 1 0 1 1 1
+ 0 1 0 0 0 1 1 0 0 0 1 1
1 1 1 1 1 1
1 0 1 0 1 0 0 1 1 0 1 0
Step 3: As least significant digit and most significant digit are
invalid, 0110 is added to both these digits.
1 0 1 0 1 0 0 1 1 0 1 0
+ 0 1 1 0 0 1 1 0
1 1 1 1 1 1 1
1 0 0 0 0 1 0 1 0 0 0 0 0
As result contains invalid digit, 0110 is added to that digit.
1 0 0 0 0 1 0 1 0 0 0 0 0
+ 0 1 1 0
1 1 1
1 0 0 0 1 0 0 0 0 0 0 0 0
1-39
Example 4: (0001000100000000)𝐵𝐶𝐷 = (1100)10
1001 + 1101 =?
Step 1: The above numbers are represented in binary
representation. First number is binary equivalent of (9)10 and second number
is binary equivalent of (13)10. BCD code representation of these numbers is,
(9)10 = 1001
(13)10 = 00010011
Step 2: Simple Binary addition
1 0 0 1
+ 0 0 0 1 0 0 1 1
1 1
0 0 0 1 1 1 0 0
Step 3: As least significant digit is invalid, 0110 is added to that
digit.
0 0 0 1 1 1 0 0
+ 0 1 1 0
1 1 1
0 0 1 0 0 0 1 0
(00100010)𝐵𝐶𝐷 = (22)10
∴ (1001)2 + (1101)2 = (22)10 = (10110)2
BCD Subtraction
There are various methods for performing BCD subtraction. One of
them is discussed below.
Rules for performing BCD subtraction are (By considering subtraction
as A – B ),
1. Represent A in BCD code.
2. Represent 9’s complement of B in BCD code.
3. Perform BCD addition.
4. If carry is generated out of MSB, result is positive. To get correct
result, carry is added to result.
5. If carry is not generated, result is negative and it is in 9’s
complement form.
1-40
BCD code is
72 = 01110010
Step 3: BCD addition
0 1 0 0 0 1 0 1
+ 0 1 1 1 0 0 1 0
1 0 1 1 0 1 1 1
As most significant digit of result contain invalid BCD code,
1 0 1 1 0 1 1 1
+ 0 1 1 0
1 1
1 0 0 0 1 0 1 1 1
Step 4: As carry is generated out of MSB, it is added to
result. (Result is positive)
0 0 0 1 0 1 1 1
+ 1
1 1 1
0 0 0 1 1 0 0 0
(00011000)𝐵𝐶𝐷 = (+18)10
BCD code is
16 = 00010110
Step 3: BCD addition
0 1 0 0 0 1 0 1
+ 0 0 0 1 0 1 1 0
1
0 1 0 1 1 0 1 1
As least significant digit of result contain invalid BCD code,
0 1 0 1 1 0 1 1
+ 0 1 1 0
1 1 1 1
0 1 1 0 0 0 0 1
Step 5: As carry is not generated out of MSB, result is negative
and it is in 9’s complement form
(01100001)𝐵𝐶𝐷 = (61)10
1-2
But as result is in 9’s complement form, true result is
∴ (45)10 − (83)10 = (−38)10
1-3
Chapter 2
Logic GATEs AND LOGIC FAMILIES
10 Hours
12 Marks
Logic Gates
Figure 2.1 shows a sample 2–input logic system and table 2.2 shows a
sample truth table for a 2–input logic system.
A Logic
System Y
B
1-4
Basic Gates
Logic gate is the most basic building block of any digital system (even for
computers). Each basic logic gate is a piece of hardware or an electronic circuit
that can be used to implement some basic logic expression. For implementing
various laws of Boolean algebra, basic gates can be used. Basic gates perform
basic logical operations on the logical inputs.
There are three basic logic gates, namely the OR gate, the AND gate and
the NOT gate.
OR gate
The OR gate performs logical OR operation on two or more inputs
(generally referred as logic variables). The OR gate has two or more inputs and
a single output. Output of an OR gate is LOW if all the inputs are LOW. In all
other cases, output of OR gate is HIGH.
The OR operation on two independent logical variables A and B can be
represented by following logic expression (sometimes also called logical
equation).
𝑌 =𝐴+𝐵
It is read as Y is equal to A OR B. The logic expression shown above is
logic expression for 2–input OR gate. Logical symbol for 2 – input OR gate is
shown in figure 2.2.
A
Y=A+B
B
A
B Y=A+B+C
C
AND gate
The AND gate performs logical AND operation on two or more inputs
(generally referred as logic variables). The AND gate has two or more inputs
and a single output. Output of an AND gate is HIGH if all the inputs are HIGH.
In all other cases, output of AND gate is LOW.
The AND operation on two independent logical variables A and B can be
represented by following logic expression (sometimes also called logical
equation).
𝑌 = 𝐴. 𝐵
It is read as Y is equal to A AND B. The logic expression shown above is
logic expression for 2–input AND gate. Logical symbol for 2 – input AND gate is
shown in figure 2.5.
1-6
A
Y=A.B
B
The logic expression or logical equation for 3 – input AND gate is shown
below.
𝑌 = 𝐴. 𝐵. 𝐶
Logical symbol for 3 – input AND gate is shown in figure 2.7.
A
B Y=A.B.C
C
1-7
Table 2.5: Truth table for 3 – input AND gate
i/p o/p
A B C Y
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
The TTL IC used for 3 – input AND gate is 7411. It is a triple 3 – input
AND gate. i.e. There are three 3 – input AND gates in the IC.
NOT gate
The NOT gate performs logical NOT (i.e. negation) operation on an input
(generally referred as logic variable). The NOT gate has a single input and a
single output. Output of an AND gate is complement of its input. If input is
LOW, output is HIGH and if input is HIGH, output is LOW.
The NOT operation on a logical variable X can be represented by
following logic expression (sometimes also called logical equation).
𝑌 = 𝑋̅
or
𝑌 = 𝑋̅′
It is read as Y is equal to NOT X. Logical symbol for NOT gate is shown in
figure 2.8.
X 𝑌 = 𝑋̅
1-8
Figure 2.9: IC pin configuration of 7404
Universal Gates
In addition to basic gates, other logic gates like NAND and NOR gates are
also used in designing digital circuits. The NAND gate and NOR gate are called
universal gates because using any one type of those gates any logic expression
can be realized. Implementation of any logic expression is economical if it is
done using any one type of universal gates (as compared to implementation
using basic gates). The basic reason behind this is the easier fabrication of these
gates.
NAND gate
NAND stands for NOT AND. The name suggests that it is a combination
of AND gate followed by a NOT gate as shown in figure 2.10.
A
Y
B
A
𝑌=𝐴
.𝐵
B
A
B 𝑌= ̅̅̅̅̅̅̅̅
𝐴. 𝐵 . 𝐶
C
NOR gate
NOR stands for NOT OR. The name suggests that it is a combination of
OR gate followed by a NOT gate as shown in figure 2.14.
A
Y
B
A
𝑌 = 𝐴 +𝐵
B
The TTL IC used for 2 – input NOR gate is 7402. It is a quad 2 – input NOR
gate. i.e. There are four 2 – input NOR gates in the IC. Pin configuration for IC
7402 is shown in figure 2.16.
1-11
Figure 2.16: IC pin configuration for 7402
The logic expression or logical equation for 3 – input NOR gate is shown
below.
𝑌 = (𝐴+𝐵+
𝐶)
Logical symbol for 3 – input NOR gate is shown in figure 2.17.
A
B 𝑌 = (𝐴+𝐵+
𝐶)
C
Derived Gates
The gates those are derived from basic gates are called as derived gates.
Sometimes NAND gate and NOR gate are also referred as derived gates (as they
are derived from basic gates). Two more derived gates are Ex-OR gate and Ex-
NOR gate.
1-12
of Ex-OR gate is HIGH if odd number of inputs is HIGH. If even number of
inputs is HIGH, output is LOW.
The logic expression (sometimes also called logical equation) of 2 – input
Ex-OR gate is shown below.
𝑌 = 𝐴 ⊕ 𝐵 = 𝐴𝐵 + 𝐴𝐵
It is read as Y is equal to A Ex-OR B. Logical symbol for 2 – input Ex-OR
gate is shown in figure 2.18.
A
𝑌 =𝐴⊕𝐵
B
Ex-NOR gate
The Ex-NOR stands for Exclusive NOR. It means NOT of Ex-OR. Ex-
NOR gate has two inputs and a single output. (We may design multiple input
Ex-NOR gates. But they are not readily available). Output of Ex-NOR gate is
HIGH if even number of inputs is HIGH. If odd number of inputs is LOW,
output is LOW.
The logic expression (sometimes also called logical equation) of 2 – input
Ex-NOR gate is shown below.
1-13
̅̅̅̅̅̅̅̅
𝑌 =𝐴 ⊕ 𝐵 = 𝐴𝐵 + ̅̅̅̅
𝐴𝐵
It is read as Y is equal to A Ex-NOR B. Logical symbol for 2 – input Ex-
NOR gate is shown in figure 2.20.
A
𝑌 = ̅̅̅̅̅̅̅̅̅̅
𝐴 ⊕ 𝐵
B
A 𝑌 =𝐴
1-14
A 𝑌 =𝐴
A
𝑌 = 𝐴. 𝐵
B
𝑌 = 𝐴. 𝐵
𝑌=𝐴+𝐵
1-15
A
𝑌=𝐴+𝐵
B
𝑌 =(̅𝐴+ ̅ ̅
̅ 𝐵 )
𝑌 = ̅(̅𝐴.̅ ̅𝐵)̅
Example 1: Construct a logic circuit using NAND gates only for following
expression
𝑋̅ = 𝐴. (𝐵 + 𝐶)
1-16
A
𝑋̅ = 𝐴. (𝐵 + 𝐶)
Example 2: Construct a logic circuit using NOR gates only for following
expression
𝑋̅ = 𝐴. (𝐵 + 𝐶)
𝑋̅ = 𝐴. (𝐵 + 𝐶)
Questions:
1. Draw symbol, logical equation and truth table of 3 i/p AND gate and 3
i/p OR gate. [4M]
2. Draw pin configuration of TTL ICs used for AND gate and NAND gate.
[4M]
1-17
3. Draw logical symbol, truth table and logical expression of EX-OR gate.
[2M]
4. Draw symbol and truth table for EX-NOR gate. [2M]
5. Draw logical symbol, truth table and logical expression for NAND and
NOR gate. [4M]
6. Draw logical symbol, expression, truth table and IC pin configuration for 2
input NOR gate. [4M]
7. Draw the pin configuration with the internal schematic of IC 7400. [2M]
8. Draw symbol, logical equation, truth table and TTL IC used for 2 i/p EX-
OR and NOR gate. [4M]
9. Draw logic symbol and truth table of NOR gate. [2M]
10. Draw AND gate using NAND gates only and NOR gates only. [2M]
11. Implement AND, OR, NOT and NOR gate using NAND gates only. [4M]
12. Draw logical symbol, truth table and logical expression of NAND gate and
AND gate. [4M]
13. What is universal gate? Construct a logic circuit using NAND gates only
for following expression. [4M]
𝑋̅ = 𝐴 ∙ (𝐵 + 𝐶)
14. What are universal gates? Draw logical circuits of basic gates using
universal gates. [4M]
15. Define universal gate and design basic gates using NAND as universal
gate. [4M]
16. What is universal gate? Construct any two basic gates using NOR gate.
[4M]
17. Implement OR and AND gates by using NAND gates only. [4M]
Boolean laws
Boolean algebra is mathematics of logic. It is one of the most basic tool for
simplifying Boolean laws. Logic variables are denoted by capital letters (e.g. A,
B, C, …). If value of 𝐴 = 0, then 𝐴 = 1 and if value of 𝐴 = 1, then 𝐴 = 0. Two
Boolean expressions are said to be equal if and only if the truth tables of them
are identical.
1-18
(𝐴. 𝐵). 𝐶 = 𝐴. (𝐵. 𝐶)
̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐴. 𝐵. 𝐶 … . . 𝑁= 𝐴 + ̅ ̅
𝐵+𝐶+⋯ 𝑁
𝐴 + 𝐵 + 𝐶 … . . +𝑁= 𝐴 . 𝐵̅ . 𝐶 … … 𝑁
̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅ ̅
Duality property states that all Boolean expressions remain valid when
following steps are performed.
Step 1: Interchange OR operator (+) and AND operator (.)
Step 2: Replace all 1’s by 0’s and all 0’s by 1’s.
e.g. As 𝐴 + 0 = 𝐴, its dual is 𝐴. 1 = 𝐴
As (𝐴 + 𝐵 ). 𝐵 = 𝐴. 𝐵, its dual is 𝐴. 𝐵 + 𝐵 = 𝐴 + 𝐵
As ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐴. 𝐵. 𝐶 … . . 𝑁= 𝐴 + ̅ ̅,
𝐵+𝐶+⋯ 𝑁 its dual is
𝐴 + 𝐵 + 𝐶 … . . +𝑁= 𝐴
̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅ ̅ .𝐵
̅ .𝐶̅……𝑁 ̅
1-19
Example 1:
Prove that 𝐴. (𝐵 + 𝐶) = 𝐴. 𝐵 + 𝐴. 𝐶
Proof:
1 2 3 4 5 6 7 8
A B C (B+C) A.(B+C) A.B A.C A.B+A.C
0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 0
0 1 0 1 0 0 0 0
0 1 1 1 0 0 0 0
1 0 0 0 0 0 0 0
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1
Example 2:
Prove that 𝐴 + 𝐵. 𝐶 = (𝐴 + 𝐵). (𝐴 + 𝐶)
Proof:
1 2 3 4 5 6 7 8
A B C B.C A+B.C A+B A+C (A+B).(A+C)
0 0 0 0 0 0 0 0
0 0 1 0 0 0 1 0
0 1 0 0 0 1 0 0
0 1 1 1 1 1 1 1
1 0 0 0 1 1 1 1
1 0 1 0 1 1 1 1
1 1 0 0 1 1 1 1
1 1 1 1 1 1 1 1
Example 3:
Prove De-Morgan’s first theorem.
De-Morgan’s first theorem states that complement of product of
variables is equal to the sum of complements of the variables.
i.e. ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐴. 𝐵. 𝐶 … . . 𝑁= 𝐴 + ̅
𝐵+𝐶+⋯ 𝑁 ̅
as, Proof:
Let’s try to prove the De-Morgan’s first theorem for three variables
𝐴. 𝐵.𝐶 = 𝐴 + 𝐵 + 𝐶
1-20
1 2 3 4 5 6 7 8 9
𝐴 𝐵 𝐶 𝐴. 𝐵. 𝐶 𝐴. 𝐵.𝐶 𝐴 𝐵 𝐶 𝐴 + 𝐵+ 𝐶
0 0 0 0 1 1 1 1 1
0 0 1 0 1 1 1 0 1
0 1 0 0 1 1 0 1 1
0 1 1 0 1 1 0 0 1
1 0 0 0 1 0 1 1 1
1 0 1 0 1 0 1 0 1
1 1 0 0 1 0 0 1 1
1 1 1 1 0 0 0 0 0
Questions:
1. State De-Morgan’s theorem. [2M]
2. State and prove De Morgan’s theorem. [4M]
3. State commutative law. [2M]
4. List different Boolean laws. Also write duality theorem. [4M]
5. State associative law and distributive law of Boolean algebra. [4M]
6. State any four Boolean laws. [2M]
7. State duality theorem and prove it. [4M]
1-21
Example 3:
Simplify 𝑌 = (𝐴 + 𝐵)(𝐴 + 𝐵)(𝐴 + 𝐵)
Y = (𝐴 + 𝐵) (𝐴 + 𝐵 ) (𝐴+ 𝐵)
= (𝐴. 𝐴 + 𝐴. 𝐵+ 𝐵. 𝐴 + 𝐵. 𝐵 )(𝐴 + 𝐵) By using distributive law
= (𝐴 + 𝐴. 𝐵 + 𝐵. 𝐴 + 0)(𝐴 + 𝐵) 𝐴. 𝐴 = 𝐴 and 𝐵. 𝐵 = 0
= (𝐴 + 𝐴. 𝐵 + 𝐵. 𝐴)(𝐴 + 𝐵) 𝐴+0= 𝐴
= (𝐴 + 𝐴. (𝐵+ 𝐵))(𝐴 + 𝐵) By taking A common
= (𝐴 + 𝐴. 0)(𝐴 + 𝐵) 𝐵 + 𝐵= 0
= (𝐴 + 0)(𝐴 + 𝐵) 𝐴. 0 = 0
= 𝐴. (𝐴 + 𝐵) 𝐴+0= 𝐴
= 𝐴. 𝐴 + 𝐴. 𝐵 By using distributive law
= 0 + 𝐴. 𝐵 𝐴. 𝐴 = 0
= 𝐴. 𝐵 𝐴+0= 𝐴
Therefore, 𝑌 = 𝐴. 𝐵
Example 1:
Draw logical circuit for following Boolean expression using basic gates
𝑌 = 𝐴𝐵 + 𝐵𝐶
𝑌 = 𝐴𝐵 + 𝐵𝐶
1-22
Therefore, 𝑌 = 𝐴. 𝐵
𝐵 𝐵 𝐴
𝑌 = 𝐴. 𝐵
Questions:
1. Prove that 𝑌 𝑍 + 𝑊 𝑋̅ 𝑍 + 𝑊𝑋̅𝑌 𝑍 + 𝑊𝑌𝑍 = 𝑍 [4M]
2. Prove [4M]
a. 𝐴 + 𝐴𝐵 + 𝐴𝐵= 𝐴 + 𝐵
b. 𝐴𝐵 + 𝐴𝐵 + 𝐴𝐵= 𝐴 + 𝐵
3. Reduce the following expression and implement using logic gates. [4M]
𝑌 = 𝐴𝐵 + 𝐴𝐵𝐶 + 𝐴𝐵(𝐸 + 𝐹)
4. Simplify the following Boolean expressions using Boolean laws. [4M]
a. 𝑌 = 𝐴(𝐴 + 𝐶)(𝐴𝐵 + 𝐶)
b. 𝑌 = 𝐵𝐶 𝐷+ 𝐴𝐵𝐷 + 𝐴𝐵𝐷 + 𝐵𝐶𝐷+ 𝐵𝐶𝐷 + 𝐴𝐵 𝐶 𝐷 + 𝐴𝐵 𝐶 𝐷
5. Simplify following expression and draw logic gate diagram. [4M]
̅̅̅̅ + ̅̅̅̅̅̅̅̅̅
𝑌 = (𝐴𝐵 𝐴 + 𝐵 )𝐴.𝐵̅
1-23
Chapter 3
CombiNATIOnAL Logic Circuits
16 Hours
18 Marks
3-2
𝑌 = 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶
As this expression is a function of three variables, it can be expressed as
𝑓(𝐴, 𝐵, 𝐶). It cans also be represented as 𝑌(𝐴, 𝐵, 𝐶).
𝑌 = 𝑓(𝐴, 𝐵, 𝐶) = 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶
Both the examples shown above are in sum of products form. But in first
example, even though the expression is function of three variables, first term is
containing only two variables whereas third term is containing only one
variable.
𝑌 = 𝐴. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐵
We may write each such incomplete term of the above expression in
expanded form as,
𝐴. 𝐶 = 𝐴. 𝐶. (𝐵 + 𝐵) = 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶
𝐵 = 𝐵. (𝐴 + 𝐴) = 𝐴. 𝐵 + 𝐴. 𝐵 = 𝐴. 𝐵. (𝐶 + 𝐶) + 𝐴. 𝐵. (𝐶 + 𝐶)
= 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶
Therefore, the expanded sum of product expression can be written as,
𝑌 = 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶
𝑌 = 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶
Expanded form of Boolean expression in which each term contains all the
Boolean variables in it is called as canonical form. It is also called as
standard sum of products form.
Example 1:
Convert following Boolean expression into standard SOP form.
𝐴𝐶 + 𝐵𝐷
The above expression is a function of four variables A, B, C and D.
As each term is not containing all the variables, it is not standard SOP. The
terms can be expanded to make it standard SOP as,
𝑌(𝐴, 𝐵, 𝐶, 𝐷) = 𝐴. 𝐶̅ + 𝐵. 𝐷
= 𝐴. (𝐵 + 𝐵̅ ). 𝐶̅ + 𝐵. 𝐷
= 𝐴. 𝐵. 𝐶̅ + 𝐴. 𝐵̅. 𝐶̅ + 𝐵. 𝐷
= 𝐴. 𝐵. 𝐶̅. (𝐷 + 𝐷̅ ) + 𝐴. 𝐵̅. 𝐶̅. (𝐷 + 𝐷̅ ) + 𝐵. 𝐷
= 𝐴. 𝐵. 𝐶̅. 𝐷 + 𝐴. 𝐵. 𝐶̅. 𝐷̅ + 𝐴. 𝐵̅. 𝐶̅. 𝐷 + 𝐴. 𝐵̅ . 𝐶̅. 𝐷̅ + 𝐵. 𝐷
= 𝐴. 𝐵. 𝐶̅. 𝐷 + 𝐴. 𝐵. 𝐶̅. 𝐷̅ + 𝐴. 𝐵̅. 𝐶̅. 𝐷 + 𝐴. 𝐵̅ . 𝐶̅. 𝐷̅ + (𝐴 + 𝐴̅). 𝐵. 𝐷
= 𝐴. 𝐵. 𝐶̅. 𝐷 + 𝐴. 𝐵. 𝐶̅. 𝐷̅ + 𝐴. 𝐵̅. 𝐶̅. 𝐷 + 𝐴. 𝐵̅ . 𝐶̅. 𝐷̅ + 𝐴. 𝐵. 𝐷 + 𝐴. 𝐵. 𝐷̅
= 𝐴. 𝐵. 𝐶̅. 𝐷 + 𝐴. 𝐵. 𝐶̅. 𝐷̅ + 𝐴. 𝐵̅. 𝐶̅. 𝐷 + 𝐴. 𝐵̅ . 𝐶̅. 𝐷̅ + 𝐴. 𝐵. (𝐶 + 𝐶̅). 𝐷 + 𝐴. 𝐵. (𝐶 + 𝐶̅). 𝐷̅
= 𝐴. 𝐵. 𝐶̅. 𝐷 + 𝐴. 𝐵. 𝐶̅. 𝐷̅ + 𝐴. 𝐵̅. 𝐶̅. 𝐷 + 𝐴. 𝐵̅. 𝐶̅. 𝐷̅ + 𝐴. 𝐵. 𝐶. 𝐷 + 𝐴. 𝐵. 𝐶̅. 𝐷 + 𝐴. 𝐵. 𝐶. 𝐷̅ +
𝐴. 𝐵. 𝐶̅. 𝐷̅
As, 𝐴 + 𝐴 = 𝐴
𝑌(𝐴, 𝐵, 𝐶, 𝐷) = 𝐴. 𝐵. 𝐶̅. 𝐷 + 𝐴. 𝐵. 𝐶̅. 𝐷̅ + 𝐴. 𝐵̅. 𝐶̅. 𝐷 + 𝐴. 𝐵̅. 𝐶̅. 𝐷̅ + 𝐴. 𝐵. 𝐶. 𝐷 + 𝐴. 𝐵. 𝐶. 𝐷̅
3-3
Example 2:
Standardize following Boolean expression.
𝑌 = 𝐴𝐶 + 𝐵̅𝐶
The above expression is a function of three variables A, B and C. As
each term is not containing all the variables, it is not standard SOP. The terms
can be expanded to make it standard SOP as,
𝑌(𝐴, 𝐵, 𝐶) = 𝐴. 𝐶 + 𝐵̅. 𝐶
= 𝐴. (𝐵 + 𝐵̅ ). 𝐶 + 𝐵̅. 𝐶
= 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵̅ . 𝐶 + 𝐵̅. 𝐶
= 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵̅ . 𝐶 + (𝐴 + 𝐴̅). 𝐵̅. 𝐶
= 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵̅. 𝐶 + 𝐴. 𝐵̅ . 𝐶 + 𝐴̅. 𝐵̅. 𝐶
As, 𝐴 + 𝐴 = 𝐴
𝑌(𝐴, 𝐵, 𝐶) = 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶
𝐴. 𝐵. 𝐶 𝐴. 𝐵. 𝐶
m6 m2
110 010
Therefore the expression can be represented as,
𝑌(𝐴, 𝐵, 𝐶) = ∑ 𝑚(2,3,5,6,7)
Example 2:
𝑌 = 𝐴. 𝐵. 𝐶̅. 𝐷 + 𝐴. 𝐵. 𝐶̅. 𝐷̅ + 𝐴. 𝐵̅. 𝐶̅. 𝐷 + 𝐴. 𝐵̅. 𝐶̅. 𝐷̅ + 𝐴. 𝐵. 𝐶. 𝐷 + 𝐴. 𝐵. 𝐶. 𝐷̅
As the above expression in standard sum of products, all terms in it are
minterms. They are,
𝐴. 𝐵. 𝐶 . 𝐷 𝐴. 𝐵. 𝐶̅. 𝐷̅ 𝐴. 𝐵̅. 𝐶̅. 𝐷
m13 m m
12
1101 1100 1001
9
𝐴. 𝐵̅. 𝐶̅. 𝐷̅
𝐴. 𝐵. 𝐶. 𝐷 𝐴. 𝐵. 𝐶. 𝐷
1 0 0 0 m8 m15 m14
1111 1110
3-4
Therefore the expression can be represented as,
𝑌(𝐴, 𝐵, 𝐶, 𝐷) = ∑ 𝑚(8,9,12,13,14,15)
3-5
𝑌 = (𝐴 + 𝐶). (𝐵+ 𝐶). 𝐴
We may write each such incomplete term of the above expression in
expanded form as,
(𝐴 + 𝐶) = (𝐴 + 𝐵. 𝐵̅ + 𝐶)
= (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵̅ + 𝐶) (𝐵̅ + 𝐶) = (𝐴. 𝐴̅ + 𝐵̅ + 𝐶)
= (𝐴 + 𝐵̅ + 𝐶). (𝐴̅ + 𝐵̅ + 𝐶)𝐴
= (𝐴 + 𝐵. 𝐵̅) = (𝐴 + 𝐵). (𝐴 + 𝐵̅)
= (𝐴 + 𝐵 + 𝐶. 𝐶̅). (𝐴 + 𝐵̅ + 𝐶. 𝐶̅)
= (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶̅). (𝐴 + 𝐵̅ + 𝐶). (𝐴 + 𝐵̅ + 𝐶̅)
Therefore, the expanded sum of product expression can be written as,
𝑌 = (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴
+ 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶)
𝑌 = (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶)
Expanded form of Boolean expression in which each term contains all the
Boolean variables in it is called as canonical form. It is also called as
standard product of sums form.
Example 1:
Convert following Boolean expression into standard POS form.
(𝐴 + 𝐶). (𝐵 + 𝐷)
The above expression is a function of four variables A, B, C and D.
As each term is not containing all the variables, it is not standard POS. The
terms can be expanded to make it standard POS as,
𝑌(𝐴, 𝐵, 𝐶, 𝐷) = (𝐴 + 𝐶). (𝐵 + 𝐷)
= (𝐴 + 𝐵. 𝐵 + 𝐶). (𝐵 + 𝐷)
= (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐵 + 𝐷)
= (𝐴 + 𝐵 + 𝐶 + 𝐷. 𝐷). (𝐴 + 𝐵+ 𝐶 + 𝐷. 𝐷). (𝐵 + 𝐷)
= (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵+ 𝐶 + 𝐷). (𝐴 + 𝐵+ 𝐶
+ 𝐷). (𝐵 + 𝐷)
= (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵+ 𝐶 + 𝐷). (𝐴 + 𝐵+ 𝐶
+ 𝐷). (𝐴. 𝐴 + 𝐵 + 𝐷)
= (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵+ 𝐶 + 𝐷). (𝐴 + 𝐵+ 𝐶
+ 𝐷). (𝐴 + 𝐵 + 𝐷). (𝐴 + 𝐵 + 𝐷)
= (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵+ 𝐶 + 𝐷). (𝐴 + 𝐵+ 𝐶
+ 𝐷). (𝐴 + 𝐵 + 𝐶. 𝐶 + 𝐷). (𝐴 + 𝐵 + 𝐶. 𝐶 + 𝐷)
= (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵+ 𝐶 + 𝐷). (𝐴 + 𝐵+ 𝐶
+ 𝐷). (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵 + 𝐶
+ 𝐷). (𝐴 + 𝐵 + 𝐶 + 𝐷)
As, 𝐴. 𝐴 = 𝐴
𝑌(𝐴, 𝐵, 𝐶, 𝐷) = (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵 + 𝐶 + 𝐷) . (𝐴 + 𝐵+ 𝐶 + 𝐷). (𝐴 + 𝐵+ 𝐶
+ 𝐷) . (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵 + 𝐶 + 𝐷)
Example 2:
Standardize following Boolean expression.
𝑌 = (𝐴 + 𝐵)(𝐴 + 𝐶)
The above expression is a function of three variables A, B and C. As
each term is not containing all the variables, it is not standard POS. The terms
3-6
can be expanded to make it standard POS as,
𝑌(𝐴, 𝐵, 𝐶) = (𝐴 + 𝐵). (𝐴 + 𝐶)
= (𝐴 + 𝐵 + 𝐶. 𝐶). (𝐴 + 𝐶)
= (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐶)
= (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵. 𝐵 + 𝐶)
= (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶)
As, 𝐴 + 𝐴 = 𝐴
𝑌(𝐴, 𝐵, 𝐶) = (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶)
𝐴+𝐵+𝐶 𝐴+𝐵+𝐶
M1 M5
0 0 1 1 0 1
Therefore the expression can be represented as,
𝑌(𝐴, 𝐵, 𝐶) = ∏ 𝑀(0,1,2,4,5)
Example 2:
𝑌 = (𝐴 + 𝐵 + 𝐶 + 𝐷). (𝐴 + 𝐵 + 𝐶 + 𝐷
). (𝐴 + 𝐵+ 𝐶 + 𝐷)
As the above expression in standard product of sums form, all terms in it
are maxterms. They are,
𝐴+𝐵+𝐶 +𝐷 𝐴+𝐵+𝐶 +𝐷 𝐴 + 𝐵+ 𝐶 + 𝐷
M2 M M6
0 0 1 0 0 0 1 1 3 0 1 1 0
6
𝑌(𝐴, 𝐵, 𝐶, 𝐷) = ∏ 𝑀(2,3,6)
Karnaugh Map
a. b.
Figure 3.1: Two ways of representing a 2-variable K-map
As discussed previously, each square (or cell) in K-map corresponds to one
input combination. In figure 3.1a, cell 0 corresponds to input combination ‘00’
(i.e. 𝐴. 𝐵), cell 1 corresponds to input combination ‘01’ (i.e. 𝐴. 𝐵), cell 2
corresponds to input combination ‘10’ (i.e. 𝐴. 𝐵) and cell 3 corresponds to input
combination ‘11’ (i.e. 𝐴. 𝐵).
A three-variable K-map can be drawn with various possibilities. Four
possibilities are shown in figure 3.2. In these notes we will use pattern shown in
figure 3.2a.
BC AB
00 01 11 10 00 01 11 10
A 0 0 1 3 2 C 0 0 2 6 4
1 4 5 7 6 1 1 3 7 5
a. b.
C A
0 1 0 1
AB 00 0 1 BC 00 0 4
01 2 3 01 1 5
11 6 7 11 3 7
10 4 5 10 2 6
c. d.
3-8
A four-variable K-map can be drawn with various possibilities. Two
possibilities are shown in figure 3.3. In these notes we will use pattern shown in
figure 3.3a.
3-9
CD AB
00 01 11 10 00 01 11 10
AB 00 0 1 3 2 CD 00 0 4 12 8
01 4 5 7 6 01 1 5 13 9
11 12 13 15 14 11 3 7 15 11
10 8 9 11 10 10 2 6 14 10
a. b.
Figure 3.3: Two ways of representing a 4-variable K-map
The above minterms can be represented in K-map. All the present terms
are marked as ‘1’ and remaining cells are marked as ‘0’. As the function is of
three variables, a three-variable K-map is used for representation.
BC
00 01 11 10
A 0 0 1 1 0 3 1 2 0
1 4 0 5 0 7 1 6 1
Example 2:
Represent following expression using K-map.
𝑓(𝐴, 𝐵, 𝐶, 𝐷) = ∑ 𝑚(0,1,2,5,13,15)
The above minterms can be represented in K-map. All the present
terms are marked as ‘1’ and remaining cells are marked as ‘0’. As the function is
of four-variables, a four-variable K-map is used for representation.
3-10
CD
00 01 11 10
AB 00 01 11 30 21
01 40 51 70 60
11 12 0 13 1 15 1 14 0
10 80 90 11 0 10 0
Example 3:
Represent following expression using K-map.
𝑌 = ∑ 𝑚(0,1,3)
The above minterms can be represented in K-map. All the present
terms are marked as ‘1’ and remaining cells are marked as ‘0’. As the function is
of two-variables, a two-variable K-map is used for representation.
B
0 1
A0 01 11
1 20 31
The above maxterms can be represented in K-map. All the present terms
are marked as ‘0’ and remaining cells are marked as ‘1’. As the function is of
three variables, a three-variable K-map is used for representation.
BC
00 01 11 10
A 0 0 0 1 0 3 1 2 1
1 4 1 5 1 7 0 6 1
3-11
Example 2:
Represent following expression using K-map.
𝑓(𝐴, 𝐵, 𝐶, 𝐷) = ∏ 𝑀(1,3,5,7,9,11,13,15)
The above maxterms can be represented in K-map. All the present terms
are marked as ‘0’ and remaining cells are marked as ‘1’. As the function is of four-
variables, a four-variable K-map is used for representation.
CD
00 01 11 10
AB 00 01 10 30 21
01 41 50 70 61
11 12 1 13 0 15 0 14 1
10 81 90 11 0 10 1
Example 3:
Represent following expression using K-map.
𝑌 = ∏ 𝑀(0,2)
The above maxterms can be represented in K-map. All the present terms
are marked as ‘0’ and remaining cells are marked as ‘1’. As the function is of two-
variables, a two-variable K-map is used for representation.
B
0 1
A 0 00 11
1 20 31
Page No:
17
DESIGN OF ADDER AND SUBTRACTOR
To design and construct half adder, full adder, half subtractor and full
subtractor circuits and verify the truth table using logic gates.
THEORY:
HALF ADDER:
A half adder has two inputs for the two bits to be added and two outputs one
from the sum ‘ S’ and other from the carry ‘ c’ into the higher adder position. Above
circuit is called as a carry signal from the addition of the less significant bits sum from
the X-OR Gate the carry out from the AND gate.
FULL ADDER:
A full adder is a combinational circuit that forms the arithmetic sum of input; it
consists of three inputs and two outputs. A full adder is useful to add three bits at a
time but a half adder cannot do so. In full adder sum output will be taken from X-OR
Gate, carry output will be taken from OR Gate.
HALF SUBTRACTOR:
The half subtractor is constructed using X-OR and AND Gate. The half
subtractor has two input and two outputs. The outputs are difference and borrow. The
difference can be applied using X-OR Gate, borrow output can be implemented using
an AND Gate and an inverter.
Page No:
18
FULL SUBTRACTOR:
The full subtractor is a combination of X-OR, AND, OR, NOT Gates. In a full
subtractor the logic circuit should have three inputs and two outputs. The two half
subtractor put together gives a full subtractor .The first half subtractor will be C and
A B. The output will be difference output of full subtractor. The expression AB
assembles the borrow output of the half subtractor and the second term is the inverted
difference output of first X-OR.
LOGIC DIAGRAM:
HALF ADDER
TRUTH TABLE:
A B CARRY SUM
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
Page No:
19
K-Map for SUM: K-Map for CARRY:
LOGIC DIAGRAM:
TRUTH TABLE:
A B C CARRY SUM
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
Page No:
20
1 1 1 1 1
LOGIC DIAGRAM:
HALF
SUBTRACTOR
TRUTH TABLE:
A B BORRO DIFFERENC
W E
0 0 0 0
0 1 1 1
1 0 0 1
1 1 0 0
Page No:
21
K-Map for DIFFERENCE: K-Map for BORROW:
FULL SUBTRACTOR
Page No:
22
TRUTH TABLE:
A B C BORRO DIFFEREN
W CE
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 1 0
1 0 0 0 1
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
Page No:
23
DESIGN AND IMPLEMENTATION OF CODE
CONVERTOR
THEORY:
The availability of large variety of codes for the same discrete elements of
information results in the use of different codes by different systems. A conversion
circuit must be inserted between the two systems if each uses different codes for same
information. Thus, code converter is a circuit that makes the two systems compatible
even though each uses different binary code.
A code converter is a circuit that makes the two systems compatible even
though each uses a different binary code. To convert from binary code to Excess-3
code, the input lines must supply the bit combination of elements as specified by code
and the output lines generate the corresponding bit combination of code. Each one of
the four maps represents one of the four outputs of the circuit as a function of the four
input variables.
Page No:
24
A two-level logic diagram may be obtained directly from the Boolean
expressions derived by the maps. These are various other possibilities for a logic
diagram that implements this circuit.
LOGIC DIAGRAM:
BINARY TO GRAY CODE CONVERTOR
G3 = B3
K-Map for G1: K-Map for G0:
TRUTH TABLE:
| Binary input | Gray code output |
B3 B2 B1 B0 G3 G2 G1 G0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 0
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 0
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0
LOGIC DIAGRAM:
GRAY CODE TO BINARY CONVERTOR
TRUTH TABLE:
G3 G2 G1 G0 B3 B2 B1 B0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 1 0 0 1 0
0 0 1 0 0 0 1 1
0 1 1 0 0 1 0 0
0 1 1 1 0 1 0 1
0 1 0 1 0 1 1 0
0 1 0 0 0 1 1 1
1 1 0 0 1 0 0 0
1 1 0 1 1 0 0 1
1 1 1 1 1 0 1 0
1 1 1 0 1 0 1 1
1 0 1 0 1 1 0 0
1 0 1 1 1 1 0 1
1 0 0 1 1 1 1 0
1 0 0 0 1 1 1 1
B3 = G3
Page No:
20
K-Map for B1: K-Map for B0:
LOGIC DIAGRAM:
BCD TO EXCESS-3 CONVERTOR
E3 = B3 + B2 (B0 + B1)
Page No:
21
K-Map for E1: K-Map for E0:
TRUTH TABLE:
0 0 0 0 0 0 1 1
0 0 0 1 0 1 0 0
0 0 1 0 0 1 0 1
0 0 1 1 0 1 1 0
0 1 0 0 0 1 1 1
0 1 0 1 1 0 0 0
0 1 1 0 1 0 0 1
0 1 1 1 1 0 1 0
1 0 0 0 1 0 1 1
1 0 0 1 1 1 0 0
1 0 1 0 x x x X
1 0 1 1 x x x X
1 1 0 0 x x x X
1 1 0 1 x x x X
1 1 1 0 x x x X
1 1 1 1 x x x X
Page No:
22
DIGITAL ELECTRONICS LAB
A = X1 X2 + X3 X4 X1
Page No:
23
DIGITAL ELECTRONICS
LAB
TRUTH TABLE:
B3 B2 B1 B0 G3 G2 G1 G0
0 0 1 1 0 0 0 0
0 1 0 0 0 0 0 1
0 1 0 1 0 0 1 0
0 1 1 0 0 0 1 1
0 1 1 1 0 1 0 0
1 0 0 0 0 1 0 1
1 0 0 1 0 1 1 0
1 0 1 0 0 1 1 1
1 0 1 1 1 0 0 0
1 1 0 0 1 0 0 1
Page No:
24
DIGITAL ELECTRONICS
LAB
AIM:
To design and implement 4-bit adder and subtractor using IC 7483.
THEORY:
Page No:
25
DIGITAL ELECTRONICS
LAB
Page No:
26
DIGITAL ELECTRONICS
LAB
LOGIC DIAGRAM:
2-BIT BINARY ADDER
LOGIC DIAGRAM:
4-BIT BINARY SUBTRACTOR
Page No:
27
DIGITAL ELECTRONICS
LAB
LOGIC DIAGRAM:
4- BIT BINARY ADDER/SUBTRACTOR
Page No:
28
DIGITAL ELECTRONICS
LAB
TRUTH TABLE:
LOGIC DIAGRAM:
BCD ADDER
A4 A3 A2 A1 B4 B B B C S S3 S2 S1 B D4 D3 D2 D1
3 2 1 4
1 0 0 0 0 0 1 0 0 1 0 1 0 1 0 1 1 0
1 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0
0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 1 0
0 0 0 1 0 1 1 1 0 1 0 0 0 0 1 0 1 0
1 0 1 0 1 0 1 1 1 0 0 1 0 0 1 1 1 1
1 1 1 0 1 1 1 1 1 1 0 1 0 0 1 1 1 1
1 0 1 0 1 1 0 1 1 0 1 1 1 0 1 1 0 1
K MAP
Page No:
29
Y = S4 (S3 + S2)
TRUTH TABLE:
BCD CARR
SUM Y
S S3 S2 S1 C
4
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
Page No:
42
DESIGN AND IMPLEMENTATION OF MULTIPLEXER AND
DEMULTIPLEXER
AIM:
To design and implement multiplexer and demultiplexer using logic gates and
study of IC 74150 and IC 74154.
THEORY:
MULTIPLEXER:
Multiplexer means transmitting a large number of information units over a
smaller number of channels or lines. A digital multiplexer is a combinational circuit
that selects binary information from one of many input lines and directs it to a single
output line. The selection of a particular input line is controlled by a set of selection
lines. Normally there are 2n input line and n selection lines whose bit combination
determine which input is selected.
DEMULTIPLEXER:
The function of Demultiplexer is in contrast to multiplexer function. It takes
information from one line and distributes it to a given number of output lines. For this
reason, the demultiplexer is also known as a data distributor. Decoder can also be
used as demultiplexer. In the 1: 4 demultiplexer circuit, the data input line goes to all
of the AND gates. The data select lines enable only one gate at a time and the data on
the data input line will pass through the selected gate to the associated data output
line.
Page No:
43
DIGITAL ELECTRONICS LAB
FUNCTION TABLE:
S S INPUTS Y
1 0
0 0 D0 → D0 S1’
S0’
0 1 D1 → D1 S1’
S0
1 0 D2 → D2 S1
S0’
1 1 D3 → D3 S1
S0
Y = D0 S1’ S0’ + D1 S1’ S0 + D2 S1 S0’ + D3 S1 S0
Page No:
44
TRUTH TABLE:
S1 S0 Y =
OUTPUT
0 0 D0
0 1 D1
1 0 D2
1 1 D3
FUNCTION TABLE:
S1 S0 INPU
T
0 0 X → D0 = X S1’
S0’
0 1 X → D1 = X S1’ S0
1 0 X → D2 = X S1 S0’
1 1 X → D3 = X S1 S0
Page No:
45
S0 TRUTH TABLE:
INPUT OUTPUT
S1 S0 I/P D D1 D2 D3
0
0 0 0 0 0 0 0
0 0 1 1 0 0 0
0 1 0 0 0 0 0
0 1 1 0 1 0 0
1 0 0 0 0 0 0
1 0 1 0 0 1 0
1 1 0 0 0 0 0
1 1 1 0 0 0 1
Page No:
46
TRUTH TABLE:
INPUT OUTPUT
S1 S0 I/P D0 D1 D2 D3
0 0 0 0 0 0 0
0 0 1 1 0 0 0
0 1 0 0 0 0 0
0 1 1 0 1 0 0
1 0 0 0 0 0 0
1 0 1 0 0 1 0
1 1 0 0 0 0 0
1 1 1 0 0 0 1
Page No:
47
DESIGN AND IMPLEMENTATION OF ENCODER
AND DECODER
AIM:
To design and implement encoder and decoder using logic gates and study of
IC 7445 and IC 74147.
THEORY:
ENCODER:
An encoder is a digital circuit that perform inverse operation of a decoder. An
encoder has 2n input lines and n output lines. In encoder the output lines generates
the binary code corresponding to the input value. In octal to binary encoder it has
eight inputs, one for each octal digit and three output that generate the corresponding
binary code. In encoder it is assumed that only one input has a value of one at any
given time otherwise the circuit is meaningless. It has an ambiguila that when
all inputs are zero the outputs are zero. The zero outputs can also be generated when
D0 = 1.
DECODER:
A decoder is a multiple input multiple output logic circuit which converts coded
input into coded output where input and output codes are different. The input code
generally has fewer bits than the output code. Each input code word produces a
different output code word i.e there is one to one mapping can be expressed in truth
table. In the block diagram of decoder circuit the encoded information is present as n
input producing 2n possible outputs. 2n output values are from 0 through out 2n – 1.
Page No:
48
PIN DIAGRAM FOR IC
7445: BCD TO DECIMAL
DECODER:
Page No:
49
LOGIC DIAGRAM FOR ENCODER:
Page No:
50
TRUTH TABLE:
INPUT OUTPUT
Y1 Y2 Y3 Y4 Y5 Y6 Y7 A B C
1 0 0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 0 1 0
0 0 1 0 0 0 0 0 1 1
0 0 0 1 0 0 0 1 0 0
0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 1 1 1 1
4-
51
TRUTH TABLE:
INPU OUTPU
T T
E A B D0 D1 D2 D3
1 0 0 1 1 1 1
0 0 0 0 1 1 1
0 0 1 1 0 1 1
0 1 0 1 1 0 1
0 1 1 1 1 1 0
4-
52
Chapter 4. SequentiAl Logic Circuits
Questions:
1. Give any four differences between combinational (or combinatorial) and
sequential logic circuit. [4M]
2. Differentiate between combinational logic and sequential logic system.
[4M]
R Q
S Q̄
4-
53
Table 4.1: Truth Table for One-bit memory cell (NAND
implementation)
Input Output
S R Q Q̄
0 0 Race
(both 1)
0 1 0 1
1 0 1 0
1 1 Q Q̄
R Q
S Q̄
Questions:
3. Draw 1-bit memory cell using NAND gate. [2M]
4. Draw 1-bit memory cell using NOR gate. [2M]
5. Why a flip-flop is called a basic memory cell? [2M]
4-
54
Level 1 (HIGH)
Positiv Negative
e Edge
Edge
Level 0 (LOW)
Questions:
1. Draw clock signal. Explain various triggering methods. [4M]
2. Name the types of triggering that can be used for clocking a flip flop. [2M]
3. Explain positive edge triggering and negative edge triggering. [4M]
4. Enlist triggering methods and explain one of them. [4M]
5. Describe different types of triggering methods for a flip-flop. [4M]
6. Explain the types of triggering methods. [4M]
Flip flops
4-
55
Logic gate was the most basic building block of a combinational
circuit. In sequential circuit, flip-flop is the most basic building block.Flip
flop is a bi-stable circuit. It means, it has two stable internal states. Both
the output states Q and Q̄ are stable. Circuit remains in a particular
output state indefinitely until something is done to change it.
Various types of flip-flops are
- SR Flip flop
- JK Flip flop
- T Flip flop
- D Flip flop
Q¯
R
S
Q
SR
Flip
R Q
4-
56
When S=0 and R=1
As R is 1, after inversion one input of lower NAND gate is 0 which
results in generating output 1 for the lower NAND gate. i.e. Q̄
becomes 1. As S is 0,
after inversion one input of upper NAND gate is 1. Other input of this
NAND gate is also 1 (as Q̄ is 1). So the output of upper NAND gate i.e. Q
becomes 0. Both the outputs remain stable as 0 and 1.i.e. flip flop is
reset.
S
1
3 Q
Clock
4 Q̄
2
R
S
SR Q
Cl k
Flip Flop
Q̄
R
When Clk=1
As one input of NAND gates 1 and 2 are always 1, outputs of these
NAND gates are inversion of other inputs. i.e. Circuit responds to
values of S and R. Here NAND gates 1 and 2 work as NOT gates.
4-
59
Preset
S
1 3 Q
Clock
2 4 Q̄
R
Clear
Figure 4.8: Implementation of clocked SR Flip Flop with Preset &
Clear
Pr
4-
60
S
SR Q
Clk
Flip Flop
Q̄
R
Cr
Figure 4.9: Symbol of clocked SR Flip Flop with Preset &
Clear
Table 4.4: Truth Table for clocked SR Flip Flop with Pr&
Cr
Input Output
Pr Cr Clk S R Qn+1
4-
61
0 0 Not used
0 1 X X X 1
1 0 X X X 0
1 1 0 X X No change
1 1 1 0 0 Qn
1 1 1 0 1 0
1 1 1 1 0 1
1 1 1 1 1 Forbidden
Pr
S
SR Q
Flip Flop
Clk
Q̄
R
Cr
Figure 4.10: Symbol of Positive level triggered SR Flip
Flip Flop
Input Output
Clk S R Qn+1
0 X X No change
1 0 0 Qn
1 0 1 0
1 1 0 1
1 1 1 Forbidden
4-
62
Figure 4.11: Symbol of Negative level triggered SR Flip
4-
63
Flop Table 4.7: Truth Table for Positive edge
Input Output
Clk S R Qn+1
Other X X No change
0 0 Qn
0 1 0
1 0 1
1 1 Forbidden
4-
64
JK Flip Flop
As seen in above discussion, in all versions of SR flip flops there is
one forbidden input combination. This is the main drawback of SR flip
flop. This limitation of SR flip flop is overcome in JK flip flop.
Implementation of JK flip flop is shown below. This implementation is
of positive level triggered JK flip flop with preset and clear inputs.
Preset
J 1 3 Q
Clock
K 2 4 Q̄
Clear
Figure 4.14: Implementation of clocked JK Flip Flop with Preset &
J
JK Q
Cl k
Flip Flop
Q̄
K
Cr
Figure 4.15: Symbol of clocked JK Flip Flop with Preset &
Clear
Preset input, Clear input and Clock input work same as that of SR
flip flop. So they are not discussed here.
Truth table of JK flip flop with Preset and Clear inputs is shown
4-
66
below.
Table 4.9: Truth Table for clocked JK Flip Flop with Pr&
Cr
Input Output
Pr Cr Clk J K Qn+1
0 0 Not used
0 1 X X X 1
1 0 X X X 0
1 1 0 X X No change
1 1 1 0 0 Qn
1 1 1 0 1 0
1 1 1 1 0 1
1 1 1 1 1 Q̄¯n¯ (Toggle)
4-
67
Cloc
k
Signa
l
Cloc
k
Signa
l
4-
68
Figure 4.17: Sample (Sample 2) output pulse when J=K=1
Pr Pr
SN Sc
J
QN Qc Q
Clock
Clk Clk
Q̄¯¯N¯ Q̄¯¯c Q̄
K
RN Rc
Cr Cr
Slave SR
Master SR
Flip Flop
Flip Flop
4-
69
Figure 4.18: Master Slave JK Flip Flop using two SR Flip
Flops
Here two SR flip flops are used. First SR flip flop works as master
and second SR flip flop works as slave. Master SR flip flop controls the
operation of slave SR flip flop. A clock is provided to master flip flop and
the same clock is provided to slave flip flop but through a NOT gate.
Therefore, when master flip flop is enabled, slave flip flop is disables
and vice-a-versa. So output is not propagated immediately. Rather it is
propagated at the end of a complete clock pulse. This results in
avoidance of race around condition.
J
MS JK Q
Clk
Flip Flop
Q̄
K
Cr
Figure 4.19: Symbol of MS JK Flip
4-
70
JK Flip Flop with different triggering methods
Various types of JK flip flops on the basis of triggering methods are
- Positive level triggered JK flip flop
- Negative level triggered JK flip flop
- Positive edge triggered JK flip flop
- Negative edge triggered JK flip flop
Symbols and truth tables of these flip flops are given below.
Pr
J
Q
JK
Clk F Fliplop
Q̄
K
Cr
Figure 4.20: Symbol of Positive level triggered JK Flip
JK Flip Flop
Input Output
Clk J K Qn+1
0 X X No change
1 0 0 Qn
1 0 1 0
1 1 0 1
1 1 1 Q̄¯n¯
4-
71
Pr
J
JK Q
Clk
Flip Flop
Q̄
K
Cr
Figure 4.21: Symbol of Negative level triggered JK Flip
JK Flip Flop
Input Output
Clk J K Qn+1
1 X X No change
0 0 0 Qn
0 0 1 0
0 1 0 1
0 1 1 Q̄¯n¯
Pr
J
JK Q
Clk
Flip Flop
Q̄
K
Cr
Figure 4.22: Symbol of Positive edge triggered JK Flip
Flop
4-
72
Table 4.13: Truth Table for Positive edge triggered
JK Flip Flop
Input Output
Clk J K Qn+1
Other X X No change
0 0 Qn
0 1 0
1 0 1
1 1 Q̄¯n¯
Table 4.14: Truth Table for Negative edge triggered JK Flip Flop
Input Output
Clk J K Qn+1
Other X X No change
0 0 Qn
0 1 0
1 0 1
1 1 Q̄¯n¯
T Flip Flop
4-
73
It is also called as Toggle flip flop. Its output changes its state each
time when it is triggered and T input is 1. We can implement T flip flop
using JK flip flop as shown below.
Pr
T J
Q
Clk JK
Flip Flop
Q̄
K
Cr
Figure 4.24: Implementation of T Flip Flop using JK
Pr
T
T Q
k Flip Flop
Cl
Q̄
Cr
Figure 4.25: Symbol of T Flip
4-
74
T Qn+1
0 Qn (No change)
1 Q̄¯¯n¯ (Toggle)
D S
Q
SR
Clk
Flip Flop
Q̄
R
Cr
Figure 4.30: Implementation of D Flip Flop using SR Flip Flop
D flip can also be implemented using JK flip flop. This
implementation is shown below.
Pr
D J
Q
JK
Clk
Flip Flop
Q̄
K
Cr
Figure 4.31: Implementation of D Flip Flop using JK Flip Flop
Symbol of D flip flop is shown below
Pr
4-
75
D
D Q
Flip Flop
Clk
Q̄
Cr
Figure 4.32: Symbol of D Flip Flop
Truth table of D flip flop is given below.
D
D Q
Flip Flop
Clk
Q̄
Cr
4-
76
Questions:
1. State different applications of flip-flops. [4M]
2. Explain clocked SR flip flop using NAND gate. [4M]
3. Draw clocked SR flip flop. [2M]
4. Draw logic circuit diagram of clocked RS flip flop using NAND gates and
draw the truth table. [4M]
5. Explain function of ‘preset’ and ‘clear’ inputs in Flip-flops. [4M]
6. Draw symbol and truth table of JK flip flop. [2M]
7. Draw logic diagram of JK flip flop and write its truth table. [4M]
8. State function of “Preset” and “Clear” terminals in a JK flip flop. [4M]
9. Give significance of “Preset” and “Clear” terminals in a JK flip flop. [4M]
10. Show logic circuit of JK Flip flop using NAND gates only. Explain its
working with truth table. [4M]
11. Draw neat circuit diagram of clocked JK Flip-flop using NAND gates.
Give its truth table explain race-around condition. [4M]
12. Explain race around condition with respect to JK flip flop. [4M]
13. What is race around condition? How to eliminate it? [4M]
14. What is race around condition? How can it be avoided? [4M]
15. Draw and explain master slave flip flop. [4M]
16. Draw and explain MS-JK flip flop. [4M]
17. List different types of flip flops. Draw diagram of master slave JK flip flop.
18. Convert SR flip flop into D flip flop and explain. [4M]
19. Draw symbol and truth table of negative edge triggered T flip flop and
positive edge triggered D flip flop. [2M]
20. With the help of suitable diagram explain how do you convert JK flip flop
into T flip flop and D flip flop. [4M]
21. Draw symbol and truth table of T and D flip flop. [4M]
22. Draw logic diagram of D flip flop and write its truth table. [4M]
23. Draw symbol and truth table for following flip-flops.
a. Clocked SR flip flop.
b. JK flip flop.
c. D filp flop.
d. T flip flop.
24. Draw symbol and truth table of T flip flop for negative edge triggered.
[4M]
25. Draw and explain D flip flop using SR flip flop. Also draw truth table.
[4M]
Flip flops have large set of applications as they are the basic
building blocks in all the sequential circuits. Major applications of Flip
flops are
- Memories (data storage)
- Counters
o Synchronous Counters
o Asynchronous Counters
4-
77
o Up Counters
o Down Counters
o Mod-N Counters
- Shift Registers
o Serial In Serial Out Shift Registers
o Serial In Parallel Out Shift Registers
o Parallel In Parallel Out Shift Registers
o Parallel In Serial Out Shift Registers
o Ring Counters
o Johnson Counters
- Delay Elements
- Frequency Division
- Data Transfer
Counters
Counter is a sequential logic circuit. It is cascaded arrangement
of more than one flip flop with or without some combinational logic
devices. It is basically used for counting applications like.
- Counting objects on conveyors.
- Counting incoming and outgoing vehicles.
- Counting numbers of papers in printing.
- Filling fixed number of tablets in a bottle.
For designing counters either JK flip flops or T flip flops are used.
While using JK flip flops, J and K inputs are to be shortened (i.e. JK
flip flop is to be used as T flip flop).
Counters can be broadly classified in two categories as
- Asynchronous Counters
- Synchronous Counters
These types are discussed later on.
Modulus of a counter
Modulus of a counter is number of different states it goes through
before coming back to initial state. i.e. number of states that a counter
counts is called as modulus of counter.
Example 1:
If a counter counts from 0 to 7 (as 0, 1, 2, 3, 4, 5, 6, 7),
then this counter has modulus 8 and it is said to be a mod-8
counter.
Example 2:
If a counter counts from 0 to 5 (as 0, 1, 2, 3, 4, 5), then this
counter has modulus 6 and it is said to be a mod-6 counter.
Asynchronous counter
Asynchronous counter is also called as ripple counter or serial
counter.In this type of counter, clock pulse is applied to only first flip
flop. Output of first flip flop drives clock input of second flip flop and so
4-
78
on. The counter is called asynchronous as the clock pulses of all the flip
flops are not same. Due to this all the flip flops do not change their
states at the same time. Second flip flop can change the state only after
change in the state of first flip flop. So these counters have high
propagation delay. Hence the operational frequency is low. Advantage
of this type of counter is that it is easy to design.
4-
79
4-
80
Following timing diagram illustrates how the flip flops in the
above designs change their state along with the external clock pulse
applied to flip flop
0. As the flip flops used are negative edge triggered, output changes on
negative edge of clock pulse.
Timing diagram
Truth Table
4-
81
(i.e. third flip flop).
Output of this counter is observed at QO (LSB),Q1 and Q2 (MSB) which
are output states of flip flop 0, flip flop 1 and flip flop 2 respectively.
Timing diagram
Truth Table
4-
82
Design using JK flip flop Design using T flip flop
Timing diagram
4-
83
Example 3: For mod-8
counter N=8
If n=1, 2n is 2. Here, N is not less than or equal to
2n. If n=2, 2n is 4. Here, N is not less than or
equal to 2n. If n=3, 2n is 8. Here, N is equal to 2n.
3 flip flops are required for designing mod-8 counter.
ii. Preset inputs (i.e. Pr input) of all the n flip flops are connected to
logic 1 (or VCC).
iii. When JK flip flops are used, J and K input of all the n flip flops are
connected to each other and then to logic 1 (or VCC). When T flip flops
are used, T inputs of all the n flip flops are connected to logic 1 (or
VCC). Due to this, all the n flip flops always toggle their output state at
each trigger (i.e. output state of each flip flop gives the negation of
previous state on trigger).
iv. External clock pulse is connected to flip flop number 0 (i.e. first flip
flop). Output of first flip flop (i.e. QO) is connected to clock input of flip
flop number 1 (i.e. second flip flop). Output of second flip flop (i.e. Q1)
is connected to clock input of flip flop number 2 (i.e. third flip flop) and
so on.
v. Calculate binary equivalent of N. Respective output
states for which the bits in the binary equivalent are 1,
are connected to inputs of NAND gate. Output of this
NAND gate is connected to Clear inputs (Cr inputs) of
all the flip flops. But if N = 2n, no need of NAND gate as
the counter is in its full form.
Example 1: For mod-6 counter
N = 6 = 110
1 1 0
Bit # 2 1 0
So outputs Q1 andQ2 are connected to inputs of NAND
gate and output of NAND gate is connected to Clear inputs
(Cr inputs) of all the 3 flip flops.
vi. Output of the counter is observed at QO (LSB), Q1, …, Qn–1(MSB) which are
4-
84
output states of flip flops 0, 1, …, n-1 respectively.
Some examples are discussed below. But scope of the topic is not
limited to only these counters. We should be able to design any mod-N
counter by using above steps.
Mod-3 counter
It is also called mod-3 ripple counter, or mod-3 asynchronous
counter or mod 3 serial counter.
Here, N=3
If n=1, 2n is 2. Here, N is not less than or equal
to 2n. If n=2, 2n is 4. Here, N is less than 2n.
2 flip flops are required for designing mod-3 counter.
So, 2 JK flip flops or 2 T flip flops are used. Preset input (i.e.
Prinput) of both the flip flops are connected to logic 1 (or V CC).
Following two figures show design of 2-bit asynchronous counter using
JK flip flop and using T flip flop respectively. While implementing this
counter using JK flip flop, J and K inputs of both the flip flops are
connected to each other and then to logic 1 (or VCC).
While implementing this counter using T flip flop, T input of both the flip
flops is connected to logic 1 (or VCC). So, flip flops work in toggle mode.
External clock pulse is connected to flip flop number 0 (i.e. first flip flop).
Output of first flip flop (i.e. QO) is connected to clock input of flip flop
number 1 (i.e. second flip flop).
Binary equivalent of N = 3 is 11. So outputs QO andQ1 are connected
to inputs of NAND gate and output of NAND gate is connected to Clear
inputs (Cr inputs) of both flip flops. Due to this modification, 2-bit
asynchronous counter is converted into mod-3 counter.
Output of this counter is observed at QO (LSB) and Q1 (MSB) which
are output states of flip flop 0 and flip flop 1 respectively.
Timing diagram
Mod-5 counter
It is also called mod-5 ripple counter, or mod-5 asynchronous
counter or mod-5 serial counter.
Here, N=5
If n=1, 2n is 2. Here, N is not less than or equal
to 2n. If n=2, 2n is 4. Here, is not less than or
equal to 2n.
If n=3, 2n is 8. Here, N is less than 2n.
3 flip flops are required for designing mod-5 counter.
So, 3 JK flip flops or 3 T flip flops are used. Preset input (i.e. Pr
input) of all the three flip flops are connected to logic 1 (or VCC).
Following two figures show design of 3-bit asynchronous counter using
JK flip flop and using T flip flop respectively. While implementing this
counter using JK flip flop, J and K inputs of all the three flip flops are
connected to each other and then to logic 1 (or VCC). While
implementing this counter using T flip flop, T input of all the three flip
flops is connected to logic 1 (or VCC). So, flip flops work in toggle mode.
External clock pulse is connected to flip flop number 0 (i.e. first flip flop).
Output of first flip flop (i.e. QO) is connected to clock input of flip flop
number 1 (i.e. second flip flop) and output of second flip flop (i.e. Q1) is
connected to clock input of flip flop number 2 (i.e. third flip flop).
Binary equivalent of N = 5 is 101. So outputs QO andQ2 are connected
to inputs of NAND gate and output of NAND gate is connected to Clear
inputs (Cr inputs) of all the three flip flops. Due to this modification, 3-bit
asynchronous counter is converted into mod-5 counter.
Output of this counter is observed at QO (LSB), Q1 and Q2 (MSB)
which are output states of flip flop 0, flip flop 1 and flip flop 2
respectively.
Timing diagram
Mod-10 counter
It is also called mod-10 ripple counter, or mod-10 asynchronous
counter or mod-10 serial counter.
Here, N=10
If n=1, 2n is 2. Here, N is not less than or equal
to 2n. If n=2, 2n is 4. Here, is not less than or
equal to 2n.
If n=3, 2n is 8. Here, is not less than or equal to
2n. If n=4, 2n is 16. Here, N is less than 2n.
4 flip flops are required for designing mod-10 counter.
So, 4 JK flip flops or 4 T flip flops are used. Preset input (i.e. Pr
input) of all the four flip flops are connected to logic 1 (or VCC).
Following two figures show design of 4-bit asynchronous counter using
JK flip flop and using T flip flop respectively. While implementing this
counter using JK flip flop, J and K inputs of all the four flip flops are
connected to each other and then to logic 1 (or VCC). While implementing
this counter using T flip flop, T input of all the four flip flops is
connected to logic 1 (or VCC). So, flip flops work in toggle mode.
External clock pulse is connected to flip flop number 0 (i.e. first flip flop).
Output of first flip flop (i.e. QO) is connected to clock input of flip flop
number 1 (i.e. second flip flop). Output of second flip flop (i.e. Q1) is
connected to clock input of flip flop number 2 (i.e. third flip flop)
andoutput of third flip flop (i.e. Q2) is connected to clock input of flip flop
number 3 (i.e. fourth flip flop).
Binary equivalent of N = 10 is 1010. So outputs Q1 andQ3 are
connected to inputs of NAND gate and output of NAND gate is connected
to Clear inputs (Cr inputs) of all the four flip flops. Due to this
modification, 4-bit asynchronous counter is converted into mod-10 counter.
Output of this counter is observed at QO (LSB), Q1,Q2and Q3(MSB)
which are output states of flip flop 0, flip flop 1, flip flop 2 and flip flop 3
respectively.
Timing diagram
Synchronous counter
Synchronous counter is also called as parallel counter. In this
type of counter, same clock pulse is applied all the flip flops. The counter
is called synchronous as the clock pulses of all the flip flops are same. i.e.
all the flip flops are synchronized. Due to this, all the flip flops change
their states at the same time in synchronization with the clock pulse. So
these counters have low propagation delay. Hence the operational
frequency is high. Only drawback of this type of counter is that it is
difficult to design. Extra circuitry is required for designing these counters.
4-
88
While implementing this counter using T flip flop, T input of first flip flops
is connected to logic 1 (or VCC).In case of UP counter, output of flip flop 0
(i.e. QO) is connected to J and K input of flip flop 1 (in case of T flip flop
implementation, QO is connected to T input of flip flop 1). Output of the
counter is observed at QO (LSB) andQ1 (MSB) which are output states of
flip flops 0 and 1respectively.
Timing diagram
Truth Table
4-
89
Design using JK flip flop Design using T flip flop
Timing diagram
Following truth table shows the state transitions in the counter. It shows
how the counter counts from 3 (11) to 0 (00). So, counter repeatedly counts
as 3,
2, 1, 0, 3, 2 and so on.
Truth Table
Timing diagram
Truth Table
Timing diagram
Truth Table
Timing diagram
Truth Table
4-
92
flops. Following two figures show design of 4-bit synchronous DOWN
counter using JK flip flop and using T flip flop respectively. While
implementing this counter using JK flip flop, J and K input of first flip
flop is connected to each other and then to logic 1 (or VCC). While
implementing this counter using T flip flop, T input of first flip flopis
connected to logic 1 (or VCC). As it is DOWN counter, negated output of
flip flop 0 (i.e. Q̄¯O¯) is connected to J and K input of flip flop 1 (in case of T
flip flop implementation, Q̄¯O¯ is connected to T input of flip flop 1).
Negated output of flip flop 0 (i.e. Q̄¯O¯) and negated output of flip flop 1 (i.e.
Q̄¯1¯) are connected to AND gate whose output is connected to J and K
input of flip flop 2 (in case of T flip flop implementation, negated output
of flip flop 0 (i.e. Q̄¯O¯) and negated output of flip flop 1 (i.e. Q̄¯1¯) are
connected to AND gate whose output is connected to T input of flip flop
2). Negated output of flip flop 0 (i.e. Q̄¯O¯), negated output of flip flop 1 (i.e.
Q̄¯1¯) and negated output of flip flop 2 (i.e. Q̄¯2¯) are connected to AND gate
whose output is connected to J and K input of flip flop 3 (in case of T flip
flop implementation, negated output of flip flop 0 (i.e. Q̄¯O¯), negated
output of flip flop 1 (i.e. Q̄¯1¯) and negated output of flip flop 2 (i.e. Q̄¯2¯) are
connected to AND gate whose output is connected to T input of flip flop
3).Output of the counter is observed at QO (LSB), Q1,Q2andQ3(MSB)
which are output states of flip flops 0, 1, 2 and3respectively.
Following timing diagram illustrates how the flip flops in the above
designs change their state along with the external clock pulse applied
to them. As the flip flops used are negative edge triggered, output
Timing diagram
4-
93
Questions:
1. State two applications of counters. [2M]
2. List any four applications of counters. [2M]
3. Define counter and modulus of counter. [2M]
4. Explain ‘modulus of a counter’ with example. [2M]
5. What is modulus of a counter? [2M]
6. Draw logical circuit diagram of a 3 bit asynchronous counter and explain.
[4M]
7. Explain 4-bit asynchronous counter with circuit diagram and timing
diagram. [4M]
8. Design a 3-bit asynchronous counter. Draw its truth table. [4M]
9. How many flip flops are required to construct the following modulus
counter? Why? [4M]
i) -5 ii) 83 iii) 99 iv) 10
Tip: As counter is used for counting and counting is not done in
negative numbers, counter cannot count up to -5. So instead of -5
consider 5.
10. What is modulus of counter? Design a mod-3 ripple counter using a 2-bit
ripple counter. [4M]
Tip; For mod-3 ripple counter, N=3. n=2. i.e. 2 flip flops are
used. So, it will be similar to 2-bit asynchronous counter with
little modifications (NAND gate, Clear inputs etc.)
11. Design mod-5 asynchronous counter. [4M]
12. Design a mod-5 ripple counter. [4M]
13. Design mod-6 asynchronous counter. [4M]
14. Design asynchronous mod-6 counter with its truth table. [4M]
15. Design mod-10 asynchronous counter with suitable flip-flop. [4M]
16. Design a mod-11 asynchronous counter giving the steps of design. [4M]
17. Draw mod-11 asynchronous counter using T flip flop. [4M]
18. List steps to design a ‘n’ bit synchronous up counter. [4M]
19. Explain 3-bit synchronous counter. [4M]
20. Explain 3-bit synchronous counter with logical circuit diagram and timing
diagram. [4M]
21. Explain working of 3-bit synchronous counter with circuit diagram. [4M]
22. Explain 3-bit synchronous counter with truth table and timing diagram.
[4M]
23. Design 3-bit synchronous up counter. [4M ]
24. raw mod 8 synchronous counter with timing diagram of truth table. [4M]
25. Compare between synchronous and asynchronous counter (4 points). [4M]
4-
94
Registers
Register is a sequential logic circuit. It is also cascaded
arrangement of more than one flip flop with or without some
combinational logic devices. It is also called as Shift Register. As seen
before, a single flip flop is 1-bit memory cell. So, a single flip flop is also
called as 1-bit register.It is basically used for storing and/or
transferring digital information. Applications of registers or shift
registers are
- Delay Line.
- Serial to Parallel Converter.
- Parallel to Serial Converter.
- Ring Counter.
- Twisted Ring Counter.
- Sequence Generator.
- Sequence Detector.
For designing counters either JK flip flops or D flip flops are used.
While using JK flip flops, J input is connected to K input through a NOT
gate. (i.e. JK flip flop is to be used as D flip flop).
Data can be entered or retrieved in serial or in parallel to or from
a shift register. Depending on the way how data is entered and
retrieved, shift registers can be classified as
- Serial In Serial Out (SISO) Shift Register
- Serial In Parallel Out (SIPO) Shift Register
- Parallel in Parallel Out (PIPO) Shift Register
- Parallel in Serial Out (PISO) Shift Register
.
Important design/ implementation issues for registers
While designing or implementing registers or shift registers,
following issues are important.
1. Number of flip flops used
For n-bit register or n-bit shift register, n flip flops are used.
4-
95
6 flip flops are required for designing a register which can store 35.
4-
96
2. Sequencing of flip flops
In the cascaded arrangement of flip flops, the flip flops are
numbered as A, B, C and so on. i.e. first flip is numbered as A,
second flip flop is numbered as B and so on. Serial input is
provided at input of flip flop A. In the truth table the columns of
output are numbered as QÆ, QB, QC and so on. Here QÆ is
considered as MSB and the last output state is considered as LSB.
(This is a major difference from counter implementation)
Truth Table
Timing diagram
Following truth table shows the state transitions in the register for sample
input sequence 11001. It shows how the flip flops change their states on each
clock pulse.
Truth Table
Following timing diagram illustrates how the flip flops in the above
designs change their state along with the external clock pulse applied
to them for the above sample input sequence.
Timing diagram
Truth Table
Timing diagram
Then output of flip flop A (i.e. QÆ) is connected to J input of flip flop
B (i.e. JB ) and negated output of flip flop A (i.e. Q̄Æ ) is connected to K input
of flip flop B (i.e. KB). Output of flip flop B (i.e. QB) is connected to J input
of flip flop C (i.e. JC) and negated output of flip flop B (i.e. Q̄B ) is connected
to K input of flip flop C (i.e. KC). Output of flip flop C (i.e. QC) is connected
to J input of flip flop D (i.e. JD) and negated output of flip flop C (i.e. Q̄C ) is
connected to K input of flip flop D (i.e. KD).
In implementation using D flip flop, output of flip flop A (i.e.
QÆ) is connected to D input of flip flop B (i.e. DB). Output of flip flop B
(i.e. QB) is connected to D input of flip flop C (i.e. DC). Output of flip
flop C (i.e. QC) is connected to D input of flip flop D (i.e. DD).
Parallel Input is provided at all the J inputs (or D inputs) of all
the four flip flops i.e. JÆ, JB, JC and JD (or DÆ, DB, DC and DD).
Parallel Output is observed at output states of all the four flip
flops i.e.QÆ, QB, QC and QD.
4-
101
Universal Shift Register
As already discussed in 4.4.2.5, Universal Shift Register is a shift
register that can operate universally. It can take serial as well as parallel
input. Alos it can generate serial as well as parallel output. So, it can
operate in any of the four types which are Serial In Serial Out, Serial In
Parallel Out, Parallel In Parallel Out and Parallel In Serial Out.
Design or implementation of universal shift register using JK flip
flop as well as D flip flop is already shown in 4.4.2.5.
IC 7495 can be used as universal shift register.Pin diagram of this 14-
pin IC is shown in following figure. Pin 1 is used for serial input and pin
numbers 2, 3, 4 and 5 are used for parallel input. Parallel output can be
taken from pin numbers 13, 12, 11 and 10. Pin 10 (as it is output of last flip
flop. i.e. QD) is used for serial output. Pin 6 is used for selecting Mode of
operation of the IC. Pin number 9 (CLK1) is used for providing clock for
normal right shift operation and pin 8 (CLK1) is used for left-shift (or LOAD
operation. i.e. parallel input). Pin number 7 and 14 are used for providing
ground and VCC respectively.
Ring Counter
It is also called as Circulating Register. It is one of the application
of shift register. It shifts a bit within the flip flops continuously.A ring
counter is obtained from a shift register by directly feeding back the output
of the last flip- flop to the J input (or D input) of the first flip-flop.
Ring counter can be implemented using JK flip flops as well as D
flip flops. These implementations are shown in following
figuresrespectively.In J-K flip-flop implementation, outputs of the last flip-
flop (i.e. QD and Q̄D ) are respectively fed back to the J and Kinputs of the
first flip-flop (i.e. JÆ and KÆ).In D flip-flop implementation, output of the
last flip-flop (i.e. QD) is fed back to the
D input of the first flip-flop (i.e. DÆ).
Assuming that flip flop A is initially set to 1 and remaining flip flops
are set to 0, initial output of the ring counter will be 1000.With the first
clock pulse, this ‘1’ gets shifted to the second flip-flop output and the counter
output becomes 0100. Similarly, with the second and thirdclock pulses, the
counter output will become 0010 and 0001. With the fourth clock pulse, the
counteroutput will again become 1000. The count cycle repeats in the
subsequent clock pulses.
Truth table for this sample is shown below.
4-
102
Truth table
Timing Diagram
Assuming that all the flip flopsare initially reset to 0, initial output of
the ring counter will be 0000. With the first clock pulse, output becomes
1000.
Similarly, with the second, thirdand fourth clock pulses, the counter output
will become 1100, 1110 and 1111. With the fifth clock pulse, the
counteroutput will again become 0111. Then on consecutive clock pulses
output will be 0011, 0001, 0000, 1000 and so on.
Truth table for this sample is shown
4-
103
Questions:
1. Compare counters and shift registers. [4M]
2. Give applications of shift register. [4M]
3. List different types of shift registers. [2M]
4. List different types of shift registers and draw 4-bit SISO shift register.
[4M]
5. Draw logical circuit diagram of 4-bit serial in serial out shift register.
Explain with truth table. [4M]
6. Draw and explain SISO with truth table and timing diagram. [4M][
7. Draw block diagram of SISO (Right shift mode) shift register with its
truth table and logic diagram. [4M]
8. Explain the function of 3-bit SISO with waveforms and block diagram.
[4M]
9. Draw and explain working of 4-bit SIPO shift register with truth table.
[4M]
10. Draw diagram of Serial In Parallel Out (SIPO) shift register. Also draw
timing diagram. [4M]
11. Explain 4-bit SIPO shift register with the help of block diagram, truth
table and timing diagrams. [4M]
12. Draw and describe universal shift register. [4M]
13. Draw pin diagram of universal shift register IC 7495. [2M]
14. Draw pin diagram of universal shift register IC 7495. List any two
applications of shift register. [4M]
15. Study given figure. Initial output condition is QA QB Qc = 010. Write
truth table of output QA QB Qc for 4 clock pulses. [4M]
P P P
D QÆ D QÆ D QÆ
C C C
Cloc
16. With the help of block diagram explain working of ring counter. [4M]
17. How many flip flops are required to build a shift register to store following
number. [4M]
i) Decimal 28 ii) Binary 6 bits iii) Octal 17 iv) Hexadecimal A
4-
104
Memories
Static RAM
Basic element used in static RAM (also referred as SRAM) is a
latch memory cell. Latch memory cell holds its contents as long as power
is provided to it. So, contents of SRAM don’t get lost until power given to
the computer is not switched off.
Speed of operation of SRAM is more as compared to dynamic RAM.
But Memory capacity of SRAM is less as compared to dynamic RAM.
Dynamic RAM
Basic element used in dynamic RAM (also referred as DRAM) is a
capacitor and MOSFET. Capacitor stores the contents as charge. But as
capacitor may get discharged contents of DRAM may get lost even if
power given to the computer is not switched off. So, refreshing of memory
is required at regular intervals (after every 5-10 ms) even if power is
connected to the computer. For this, additional refreshing circuit is
required which is major disadvantage of DRAM.
Most important advantage of this memory is its high density. i.e.
More number of bits. So, cost per bit is less. So, memory capacity of DRAM is
more as compared to SRAM whereas cost is less for DRAM as compared to
SRAM.
Speed of operation of DRAM is less as compared to SRAM.
Questions:
1. Give classification of different types of semiconductor memories. [2M]
2. Classify memories. Give function of each type. [4M]
3. Describe how memories can be classified. [4M]
4. State how memories can be classified on the basis of principle of operation.
[4M]
5. Give classification of different types of ROM memory. [4M]
6. Give classification of different types of semiconductor memories based on
fabrication technology. [2M]
7. Classify memories and explain ROM. [4M]
8. Compare ROM and RAM (4 points). [2M], [4M]
9. Differentiate between ROM and RAM. [4M]
10. Compare static RAM and dynamic RAM. [4M]
11. Differentiate between static and dynamic RAM. (any four points) [4M]
12. Write advantages and disadvantages of dynamic RAM. [4M]
13. State advantages and disadvantages of static RAM. [4M]
14. Give four features of dynamic RAM. [4M]
15. Explain EPROM. [4M]
16. State advantages and disadvantages of EPROM. [4M]
Distinguish between ROM, PROM, EPROM and EEPR
4-
107
SHIFT REGISTERS
4-
108
4-
109
4-
110
4-
111
Chapter 5
DATA Converters AND PLDS
16 Hours
14 Marks
4-
112
D to A Converter Specifications
Major performance specifications of digital to analog
converters are specified below.
- Resolution
- Accuracy
- Conversion speed or Setting (or settling) time
- Dynamic range
- Linearity
- Nonlinearity and Differential nonlinearity
- Monotonocity
- Temperature Sensitivity
Resolution
Resolution of a digital to analog converter is
number of states (2n) into which the full scale range is
divided or resolved. Here ‘n’ is number of bits in the
input digital word. Higher the number of bits, better the
resolution.
8-bit DAC has 255 (i.e. 2n – 1) resolvable levels. It has
8-bit resolution.
Accuracy
Accuracy of a digital to analog converter is the
difference between actual analog output and expected
ideal output when a digital input is given.
Various sources of errors that may affect accuracy
are gain errors, offset errors and nonlinearity errors.
Conversion speed or Setting (or settling) time
Conversion speed of a digital to analog converter is
expressed in terms of its setting time. Setting time is
the time period that has elapsed for analog output to
reach its final value after change in digital input has
occurred.
General purpose digital to analog converters have
setting time in the range of microseconds whereas some4-
high-speed DACs have setting time in the range of113
nanoseconds.
Dynamic range
Dynamic range of a digital to analog converter is
ratio of the largest output to the smallest output
(excluding zero). It is expressed in dB.
Linearity
In DAC, equal increment in digital input should
result in equal increment in the analog output voltage.
Linearity of DAC is a measure of the precision with
which linear input output relationship is satisfied.
Monotonocity
In ideal digital to analog converter, analog output
should increase by identical step size for every one LSB
increase in digital input. In such case DAC is said to be
having perfect monotonocity.
Temperature Sensitivity
Analog output voltage for any fixed digital input
varies with temperature. This is called as temperature
sensitivity. This is due to temperature sensitivity of
voltage source, resistors, OP-AMPs and other
components.
4-
114
Questions:
1. State DAC specifications (any four). [4M]
2. State 2 specifications of DAC. [2M]
3. Define specifications of DAC (Any 4). [4M]
4. Define resolution and accuracy with respect to D-A converter.
[4M]
5. What are important specifications of DAC (Write any 4). [4M]
6. Define following with respect to DAC. [2M]
i) Resolution ii) Setting time
4-
115
Switch positions are controlled by the digital inputs. When digital input
is logic 1, it connects the corresponding resistance to the reference
voltage V R; otherwise, it leaves resistor open. Hence,
4-
116
R-2R Ladder D/A Converter
4-
118
4-
119
The inverting R/2R ladder DAC works on the principle of summing
currents and it is also said to operate in the current mode. An important advantage
of the current mode is that all ladder node voltages remain constant with
changing input codes, thus avoiding any shutdown effects by stray capacitances.
4-
120
Advantages of R-2R ladder DACs:
1. Easier to build accurately as only two precision metal film resistors are
required.
2. Number of bits can be expanded by adding more sections of same
R/2R values.
3. In inverted R/2R ladder DAC, node voltages remain constant with
changing input binary words. This avoids any slowdown effects by
stray capacitances.
DEFINITION :
An electronic integrated circuit which transforms a signal from
analog(continues) to digital(discrete) form.
121
The Dual Slope ADC functions in this manner:
When an analog value is applied the capacitor begins to charge in a
linear manner and the oscillator passes to the counter.
The counter continues to count until it reaches a predetermined
value. Once this value is reached the count stops and the counter is
reset.
The control logic switches the input to the first comparator to a
reference voltage, providing a discharge path for the capacitor.
As the capacitor discharges the counter counts.
When the capacitor voltage reaches the reference voltage the
count stops and the value is stored in the register.
Examples of A/D Applications
• Voltmeters
• Digital Multimeters
122
123
b. Successive Approximation ADC
The successive-approximation converter shown in Figure operates by
approximating the analogue input signal with a binary code.
This binary code is successively revising by changing each bit in the code
until the best approximation is achieved.
At each step in the approximation, the present estimate of the binary value
corresponding to the analogue input signal is saved in the successive
approximation register.
The contents of this register are converted to an analogue signal by a DAC so
that a single comparator can determine whether the approximation is larger or
smaller than the input signal.
As shown in Figure the first approximation sets the most significant bit, the
MSB, of the successive approximation register and resets all the other bits (i.e.
makes them zero).
If the DAC output (which is therefore equal, at this point, to half full-scale) is
smaller than the analogue input, the MSB is left on; if the DAC output is too
large, then the MSB is turned off.
In the next clock cycle, the next most significant bit is set (i.e. at the DAC
output is now equal to either 3/4 or 1/4 of full-scale, depending on whether the
most significant bit was left on or not) and this new approximation is compared
with the analogue input.
124
Each successive bit is similarly tested.
After the least significant bit has been tested, the conversion is complete and
the output register contains the binary code.
Purpose of PLDs --
Permits elaborate digital logic designs to be implemented by the user on
a single device.
Is capable of being erased and reprogrammed with a new design.
Advantages of PLDs
Cost effective in lower volumes
Short design time
Programmability
Re-programmability
PLDs can be reprogrammed without being removed from the circuit board.
Low cost of design
Immediate hardware implementation
PLDs are often used for address decoding, where they have several
clear advantages over the 7400-series TTL parts that they replaced: One
chip requires less board area, power, and wiring than several do. The
design inside the chip is flexible, so a change in the logic does not
require any rewiring of the board. Rather, simply replacing one PLD with
another part that has been programmed with the new design can alter the decoding
logic.
Types of PLDs
SPLDs (Simple Programmable Logic Devices)
– EPROM
• Non-volatile and reprogrammable
– EEPROM
• Non-volatile and reprogrammable
– Flash memory
• Non-volatile memory
Complex Programmable Logic Device (CPLD)
Introduction:
A CPLD (complex programmable logic device) chip includes
several circuit blocks on a single chip with inside wiring resources
to attach the circuit blocks. Each circuit block is comparable to a
PLA or a PAL. These chips are inadequate to fairly modest sizes,
normally supporting a mutual number of inputs and outputs of not
more than 32. For designing of these circuits that need more
inputs and outputs, either numerous PLAs/ PALs can be employed
or else a more classy type of chip can be used called a CPLD.
128
129