Digital Electronics
Digital Electronics
Digital Electronics
RADIX OR BASE:-
The radix or base of a number system is defined as the number of different digits which can occur in
each position in the number system.
RADIX POINT :-
The generalized form of a decimal point is known as radix point. In any positional number system the
radix point divides the integer and fractional part.
In general,
is given by
(dn x 10n) + (dn-1 x 10n-1) + (dn-2 x 10n-2) + … + ( d0 x 100) + ( d-1 x 10 -1) + (d-2 x 10 -2) +…+(d -m x 10 –m)
For example:-
In general,
is given by
(dn x 2n) + (dn-1 x 2n-1) + (dn-2 x 2n-2) + ….+ ( d0 x 20) + ( d-1 x 2 -1) + (d-2 x 2 -2) +….+(d -k x 2 –k)
For example:
0 000 4 100
1 001 5 101
2 010 6 110
3 011 7 111
For example:
Group of 3 bits are 101 111 010 110 . 110 110 011
Convert each group into octal = 5 7 2 6 . 6 6 3
The result is (5726.663)8
(ii) Convert (10101111001.0111)2 into octal.
Solution :
Binary number 10 101 111 001 . 011 1
Group of 3 bits are = 010 101 111 001 . 011 100
Convert each group into octal = 2 5 7 1 . 3 4
The result is (2571.34)8
(c) Binary to Hexadecimal conversion:-
For conversion binary to hexadecimal number the binary numbers starting from the binary point, groups are
made of 4 bits each, on either side of the binary point.
0 0000 8 1000
1 0001 9 1001
2 0010 A 1010
3 0011 B 1011
4 0100 C 1100
5 0101 D 1101
6 0110 E 1110
7 0111 F 1111
For example:
(i) Convert (1011011011)2 into hexadecimal.
Solution:
Given Binary number 10 1101 1011
Group of 4 bits are 0010 1101 1011
Convert each group into hex = 2 D B
The result is (2DB)16
(ii) Convert (01011111011.011111)2 into hexadecimal.
Solution:
Given Binary number 010 1111 1011 . 0111 11
Group of 3 bits are = 0010 1111 1011 . 0111 1100
Convert each group into octal = 2 F B . 7 C
The result is (2FB.7C)16
2. DECIMAL NUMBER SYSTEM:-
For example:
(i) Convert (378.93)10 into octal.
Solution:
8 I 378 0.93 x 8 = 7.44
8 l 47 ― 2 0.44 x 8 = 3.52
8l 5 ― 7 0.52 x 8 = 4.16
0 ― 5 0.16 x 8 = 1.28
For example:
(i) Convert (2598.675)10 into hexadecimal.
Solution:
Remainder
Decimal Hex Hex
16 I 2598 0.675 x 16 = 10.8 A
16 l 162 ― 6 6 0.800 x 16 = 12.8 C
16 l 10 ― 2 2 0.800 x 16 = 12.8 C
0 ― 10 A 0.800 x 16 = 12.8 C
For example:
Convert (367.52)8 into binary.
Solution:
Given Octal number is 3 6 7 . 5 2
Convert each group octal = 011 110 111 . 101 010
to binary
For example: -
Convert (4057.06) 8 to decimal
Solution:
(4057.06) 8 = 4 x 83 + 0 x 82 + 5 x 81 + 7 x 80 + 0 x 8 – 1 + 6 x 8- 2
= 2048 + 0 + 40 + 7 + 0 +0.0937
= (2095. 0937)10
Result is (2095.0937)10
(c) Octal to hexadecimal conversion:-
For conversion of octal to Hexadecimal, first convert the given octal number to binary and then binary
number to hexadecimal.
For example :-
Convert (756.603)8 to hexadecimal.
Solution :-
Given octal no. 7 5 6 . 6 0 3
Convert each octal digit to binary = 111 101 110 . 110 000 011
Group of 4bits are = 0001 1110 1110 . 1100 0001 1000
Convert 4 bits group to hex. = 1 E E . C 1 8
Result is (1EE.C18)16
For example:
Convert (3A9E.B0D)16 into binary.
Solution:
Given Hexadecimal number is 3 A 9 E . B 0 D
Convert each hexadecimal = 0011 1010 1001 1110 . 1011 0000 1101
digit to 4 bit binary
For example: -
Convert (A0F9.0EB)16 to decimal
Solution:
(A0F9.0EB)16 = (10 x 163 )+(0 x 162 )+(15 x 161 ) +( 9 x 160 ) +(0 x 16 – 1) +(14 x 16- 2) +(11 x 16-3)
= 40960 + 0 + 240 + 9 + 0 +0.0546 + 0.0026
= (41209.0572)10
Result is (41209.0572)10
(c) Hexadecimal to Octal conversion:-
For conversion of hexadecimal to octal, first convert the given hexadecimal number to binary and then
binary number to octal.
For example :-
Convert (B9F.AE)16 to octal.
Solution :-
Given hexadecimal no.is B 9 F . A E
Convert each hex. digit to binary = 1011 1001 1111 . 1010 1110
Group of 3 bits are = 101 110 011 111 . 101 011 100
Convert 3 bits group to octal. = 5 6 3 7 . 5 3 4
Result is (5637.534)8
For example :-
100101
+ 1101111
10010100
Result is (10010100)2
2. BINARY SUBTRACTION:-
The binary subtraction rules are as follows
0 - 0 = 0 ; 1 - 1 = 0 ; 1 - 0 = 1 ; 0 - 1 = 1 , with a borrow of 1
For example :-
Substract (111.111)2 from (1010.01)2.
Solution :-
1010.010
- 111 .111
0 0 1 0 .0 1 1
Result is (0010.011)2
3. BINARY MULTIPLICATION:-
The binary multiplication rules are as follows
0x0=0;1x1=1;1x 0=0;0 x1=0
For example :-
1101
x 1 1 0___
0000
1101
+ 1 1 0 1_____
1 0 0 1 1 1 0__
Result is (1001110)2
4. BINARY DIVISION:-
The binary division is very simple and similar to decimal number system. The division by ‘0’ is meaningless.
So we have only 2 rules
0÷1=0
1÷1=1
For example :-
Divide (10110)2 by (110)2.
Solution :-
For example :-
Find (1100)2 1’s complement.
Solution :-
Given 1 1 0 0
1’s complement is 0 0 1 1
Result is (0011)2
For example:-
0 1 0 1 0 0 1 = +41
↑
Sign bit
1 1 0 1 0 0 1 = -41
↑
Sign bit
For example:-
Subtract (10000)2 from (11010)2 using 1’s complement.
Solution:-
11010 11010 = 26
- 10000 => + 0 1 1 1 1 (1’s complement) = - 16
Carry → 1 01001 + 10
+ 1
01010 = +10
Result is +10
2’s COMPLEMENT:-
In 2’s complement subtraction, add the 2’s complement of subtrahend to the minuend. If there is a carry out,
ignore it. If the MSB is 0, the result is positive. If the MSB is 1, the result is negative and is in its 2‘s
complement form. Then take its 2’s complement to get the magnitude in binary.
For example:-
Subtract (1010100)2 from (1010100)2 using 2’s complement.
Solution:-
1010100 1010100 = 84
- 1010100 => + 0 1 0 1 1 0 0 (2’s complement) = - 84_
1 0 0 0 0 0 0 0 ( Ignore the carry) 0
= 0 (result = 0)
Hence MSB is 0. The answer is positive. So it is +0000000 = 0
DIGITAL CODES:-
In practice the digital electronics requires to handle data which may be numeric, alphabets and special
characters. This requires the conversion of the incoming data into binary format before it can be processed.
There is various possible ways of doing this and this process is called encoding. To achieve the reverse of it,
we use decoders.
Non-weighted codes are codes which are not assigned with any weight to each digit position, i.e., each digit
position within the number is not assigned fixed value.
Example:- Excess – 3 (XS -3) code and Gray codes
For example:-
(567)10 is encoded in various 4 bit codes.
Solution:-
Decimal → 5 6 7
8421 code → 0101 0110 0111
6311 code → 0111 1000 1001
5421 code → 1000 0100 1010
BCD ADDITION:-
Addition of BCD (8421) is performed by adding two digits of binary, starting from least significant digit. In case if
the result is an illegal code (greater than 9) or if there is a carry out of one then add 0110(6) and add the
resulting carry to the next most significant.
For example:-
Add 679.6 from 536.8 using BCD addition.
Solution:-
6 7 9.6 0110 0111 1001 . 0110 ( 679.6 in BCD)
+ 5 3 6.8 =>+ 0101 0011 0110 . 1000 (536.8 in BCD)
1 21 6.4 1011 1010 1111 . 1110 ( All are illegal codes)
+ 0110 +0110 +0110 .+0110 ( Add 0110 to each)
0001 0010 0001 0110 . 0100
1 2 1 6 . 4 ( corrected sum = 1216.4)
Result is 1216.4
BCD SUBTRACTION:-
The BCD subtraction is performed by subtracting the digits of each 4 – bit group of the subtrahend from
corresponding 4 – bit group of the minuend in the binary starting from the LSD. If there is no borrow from the
next higher group[ then no correction is required. If there is a borrow from the next group, then 610 (0110) is
subtracted from the difference term of this group.
For example:-
Subtract 147.8 from 206.7 using 8421 BCD code.
Solution:-
2 0 6.7 0010 0000 0110 . 0111 ( 206.7 in BCD)
- 1 4 7.8 =>- 0001 0100 0111 . 1000 (147.8 in BCD)
5 8.9 0000 1011 1110 . 1111 ( Borrows are present)
- 0110 -0110 .- 0110
0101 1000 . 1001
5 8 . 9 ( corrected difference = 58.9)
Result is (58.9)10
EXCESS THREE(XS-3) CODE:-
The Excess-3 code, also called XS-3, is a non- weighted BCD code. This derives it name from the fact that
each binary code word is the corresponding 8421 code word plus 0011(3). It is a sequential code. It is a self
complementing code.
XS-3 ADDITION:-
In XS-3 addition, add the XS-3 numbers by adding the 4 bit groups in each column starting from the LSD. If
there is no carry out from the addition of any of the 4 bit groups, subtract 0011 from the sum term of those
groups. If there is a carry out, add 0011 to the sum term of those groups
For example:-
Add 37 and 28 using XS-3 code.
Solution:-
3 7 0110 1010 ( 37 in XS-3)
+ 2 8 => + 0101 1011 ( 28 in XS-3)
6 5 1011 11010 ( Carry is generated)
+ 1_______ ( Propagate carry)
1100 0101 ( Add 0110 to correct 0101 and
- 0011 +0011 subtract 0011 to correct 1100)
1001 1000 ( Corrected sum in XS-3 = 6510)
XS-3 SUBTRACTION:-
To subtract in XS-3 number by subtracting each 4-bit group of the subtrahend from the corresponding 4-bit
group of the minuend starting from the LSD. If there is no borrow from the next 4-bit group. add 0011 to the
difference term of such groups. If there is a borrow, subtract 0011 from the difference term.
For example :-
. Subtract 175 from 267 using XS-3 code.
Solution :-`
267 0101 1010 1010 ( 267 in XS-3)
-175 => - 0100 1010 1000 ( 175 in XS-3)
092 0000 1111 0010 (Correct 0010 and 0000 by adding 0011 and
+0011 -0011 +0011 correct 1111 by subtracting 0011)
0011 1100 0101 (Corrected difference in XS-3 = 9210 )
ASCII CODE:-
The American Standard Code for Information Interchange (ASCII) pronounced as ‘ASKEE’ is widely used
alphanumeric code. This is basically a 7 bit code. The number of different bit patterns that can be created with
7 bits is 27 = 128 , the ASCII can be used to encode both the uppercase and lowercase characters of the
alphabet (52 symbols) and some special symbols in addition to the 10 decimal digits. It is used extensively
for printers and terminals that interface with small computer systems. The table shown below shows the ASCII
groups.
LSBs MSBs
EBCDIC CODE:-
The Extended Binary Coded Decimal Interchange Code (EBCDIC) pronounced as ‘eb – si- dik’ is an 8 bit
alphanumeric code. Since 28 = 256 bit patterns can be formed with 8 bits. It is used by most large computers
to communicate in alphanumeric data. The table shown below shows the EBCDIC code.
LSD MSD(Hex)
(Hex)
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 NUL DLE DS SP & [ ] \ 0
1 SOH DC1 SOS / a j ~ A J 1
2 STX DC2 FS SYN b k s B K S 2
3 ETX DC3 c l t C L T 3
4 PF RES BYP PN d m u D M U 4
5 HT NL LF RS e n v E N V 5
6 LC BS EOB YC f o w F O W 6
7 DEL IL PRE EOT g p x G P X 7
8 CAN h q y H Q Y 8
9 EM i r z I R Z 9
A SMM CC SM Ø ! I :
B VT . $ , #
C FF IFS DC4 < * % @
D CR IGS ENQ NAK ( ) _ ‘
E SO IRS ACK + ; > =
F SI IUS BEL SUB I ‘ ? ‘
GRAY CODE:-
The gray code is a non-weighted code. It is not a BCD code. It is cyclic code because successive words in this
differ in one bit position only i.e it is a unit distance code.
Gray code is used in instrumentation and data acquisition systems where linear or angular
displacement is measured. They are also used in shaft encoders, I/O devices, A/D converters and other
peripheral equipment.
For example :-
Convert the binary 1001 to the Gray code.
Solution :-`
Binary → 1 0 0 1
Gray → 1 1 0 1
If an n-bit gray number is represented by Gn Gn-1 ------- G1 and its binary equivalent by Bn Bn-1 - - - - - B1,
then binary bits are obtained from Gray bits as follows :
Bn = Gn
Bn-1 = Bn Gn-1
.
.
.
.
B1 = B2 G1
For example :-
Convert the Gray code 1101 to the binary.
Solution :-
Gray → 1 1 0 1
Binary→ 1 0 0 1
The binary code is 1001
LOGIC GATES
LOGIC GATES:-
Logic gates are the fundamental building blocks of digital systems.
There are 3 basic types of gates AND, OR and NOT.
Logic gates are electronic circuits because they are made up of a number of electronic devices and
components.
Inputs and outputs of logic gates can occur only in 2 levels. These two levels are termed HIGH and
LOW, or TRUE and FALSE, or ON and OFF or simply si 1 and 0.
The table which lists all the possible combinations of input variables and the corresponding outputs is
called a truth table.
LEVEL LOGIC:-
A logic in which the voltage levels represents logic 1 and logic 0. Level logic may be positive or neg
negative logic.
Positive Logic:-
A positive logic system is the one in which the higher of the two voltage levels represents the logic 1 and the
lower of the two voltages level represents the logic 0.
Negative Logic:-
A negative logic system is the one in which
which the lower of the two voltage levels represents the logic 1 and the
higher of the two voltages level represents the logic 0.
DIFFERENT TYPES OF LOGIC GATES:-
GATES
NOT GATE (INVERTER):-
A NOT gate, also called and inverter, has only one input and one output.
Itt is a device whose output is always the complement of its input.
The output of a NOT gate is the logic 1 state when its input is in logic 0 state and the logic 0 state when
its inputs is in logic 1 state.
IC No. :- 7404
INPUT OUTPUT
A A
0 1
1 0
Timing Diagram
1 0 0 1
0 1 1 0
AND GATE:-
An AND gate has two or more inputs but only one output.
The output is logic 1 state only
nly when each one of its inputs is at logic 1 state.
The output is logic 0 state even if one of its inputs is at logic 0 state.
IC No.:- 7408
Logic Symbol Truth Table
OUTPUT
A B Q=A . B
0 0 0
Timing Diagram
0 1 0
0 0 1 1
1 0 0
A 1 1 1
0 1 0 1
0 0 0 1
OR GATE:-
An OR gate may have two or more inputs but only one output.
The output is logic 1 state, even if one
on of its input is in logic 1 state.
The output is logic 0 state, only when each one of its inputs is in logic state.
IC No.:- 7432
Logic Symbol Truth Table
INPUT OUTPUT
A B Q=A + B
0 0 0
0 1 1
1 0 1
Timing Diagram 1 1 1
0 0 1 1
0 1 0 1
0 1 1 1
NAND GATE:-
NAND gate is a combination of an AND gate and a NOT gate.
The output is logic 0 when each of the input is logic 1 and for any other co
combination of inputs, the
output is logic 1.
IC No.:- 7400 two input NAND gate
7410 three input NAND gate
7420 four input NAND gate
7430 eight input NAND gate
INPUT OUTPUT
A B Q= A.B
0 0 1
0 1 1
1 0 1
Timing Diagram
1 1 0
0 0 1 1
0 1 0 1
1 1 1 0
NOR GATE:-
NOR gate is a combination of an OR gate and a NOT gate.
The output is logic 1, only when each one of its input is logic 0 and for any other combination of inp
inputs,
the output is a logic 0 level.
INPUT OUTPUT
A B Q= A + B
0 0 1
0 1 0
1 0 0
1 1 0
Timing Diagram
0 0 1 1
0 1 0 1
1 0 0 0
EXCLUSIVE – OR (X-OR)
OR) GATE:-
GATE
An X-OR
OR gate is a two input, one output logic circuit.
The output is logic 1 when one and only one of its two inputs is logic 1. When both the inputs is logic 0
or when both the inputs is logic 1, the output is logic 0.
IC No.:- 7486
INPUT OUTPUT
A B Q=A B
0 0 0
INPUTS are A and B
0 1 1
OUTPUT is Q = A B 1 0 1
=AB+AB 1 1 0
Timing Diagram
0 0 1 1
0 1 0 1
0 1 1 0
IC No.:- 74266
Logic Symbol
INPUT OUTPUT
A B OUT =A XNOR B
0 0 1
0 1 0
1 0 0
OUT =A B + A B
1 1 1
= A XNOR B
Timing Diagram
0 0 1 1
0 1 0 1
1 0 0 1
OUT
UNIVERSAL GATES:-
There are 3 basic gates AND, OR and NOT, there are two universal gates NAND and NOR, each of which can
realize logic circuits single handedly.
dly. The NAND and NOR gates are called universal building blocks. Both
NAND and NOR gates can perform all logic functions i.e. AND, OR, NOT, EXOR and EXNOR.
NAND GATE:-
a) Inverter from NAND gate
Input =A
Output Q = A
NOR GATE:-
a) Inverter from NOR gate
Input =A
Output Q = A
THRESHOLD LOGIC:-
INTRODUCTION:-
The threshold element, nt, also called the threshold gate (T-gate)
(T gate) is a much more powerful device than any
of the conventional logic gates such as NAND, NOR and others.
Complex, large Boolean functions can be realized using much fewer threshold gates.
Frequently a single threshold ld gate can realize a very complex function which otherwise might require a
large number of conventional gates.
T-gate
gate offers incomparably economical realization; it has not found extensive use with the digital system
designers mainly because of the following
follow limitations.
1. It is very sensitive to parameter variations.
2. It is difficult to fabricate it in IC form.
3. The speed of switching of threshold elements in much lower than that of conventional gates.
Example:-
Obtain the minimal Boolean expression from the threshold gate shown in figure.
Solution:-
The threshold gate with three inputs x1, x2, x3 with weights -2(w1) , 4(w2) and 2( w3) respe
respectively. The value of
threshold is 2(T). The table shown is the weighted sums and outputs for all input combinations. For this
threshold gate, the weighted sum is
From the input – output relation is given in the table, the Boolean expression for the output is
F=∑
∑ m (1, 2, 3, 6, 7)
UNIVERSALITY OF A T-GATE
GATE:-
A single T-gate
gate can realize a large number of functions by merely changing either the weights or the
threshold or both, which can be done by altering the value of the corresponding resistors.
Since a threshold gate can realize universal gates, i.e., NAND gates and NOR gates, a threshold gate
is also a universal gate.
Single threshold gate cannot realize by a single T-gate
T
Realization
tion of logic gates using T-gates
T is shown in the below figure.
BOOLEAN ALGEBRA
INTRODUCTION:-
Switching circuits are also called logic circuits, gates circuits and digital circuits.
Switching algebra is also called Boolean algebra.
Boolean algebra is a system of mathematical logic. It is an algebraic system consisting of the set of
elements (0,1), two binary operators called OR and AND and unary operator called NOT.
It is the basic mathematical tool in the analysis and synthesis of switching circuits.
It is a way to express logic functions algebraically.
Any complex logic can be expressed by a Boolean function.
The Boolean algebra is governed by certain well developed rules and laws.
Axioms or postulates of Boolean algebra are set of logical expressions that are accepted without proof and
upon which we can build a set of useful theorems. Actually, axioms are nothing more than the definitions of the
three basic logic operations AND, OR and INVERTER. Each axiom can be interpreted as the outcome of an
operation performed by a logic gate.
1. Complementation Laws:-
The term complement simply means to invert, i.e. to changes 0s to 1s and 1s to 0s. The five laws of
complementation are as follows:
Law 1: 0 = 1
Law 2: 1 = 0
Law 3: if A = 0, then A = 1
Law 4: if A = 1,thenA = 0
Law 5: A = 0 (double complementation law)
2. OR Laws:-
The four OR laws are as follows
Law 1: A + 0 = 0(Null law)
Law 2: A + 1 = 1(Identity law)
Law 3: A + A = A
Law 4: A +A = 1
3. AND Laws:-
The four AND laws are as follows
Law 1: A . 0 = 0(Null law)
Law 2: A . 1 = 1(Identity law)
Law 3: A . A = A
Law 4: A .A = 0
4. Commutative Laws:-
Commutative laws allow change in position of AND or OR variables. There are two commutative laws.
Law 1: A + B = B + A
Proof
A B A+B B A B+ A
0 0 0 0 0 0
0 1 1 = 0 1 1
1 0 1 1 0 1
1 1 1 1 1 1
Law 2: A . B = B . A
Proof
A B A.B B A B. A
0 0 0 0 0 0
0 1 0 = 0 1 0
1 0 0 1 0 0
1 1 1 1 1 1
5. Associative Laws:-
The associative laws allow grouping of variables. There are 2 associative laws.
Law 1: (A + B) + C = A + (B + C)
Proof
0 1 0 1 1 0 1 0 1 1
=
0 1 1 1 1 0 1 1 1 1
1 0 0 1 1 1 0 0 0 1
1 0 1 1 1 1 0 1 1 1
1 1 0 1 1 1 1 0 1 1
1 1 1 1 1 1 1 1 1 1
Proof
A B C AB (AB)C A B C B.C A(B.C)
0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 1 0 0
0 1 0 0 0 0 1 0 0 0
=
0 1 1 0 0 0 1 1 1 0
1 0 0 0 0 1 0 0 0 0
1 0 1 0 0 1 0 1 0 0
1 1 0 1 0 1 1 0 0 0
1 1 1 1 1 1 1 1 1 1
Proof
A B C B+C A(B+C) A B C AB AC A+(B+C)
0 0 0 0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 1 0 0 0
0 1 0 1 0 0 1 0 0 0 0
0 1 1 1 0 = 0 1 1 0 0 0
1 0 0 0 0 1 0 0 0 0 0
1 0 1 1 1 1 0 1 0 1 1
1 1 0 1 1 1 1 0 1 0 1
1 1 1 1 1 1 1 1 1 1 1
Proof
A + AB = (A + A) (A + B)
= 1. (A + B)
= A +B
Law 2: A(A + B) = AB
Proof
A(A + B) = AA + AB
= 0 + AB
= AB
8. Idempotence Laws:-
Idempotence means same value.
Law 1: A. A = A
Proof
If A = 0, then A. A = 0. 0 =0 = A
If A = 1, then A. A = 1. 1 = 1 = A
This law states that AND of a variable with itself is equal to that variable only.
Law 2: A + A = A
Proof
If A = 0, then A + A = 0 + 0 = 0 = A
If A = 1, then A + A = 1 + 1 = 1 = A
This law states that OR of a variable with itself is equal to that variable only.
9. Absorption Laws:-
There are two laws:
Law 1: A + A ∙ B = A A B AB A+AB
Proof
A + A ∙ B = A (1 + B) = A ∙ 1 = A 0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
Law 2: A ( A + B) = A
Proof
A ( A + B) = A ∙ A + A ∙ B = A + AB = A(1 + B) = A ∙ 1 = A
A B A+B A(A+B)
0 0 0 0
0 1 1 0
1 0 1 1
1 1 1 1
Law 1: A + B =A∙ B
Proof
A B A B A B
A B A+B A+B
0 0 0 1 0 0 1 1 1
0 1 1 0 = 0 1 1 0 0
1 0 1 0 1 0 0 1 0
1 1 1 0 1 1 0 0 0
This law states that the complement of a sum of variables is equal to the product of their individual
complements.
Law 2: A∙ B = A + B
Proof
DUALITY:-
The implication of the duality concept is that once a theorem or statement is proved, the dual also thus stand
proved. This is called the principle of duality.
[f (A, B, C,…..,0, 1, +, ∙)]d = f( A, B, C, …., 1, 0, ∙, +)
Relations between complement and dual
fc (A, B, C, …..) = f (A, B, C, …..) = fd (A, B, C,…)
The first relation states that the complement of a function f(A, B, C, …) can be obtained by complementing all
the variables in the dual function fd (A, B, C, …..).
The second relation states that the dual can be obtained by complementing all the literals in
f (A, B, C, ….).
DUALS:-
Given expression Dual
1. 0=1 1=0
2. 0 ∙1 = 0 1+0=1
3. 0 ∙0 = 0 1+1=1
4. 1 ∙1 = 1 0+0=0
5. A∙0=0 A+1=1
6. A∙1=A A+0=A
7. A∙A=A A+A=A
8. A∙A=0 A+A=1
9. A∙B=B∙A A + B = B+ A
10. A ∙ ( B ∙ C)=( A ∙ B) ∙ C A + ( B + C)=( A + B) + C
11. A ∙ (B + C) = AB + AC A + BC = ( A + B) (A + C)
12. A( A + B ) = A A + AB = A
13. A ∙ ( A ∙ B) = A ∙ B A+ A+B=A+B
14. AB = A + B A+B= AB
15. ( A + B) ( A+ C) (B + C) = ( A+ B )(A + C) AB + AC + BC = AB + AC
16. A + BC = ( A + B )(A + C) A( B+ C) = A B +A C
17. (A+C)(A+B) = AB+AC AC+AB=(A+B) (A+C)
18. (A+B)(C+D) = AC + AD + BC + BD (AB+CD) = (A+C)(A+D)(B+C)(B+D)
19. A + B = AB + AB + AB AB =(A+B) (A+B) (A+B)
20. AB + A + AB = 0 A + B ∙ A ∙ (A + B) = 1
The complement of a function expressed as the sum of minterms equals the sum of minterms missing from the
original function.
Example:-
f(A, B, C) = ∑m( 0,2,4,6,7)
This has a complement that can be expressed as
f (A, B, C) =∑ m(1, 3, 5) = m1 + m3 + m5
If we complement f by De- Morgan’s theorem we obtain ‘f’ in a form.
f =(m1+ m3 + m5) = m1. m3. m5
= M1 M3 M5 =∏ M(1, 3 ,5)
Example:-
Expand A (A + B) (A + B + C) to maxterms and minterms.
Solution:-
In POS form
A( A + B) (A + B + C)
A = A + B B + CC
= (A + B) ( A +B) + C∙C
= (A + B + CC) (A + B + C C)
= (A + B + C) (A + B +C) (A + B + C) (A + B + C)
A + B = A + B + C∙C
= (A + B + C) (A + B + C)
Therefore
A( A + B)(A + B + C)
= (A + B + C) (A + B +C) (A + B + C) (A +B +C) (A + B + C) (A + B + C)
= (000) (001) (010) (011) (100) (101)
= M0 ∙ M1 ∙ M2 ∙ M3 ∙ M4 ∙ M5
=∏ M( 0, 1, 2, 3, 4,5)
The maxterms M6 and M7 are missing in the POS form.
So, the SOP form will contain the minterms 6 and 7
KARNAUGH MAP OR K- MAP:-
The K- map is a chart or a graph, composed of an arrangement of adjacent cells, each representing a
particular combination of variables in sum or product form.
The K- map is systematic method of simplifying the Boolean expression.
0 A B AB
A
1 AB AB
Example:-
Map expression f= AB + AB
Solution:-
The expression minterms is
F = m1 + m2 = m( 1, 2)
B
0 1
0 1
0 0 1
A 2 3
1 1 0
Two minterms, which are adjacent to each other, can be combined to form a bigger square called 2 –
square or a pair. This eliminates one variable
variable that is not common to both the minterms.
Two 2-squares
squares adjacent to each other can be combined to form a 4- 4 square. A 44- square eliminates 2
variables. A 4-square
square is called a quad.
Consider only those variables which remain constant throughout the square,
square, and ignore the variables
which are varying. The non-complemented variable is the variable remaining constant as 1.The
complemented variable is the variable remaining constant as a 0 and the variables are written as a
product term.
Example:-
Reduce
ce the expression f= AB + A B + AB using mapping.
Solution:-
Expressed
xpressed in terms of minterms, the given expression is
f = m0 + m1 + m3 = ∑m ( 0, 1, 3)
F=A+B
Example:-
Plot the expression f= (A + B)(A + B)(A + B)
Solution:-
Expression interms of maxterms is f = πM (0, 2, 3)
Example:-
Reduce the expression f = (A + B)(A + B)(A +B ) using mapping
Solution:-
The given expression
ssion in terms of maxterms is f = πM (0, 1, 3)
Example:-
Map the expression f = ABC+ABC + ABC + ABC +ABC
Solution:-
So in the SOP form the expression is f = ∑ m (1, 5, 2, 6, 7)
Example:-
Map the expression f = (A + B + C) (A + B+C) (A + B + C) (A + B + C) (A + B + C)
Solution:-
So in the POS form the expression is f = π M (0, 5, 7, 3, 6)
These possible combinations are also for POS but 1s are replaced by 0s.
SOP FORM
POS FORM
A standard SOP expression with don’t cares can be converted into standard
standard POS form by keeping the
don’t cares as they are, and the missing minterms of the SOP form are written as the maxterms of the POS
form. Similarly, to convert a standard POS expression with don’t cares can be converted into standard SOP
form by keeping thehe don’t cares as they are, and the missing maxterms of the POS form are written as the
minterms of the SOP form.
Example:-
Reduce the expression f = ∑ m(1, 5, 6, 12, 13, 14) + d(2, 4) using K-K map.
Solution:-
The given expression in SOP form is f = ∑ m (1, 5, 6, 12, 13, 14) + d(2, 4)
The given expression in POS form is f = π M (0, 3, 7, 8, 9, 10, 11,15) + d(2, 4)
It is a circuit whose output depends upon the present input, previous output and the sequence in which
the inputs are applied.
In combinational circuit output depends upon present input at any instant of time and do not use
memory. Hence previous input does not have any effect on the circuit. But sequential circuit has
memory and depends upon present input and previous output.
Sequential circuits are slower than combinational circuits and these sequential circuits are harder to
design.
SEQUENTIAL LOGIC
Input Output
CIRCUIT
MEMORY
Clock
The data stored by the memory element at any given instant of time is called the present state of
sequential circuit.
TYPES:-
A flip-flop or latch is a circuit that has two stable states and can be used to store information.
A flip-flop is a binary storage device capable of storing one bit of information. In a stable state, the
output of a flip-flop is either 0 or 1.
Latch is a non-clocked flip-flop and it is the building block for the flip-flop.
A storage element in digital circuit can maintain a binary state indefinitely until directed by an input
signal to switch state.
Storage element that operate with signal level are called latches and those operate with clock transition
are called as flip-flops.
The circuit can be made to change state by signals applied to one or more control inputs and will have
one or two outputs.
A flip-flop is called so because its output either flips or flops meaning to switch back and forth.
A flip-flop is also called a bi-stable multi-vibrator as it has two stable states. The input signals which
command the flip-flop to change state are called excitations.
Flip-flops are storage devices and can store 1 or 0.
Flip-flops using the clock signal are called clocked flip-flops. Control signals are effective only if they are
applied in synchronization with the clock signal.
Clock-signals may be positive-edge triggered or negative-edge triggered.
Positive-edge triggered flip-flops are those in which state transitions take place only at positive- going
edge of the clock pulse.
Negative-edge triggered flip-flops are those in which state transition take place only at negative- going
edge of the clock pulse.
SR latch:-
The SR latch is a circuit with two cross-coupled NOR gates or two cross-coupled NAND gates.
It has two outputs labeled Q and Q’. Two inputs are there labeled S for set and R foe reset.
The latch has two useful states. When Q=0 and Q’=1 the condition is called reset state and when Q=1
and Q’=0 the condition is called set state.
Normally Q and Q’ are complement of each other.
The figure represents a SR latch with two cross-coupled NOR gates. The circuit has NOR gates and as
we know if any one of the input for a NOR gate is HIGH then its output will be LOW and if both the
inputs are LOW then only the output will be HIGH.
Under normal conditions, both inputs of the latch remain at 0 unless the state has to be changed. The
application of a momentary 1 to the S input causes the latch to go to the set state. The S input must go
back to 0 before any other changes take place, in order to avoid the occurrence of an undefined next
state that results from the forbidden input condition.
The first condition (S = 1, R = 0) is the action that must be taken by input S to bring the circuit to the set
state. Removing the active input from S leaves the circuit in the same state. After both inputs return to
0, it is then possible to shift to the reset state by momentary applying a 1 to the R input. The 1 can then
be removed from R, whereupon the circuit remains in the reset state. When both inputs S and R are
equal to 0, the latch can be in either the set or the reset state, depending on which input was most
recently a 1.
If a 1 is applied to both the S and R inputs of the latch, both outputs go to 0. This action produces an
undefined next state, because the state that results from the input transitions depends on the order in
which they return to 0. It also violates the requirement that outputs be the complement of each other. In
normal operation, this condition is avoided by making sure that 1’s are not applied to both inputs
simultaneously.
Truth table for SR latch designed with NOR gates is shown below.
Racing Condition:-
In case of a SR latch when S=R=1 input is given both the output will try to become 0. This is called
Racing condition.
The condition that is forbidden for the NAND latch is both inputs being equal to 0 at the same time, an
input combination that should be avoided.
In comparing the NAND with the NOR latch, note that the input signals for the NAND require the complement
of those values used for the NOR latch. Because the NAND latch requires a 0 signal to change its state, it iis
sometimes referred to as an S’R’ latch. The primes (or, sometimes, bars over the letters) designate the fact
that the inputs must be in their complement form to activate the circuit.
The above represents the symbol for inverted SR latch or SR latch using NAND gate.
Truth table for SR latch using NAND gate or Inverted SR latch
S R Qnext Q’next
0 0 Race Race
0 1 0 1 (Reset)
1 0 1 0 (Set)
1 1 Q (No change) Q’ (No change)
D LATCH:-
One way to eliminate the undesirable condition of the indeterminate
indeterminate state in the SR latch is to ensure
that inputs S and R are never equal to 1 at the same time.
This is done in the D latch. This latch has only two inputs: D (data) and En (enable).
The D input goes directly to the S input, and its complement is applied
applied to the R input.
En D Next State of Q
0 X No change
1 0 Q=0;Reset State
1 1 Q=1;Set State
The D input is sampled when En = 1. If D = 1, the Q output goes to 1, placing the circuit in the set state.
If D = 0, output Q goes to 0, placing the circuit in the reset state. This situation provides a path from
input D to the output, and for this reason, the circuit is often called a TRANSPARENT latch.
TRIGGERING METHODS:-
The state of a latch or flip-flop is switched by a change in the control input. This momentary change is
called a trigger, and the transition it causes is said to trigger the flip-flop.
Flip-flop circuits are constructed in such a way as to make them operate properly when they are part of
a sequential circuit that employs a common clock.
The problem with the latch is that it responds to a change in the level of a clock pulse. For proper
operation of a flip-flop it should be triggered only during a signal transition.
This can be accomplished by eliminating the feedback path that is inherent in the operation of the
sequential circuit using latches. A clock pulse goes through two transitions: from 0 to 1 and the return
from 1 to 0.
A ways that a latch can be modified to form a flip-flop is to produce a flip-flop that triggers only during a
signal transition (from 0 to 1 or from 1 to 0) of the synchronizing signal (clock) and is disabled during the
rest of the clock pulse.
JK FLIP-FLOP:-
The JK flip-flop can be constructed by using basic SR latch and a clock. In this case the outputs Q and
Q’ are returned back and connected to the inputs of NAND gates.
This simple JK flip Flop is the most widely used of all the flip-flop designs and is considered to be a
universal flip-flop circuit.
The sequential operation of the JK flip flop is exactly the same as for the previous SR flip-flop with the
same “Set” and “Reset” inputs.
The difference this time is that the “JK flip flop” has no invalid or forbidden input states of the SR Latch
even when S and R are both at logic “1”.
(The below diagram shows the circuit diagram of a JK flip-flop)
The JK flip flop is basically a gated SR Flip-flop with the addition of a clock input circuitry that prevents
the illegal or invalid output condition that can occur when both inputs S and R are equal to logic level
“1”.
Due to this additional clocked input, a JK flip-flop has four possible input combinations, “logic 1”, “logic
0”, “no change” and “toggle”.
When both inputs J and K are equal to logic “1”, the JK flip flop toggles.
t
T FLIP-FLOP:-
Toggle flip-flop
flop or commonly known as T flip-flop.
flip
This flip-flop
flop has the similar operation as that of the JK flip-flop
flip flop with both the inputs J and K are shorted
i.e. both are given the common input.
T Q Qnext Comment
0 0 0 No change
1 1
1 0 1 Toggles
1 0
CHARACTERISTIC TABLE:-
A characteristic table defines the logical properties of a flip-flop by describing its operation in tabular
form.
The next state is defined as a function of the inputs and the present state.
Q (t) refers to the present state and Q (t + 1) is the next.
Thus, Q (t) denotes the state of the flip-flop immediately before the clock edge, and Q(t + 1) denotes the
state that results from the clock transition.
The characteristic table for the JK flip-flop shows that the next state is equal to the present state when
inputs J and K are both equal to 0. This condition can be expressed as Q (t + 1) = Q (t), indicating that
the clock produces no change of state.
Characteristic Table Of JK Flip-Flop
J K Q(t+1)
0 0 Q(t) No change
0 1 0 Reset
1 0 1 Set
1 1 Q’(t) Complement
When K = 1 and J = 0, the clock resets the flip-flop and Q(t + 1) = 0. With J = 1 and K = 0, the flip-flop
sets and Q(t + 1) = 1. When both J and K are equal to 1, the next state changes to the complement of
the present state, a transition that can be expressed as Q(t + 1) = Q’(t).
The characteristic equation for JK flip-flop is represented as
Q(t+1)= JQ’ + K’Q
D Q(t+1)
0 0
1 1
The next state of a D flip-flop is dependent only on the D input and is independent of the present state.
This can be expressed as Q (t + 1) = D. It means that the next-state value is equal to the value of D.
Note that the D flip-flop does not have a “no-change” condition and its characteristic equation is written
as Q(t+1)=D.
T Q(t+1)
0 Q(t) No change
1 Q’(t) Complement
The characteristic table of T flip-flop has only two conditions: When T = 0, the clock edge does not
change the state; when T = 1, the clock edge complements the state of the flip-flop and the
characteristic equation is
MASTER-SLAVE JK FLIP-FLOP:-
The Master-Slave Flip-Flop is basically two gated SR flip-flops connected together in a series
configuration with the slave having an inverted clock pulse.
The outputs from Q and Q’ from the “Slave” flip-flop are fed back to the inputs of the “Master” with the
outputs of the “Master” flip flop being connected to the two inputs of the “Slave” flip flop.
This feedback configuration from the slave’s output to the master’s input gives the characteristic toggle
of the JK flip flop as shown below.
The input signals J and K are connected to the gated “master” SR flip flop which “locks” the input
condition while the clock (Clk) input is “HIGH” at logic level “1”.
As the clock input of the “slave” flip flop is the inverse (complement) of the “master” clock input, the
“slave” SR flip flop does not toggle.
The outputs from the “master” flip flop are only “seen” by the gated “slave” flip flop when the clock input
goes “LOW” to logic level “0”.
When the clock is “LOW”, the outputs from the “master” flip flop are latched and any additional
changes to its inputs are ignored.
The gated “slave” flip flop now responds to the state of its inputs passed over by the “master” section.
Then on the “Low-to-High” transition of the clock pulse the inputs of the “master” flip flop are fed
through to the gated inputs of the “slave” flip flop and on the “High-to-Low” transition the same inputs
are reflected on the output of the “slave” making this type of flip flop edge or pulse-triggered.
Then, the circuit accepts input data when the clock signal is “HIGH”, and passes the data to the output
on the falling-edge of the clock signal.
In other words, the Master-Slave JK Flip flop is a “Synchronous” device as it only passes data with the
timing of the clock signal.
FLIP-FLOP CONVERSIONS:-
For this J and K will be given as external inputs to S and R. As shown in the logic diagram below, S and R will
be the outputs of the combinational circuit.
The truth tables for the flip flop conversion are given below. The present state is represented by Qp and Qp+1
is the next state to be obtained when the J and K inputs are applied.
For two inputs J and K, there will be eight possible combinations. For each combination of J, K and Qp, the
corresponding Qp+1 states are found. Qp+1 simply suggests the future values to be obtained by the JK flip flop
after the value of Qp. The table is then completed by writing the values of S and R required to get each Qp+1
from the corresponding Qp. That is, the values of S and R that are required to change the state of the flip flop
from Qp to Qp+1 are written.
This will be the reverse process of the above explained conversion. S and R will be the external inputs
to J and K. J and K will be the outputs of the combinational circuit. Thus, the values of J and K have to
be obtained in terms of S, R and Qp.
A conversion table is to be written using S, R, Qp, Qp+1, J and K.
For two inputs, S and R, eight combinations are made. For each combination, the corresponding Qp+1
outputs are found out.
The outputs for the combinations of S=1 and R=1 are not permitted for an SR flip flop. Thus the outputs
are considered invalid and the J and K values are taken as “don’t cares”.
S and R are the actual inputs of the flip flop and D is the external input of the flip flop.
The four combinations, the logic diagram, conversion table, and the K-map for S and R in terms of D
and Qp are shown below.
D is the actual input of the flip flop and S and R are the external inputs. Eight possible combinations are
achieved from the external inputs S, R and Qp.
But, since the combination of S=1 and R=1 are invalid, the values of Qp+1 and D are considered as
“don’t cares”.
The logic diagram showing the conversion from D to SR, and the K-map for D in terms of S, R and Qp
are shown below.
J and K are the actual inputs of the flip flop and T is taken as the external input for conversion
Four combinations are produced with T and Qp. J and K are expressed in terms of T and Qp.
The conversion table, K-maps, and the logic diagram are given below.
In this conversion, D is the actual input to the flip flop and J and K are the external inputs.
J, K and Qp make eight possible combinations, as shown in the conversion table below. D is
expressed in terms of J, K and Qp.
The conversion table, the K-map for D in terms of J, K and Qp and the logic diagram showing the
conversion from D to JK are given in the figure below.
D is the external input and J and K are the actual inputs of the flip flop. D and Qp make four
combinations. J and K are expressed in terms of D and Qp.
The four combination conversion table, the K-maps for J and K in terms of D and Qp.
BINARY ADDER–SUBTRACTOR:-
Digital computers perform a variety of information-processing tasks. Among the functions encountered
are the various arithmetic operations.
The most basic arithmetic operation is the addition of two binary digits. This simple addition consists of
four possible elementary operations: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10.
The first three operations produce a sum of one digit, but when both augend and addend bits are equal
to 1; the binary sum consists of two digits. The higher significant bit of this result is called a carry.
When the augend and addend numbers contain more significant digits, the carry obtained from the
addition of two bits is added to the next higher order pair of significant bits.
A combinational circuit that performs the addition of two bits is called a half adder.
One that performs the addition of three bits (two significant bits and a previous carry) is a full adder. The
names of the circuits stem from the fact that two half adders can be employed to implement a full adder.
HALF ADDER:-
This circuit needs two binary inputs and two binary outputs.
The input variables designate the augend and addend bits; the output variables produce the sum and
carry. Symbols x and y are assigned to the two inputs and S (for sum) and C (for carry) to the outputs.
The truth table for the half adder is listed in the below table.
The C output is 1 only when both inputs are 1. The S output represents the least significant bit of the
sum.
The simplified Boolean functions for the two outputs can be obtained directly from the truth table.
FULL ADDER:-
A full adder is a combinational circuit that forms the arithmetic sum of three bits.
It consists of three inputs and two outputs. Two of the input variables, denoted by x and y , represent
the two significant bits to be added. The third input, z , represents the carry from the previous lower
significant position.
Two outputs are necessary because the arithmetic sum of three binary digits ranges in value from 0 to
3, and binary representation of 2 or 3 needs two bits. The two outputs are designated by the symbols S
for sum and C for carry.
The binary variable S gives the value of the least significant bit of the sum. The binary variable C gives
the output carry formed by adding the input carry and the bits of the words.
The eight rows under the input variables designate all possible combinations of the three variables. The
output variables are determined from the arithmetic sum of the input bits. When all input bits are 0, the
output is 0.
The S output is equal to 1 when only one input is equal to 1 or when all three inputs are equal to 1. The
C output has a carry of 1 if two or three inputs are equal to 1.
The simplified expressions are
S = x’y’z + x’yz’ + xy’z’ + xyz
C = xy + xz + yz
The logic diagram for the full adder implemented in sum-of-products form is shown in figure.
It can also be implemented with two half adders and one OR gate as shown in the figure.
A full adder is a combinational circuit that forms the arithmetic sum of three bits.
BINARY ADDER:-
A binary adder is a digital circuit that produces the arithmetic sum of two binary numbers.
It can be constructed with full adders connected in cascade, with the output carry from each full adder
connected to the input carry of the next full adder in the chain.
Addition of n-bit numbers requires a chain of n full adders or a chain of one-half adder and n-1 full
adders. In the former case, the input carry to the least significant position is fixed at 0.
The interconnection of four full-adder (FA) circuits to provide a four-bit binary ripple carry adder is
shown in the figure.
The augend bits of A and the addend bits of B are designated by subscript numbers from right to left,
with subscript 0 denoting the least significant bit.
The carries are connected in a chain through the full adders. The input carry to the adder is C0, and it
ripples through the full adders to the output carry C4. The S outputs generate the required sum bits.
An n -bit adder requires n full adders, with each output carry connected to the input carry of the next
higher order full adder.
Consider the two binary numbers A = 1011 and B = 0011. Their sum S = 1110 is formed with the four-
bit adder as follows:
The bits are added with full adders, starting from the least significant position (subscript 0), to form the
sum bit and carry bit. The input carry C0 in the least significant position must be 0.
The value of Ci+1 in a given significant position is the output carry of the full adder. This value is
transferred into the input carry of the full adder that adds the bits one higher significant position to the
left.
The sum bits are thus generated starting from the rightmost position and are available as soon as the
corresponding previous carry bit is generated. All the carries must be generated for the correct sum bits
to appear at the outputs.
HALF SUBTRACTOR:-
This circuit needs two binary inputs and two binary outputs.
Symbols x and y are assigned to the two inputs and D (for difference) and B (for borrow) to the outputs.
The truth table for the half subtractor is listed in the below table.
The B output is 1 only when the inputs are 0 and 1. The D output represents the least significant bit of
the subtraction.
The subtraction operation is done by using the following rules as
0-0=0;
0-1=1 with borrow 1;
1-0=1;
1-1=0.
The simplified Boolean functions for the two outputs can be obtained directly from the truth table. The
simplified sum-of-products expressions are
D = x’y + xy’ and B =x’y
The logic diagram of the half adder implemented in sum of products is shown in the figure. It can be
also implemented with an exclusive-OR and an AND gate with one inverted input.
FULL SUBTRACTOR:-
A full subtractor is a combinational circuit that forms the arithmetic subtraction operation of three bits.
It consists of three inputs and two outputs. Two of the input variables, denoted by x and y , represent
the two significant bits to be subtracted. The third input, z , is subtracted from the result 0f the first
subtraction.
Two outputs are necessary because the arithmetic subtraction of three binary digits ranges in value
from 0 to 3, and binary representation of 2 or 3 needs two bits. The two outputs are designated by the
symbols D for difference and B for borrow.
The binary variable D gives the value of the least significant bit of the difference. The binary variable B
gives the output borrow formed during the subtraction process.
The eight rows under the input variables designate all possible combinations of the three variables. The
output variables are determined from the arithmetic subtraction of the input bits.
The difference D becomes 1 when any one of the input is 1or all three inputs are equal to1 and the
borrow B is 1 when the input combination is (0 0 1) or (0 1 0) or (0 1 1) or (1 1 1).
The simplified expressions are
D = x’y’z + x’yz’ + xy’z’ + xyz
B = x’z + x’y + yz
The logic diagram for the full adder implemented in sum-of-products form is shown in figure.
MAGNITUDE COMPARATOR:-
A magnitude comparator is a combinational circuit that compares two numbers A and B and determines
their relative magnitudes.
The following description is about a 2-bit magnitude comparator circuit.
The outcome of the comparison is specified by three binary variables that indicate whether A < B, A =
B, or A > B.
Consider two numbers, A and B, with two digits each. Now writing the coefficients of the numbers in
descending order of significance:
A = A1 A0
B = B1 B0
The two numbers are equal if all pairs of significant digits are equal i.e. if and only if A1 = B1, and A0 =
B0.
When the numbers are binary, the digits are either 1 or 0, and the equality of each pair of bits can be
expressed logically with an exclusive-NOR function as
x1=A1B1+A1’B1’
And x0=A0B0+A0’B0’
The equality of the two numbers A and B is displayed in a combinational circuit by an output binary
variable that we designate by the symbol (A = B).
This binary variable is equal to 1 if the input numbers, A and B , are equal, and is equal to 0 otherwise.
For equality to exist, all xi variables must be equal to 1, a condition that dictates an AND operation of all
variables:
(A = B) = x1x0
The binary variable (A = B) is equal to 1 only if all pairs of digits of the two numbers are equal.
To determine whether A is greater or less than B, we inspect the relative magnitudes of pairs of
significant digits, starting from the most significant position. If the two digits of a pair are equal, we
compare the next lower significant pair of digits. If the corresponding digit of A is 1 and that of B is 0, we
conclude that A > B. If the corresponding digit of A is 0 and that of B is 1, we have A < B. The
sequential comparison can be expressed logically by the two Boolean functions
(A > B) = A1B1’+x1A0B’0
(A < B) = A1’ B1 +x1A0’B0’
DECODER:-
A decoder is a combinational circuit that converts binary information from n input lines to a maximum of
2n unique output lines.
If the n -bit coded information has unused combinations, the decoder may have fewer than 2n outputs.
The decoders presented here are called n -to- m -line decoders, where m … 2n.
Their purpose is to generate the 2n (or fewer) minterms of n input variables.
Each combination of inputs will assert a unique output. The name decoder is also used in conjunction
with other code converters, such as a BCD-to-seven-segment decoder.
Consider the three-to-eight-line decoder circuit of three inputs are decoded into eight outputs, each
representing one of the minterms of the three input variables.
The three inverters provide the complement of the inputs, and each one of the eight AND gates
generates one of the minterms.
The input variables represent a binary number, and the outputs represent the eight digits of a number in
the octal number system.
However, a three-to-eight-line decoder can be used for decoding any three-bit code to provide eight
outputs, one for each element of the code.
A two-to-four-line decoder with an enable input constructed with NAND gates is shown in Fig.
The circuit operates with complemented outputs and a complement enable input. The decoder is
enabled when E is equal to 0 (i.e., active-low enable). As indicated by the truth table, only one output
can be equal to 0 at any given time; all other outputs are equal to 1.
The output whose value is equal to 0 represents the minterm selected by inputs A and B.
The circuit is disabled when E is equal to 1, regardless of the values of the other two inputs.
When the circuit is disabled, none of the outputs are equal to 0 and none of the minterms are selected.
In general, a decoder may operate with complemented or un-complemented outputs.
The enable input may be activated with a 0 or with a 1 signal.
Some decoders have two or more enable inputs that must satisfy a given logic condition in order to
enable the circuit.
A decoder with enable input can function as a demultiplexer— a circuit that receives information from a
single line and directs it to one of 2n possible output lines.
The selection of a specific output is controlled by the bit combination of n selection lines.
The decoder of Fig. can function as a one-to-four-line demultiplexer when E is taken as a data input line
and A and B are taken as the selection inputs.
The single input variable E has a path to all four outputs, but the input information is directed to only
one of the output lines, as specified by the binary combination of the two selection lines A and B .
This feature can be verified from the truth table of the circuit.
For example, if the selection lines AB = 10, output D2 will be the same as the input value E, while all
other outputs are maintained at 1.
Since decoder and demultiplexer operations are obtained from the same circuit, a decoder with an
enable input is referred to as a decoder – demultiplexer.
A application of this decoder is binary-to-octal conversion.
ENCODER:-
An encoder is a digital circuit that performs the inverse operation of a decoder.
An encoder has 2n (or fewer) input lines and n output lines.
The output lines, as an aggregate, generate the binary code corresponding to the input value.
The above Encoder has eight inputs (one for each of the octal digits) and three outputs that generate
the corresponding binary number.
It is assumed that only one input has a value of 1 at any given time.
The encoder can be implemented with OR gates whose inputs are determined directly from the truth
table.
Output z is equal to 1 when the input octal digit is 1, 3, 5, or 7.
Output y is 1 for octal digits 2, 3, 6, or 7, and output x is 1 for digits 4, 5, 6, or 7.
These conditions can be expressed by the following Boolean output functions:
z = D1 + D3 + D5 + D7
y = D2 + D3 + D6 + D7
x = D4 + D5 + D6 + D7
The encoder can be implemented with three OR gates.
The encoder defined above has the limitation that only one input can be active at any given time.
If two inputs are active simultaneously, the output produces an undefined
combination.
To resolve this ambiguity, encoder circuits must establish an input priority to ensure that only one input
is encoded which is done in the Priority Encoder .
PRIORITY ENCODER:-
In addition to the two outputs x and y , the circuit has a third output designated by V ; this is a valid bit
indicator that is set to 1 when one or
more inputs are equal to 1.
Higher the subscript number, the higher the priority of the input.
Input D3 has the highest priority, so, regardless of the values of the other
inputs, when this input is 1, the output for xy is 11 (binary 3).
If D2 = 1, provided that D3 = 0, regardless of the values of the other two lower priority inputs the output
is 10.
The output for D1 is generated only if higher priority inputs are 0, and so on down the priority levels.
The maps for simplifying outputs x and y are shown in above Fig.
The minterms for the two functions are derived from its truth table.
Although the table has only five rows, when each X in a row is replaced first by 0 and then by 1, we
obtain all 16 possible input combinations.
For example, the fourth row in the table, with inputs XX10, represents the four minterms 0010, 0110,
1010, and 1110. The simplified Boolean expressions for the priority encoder are obtained from the
maps.
The condition for output V is an OR function of all the input variables.
The priority encoder is implemented according to the following Boolean functions:
x = D2 + D3
y = D3 + D1 D’2
V = D0 + D1 + D2 + D3
MULTIPLEXER:-
A 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 lines and n selection lines whose bit combinations determine which input is
selected.
A four-to-one-line multiplexer is shown in the below figure. Each of the four inputs, I0 through I3, is
applied to one input of an AND gate.
Selection lines S1 and S0 are decoded to select a particular AND gate. The outputs of the AND gates
are applied to a single OR gate that provides the one-line output.
The function table lists the input that is passed to the output for each combination of the binary selection
values.
To demonstrate the operation of the circuit, consider the case when
S1S0= 10.
The AND gate associated with input I2 has two of its inputs equal to 1 and the third input connected to
I2.
The other three AND gates have at least one input equal to 0, which makes their outputs equal to 0.
The output of the OR gate is now equal to the value of I2, providing a path from the selected input to
the output.
A multiplexer is also called a data selector, since it selects one of many inputs and steers the binary
information to the output line.
DEMULTIPLEXER:-
The data distributor, known more commonly as a Demultiplexer or “Demux” for short, is the exact
opposite of the Multiplexer.
The demultiplexer takes one single input data line and then switches it to any one of a number of
individual output lines one at a time. The demultiplexer converts a serial data signal at the input to a
parallel data at its output lines as shown below.
The Boolean expression for this 1-to-4 demultiplexer above with outputs A to D and data select lines a,
b is given as:
The function of the demultiplexer is to switch one common data input line to any one of the 4 output
data lines A to D in our example above. As with the multiplexer the individual solid state switches are
selected by the binary input address code on the output select pins “a” and “b” as shown.
Unlike multiplexers which convert data from a single data line to multiple lines and demultiplexers which
convert multiple lines to a single data line, there are devices available which convert data to and from
multiple lines and in the next tutorial about combinational logic devices.
Standard demultiplexer IC packages available are the TTL 74LS138 1 to 8-output demultiplexer, the
TTL 74LS139 Dual 1-to-4 output demultiplexer or the CMOS CD4514 1-to-16 output demultiplexer.
LOGIC FAMILIES
A circuit configuration or approach used to produce a type of digital integrated circuit is called Logic
Family.
By using logic families we can generate different logic functions, when fabricated in the form of an IC
with the same approach, or in other words belonging to the same logic family, will have identical
electrical characteristics.
The set of digital ICs belonging to the same logic family are electrically compatible with each other.
Some common Characteristics of the Same Logic Family include Supply voltage range, speed of
response, power dissipation, input and output logic levels, current sourcing and sinking capability, fan-
out, noise margin, etc.
Choosing digital ICs from the same logic family guarantees that these ICs are compatible with respect
to each other and that the system as a whole performs the intended logic function.
TYPES OF LOGIC FAMILY:-
The entire range of digital ICs is fabricated using either bipolar devices or MOS devices or a
combination of the two.
Bipolar families include:-
Diode logic (DL)
Resistor-Transistor logic (RTL)
Diode-transistor logic (DTL)
Transistor- Transistor logic (TTL)
Emitter Coupled Logic (ECL),
(also known as Current Mode Logic(CML))
Integrated Injection logic (I2L)
The Bi-MOS logic family uses both bipolar and MOS devices.
DC Supply Voltage:-
The nominal value of the dc supply voltage for TTL (transisitor-transistor
logic) and CMOS (complementary metal-oxide semiconductor) devices is
+5V. Although ommitted from logic diagrams for simplicity, this voltage
is connected to Vcc or VDD pin of an IC package and ground is
connected to the GND pin.
Noise Immunity:-
Noise is the unwanted voltage that is induced in electrical circuits and can present a threat to the poor
operation of the circuit. In order not to be adversely effected by noise, a logic circuit must have a certain
amount of 'noise immunity'.
This is the ability to tolerate a certain amount of unwanted voltage fluctuation on its inputs without
changing its output state is called Noise Immunity.
Noise Margin:-
A measure of a circuit's noise immunity is called 'noise margin' which is expressed in volts.
There are two values of noise margin specified for a given logic circuit: the HIGH (VNH) and LOW (VNL)
noise margins.
These are defined by following equations :
VNH = VOH (Min) - VIH (Min) VNL = VIL (Max) - VOL (Max)
Power Dissipation:-
A logic gate draws ICCH current from the supply when the gate is in the HIGH output state, draws ICCL
current from the supply in the LOW output state.
Average power is
PD = VCC ICC where ICC = (ICCH + ICCL) / 2
Propagation Delay time:-
When a signal passes ( propagates ) through a logic circuit, it always experiences a time delay as
shown below. A change in the output level always occurs a short time, called 'propagation delay time' ,
later than the change in the input level that caused it.
Fan Out of Gates:-
When the output of a logic gate is connected to one or more inputs of other gates, a load on the driving
gate is created. There is a limit to the number of load gates that a given gate can drive. This limit is
called the 'Fan-Out' of the gate.
TRANSISTOR-TRANSISTOR LOGIC:-
In Transistor-Transistor logic or just TTL, logic gates are built only around transistors.
TTL was developed in 1965. Through the years basic TTL has been improved to meet performance
requirements. There are many versions or families of TTL.
For example
Standard TTL
High Speed TTL (twice as fast, twice as much power)
Low Power TTL (1/10 the speed, 1/10 the power of “standard" TTL)
Schhottky TTL etc. (for high-frequency uses )
All TTL logic families have three configurations for outputs
1. Totem pole output
2. Open collector output
3. Tristate output
Transistor Q1 is a two-emitter NPN transistor, which is equivalent two NPN transistors with their base
and emitter terminals tied together.
The two emitters are the two inputs of the NAND gate
In TTL technology multiple emitter transistors are used for the input devices
Diodes D2 and D3 are protection diodes used to limit negative input voltages.
When there is large negative voltage at input, the diode conducts and shorting it to the ground Q2
provides complementary voltages for the output transistors Q3 and Q4.
The combination of Q3 and Q4 forms the output circuit often referred to as a totem pole arrangement
(Q4 is stacked on top of Q3). In such an arrangement, either Q3 or Q4 conducts at a time depending
upon the logic status of the inputs
Diode D1 ensures that Q4 will turn off when Q2 is on (HIGH input)
The output Y is taken from the top of Q3
An open-collector output can present a logic LOW output. Since there is no internal path from the
output Y to the supply voltage VCC , the circuit cannot present a logic HIGH on its own.
Advantages of Open Collector Outputs:-
Open-collector outputs can be tied directly together which results in the logical ANDing of the outputs.
Thus the equivalent of an AND gate can be formed by simply connecting the outputs.
Increased current levels - Standard TTL gates with totem-pole outputs can only provide a HIGH current
output of 0.4 mA and a LOW current of 1.6 mA. Many open-collector gates have increased current
ratings.
Different voltage levels - A wide variety of output HIGH voltages can be achieved using open-collector
gates. This is useful in interfacing different logic families that have different voltage and current level
requirements.
Disadvantage of open-collector gates:-
They have slow switching speed. This is because the value of pull-up resistor is in kW, which results in
a relatively long time Constants
For the symbol and truth table, IN is the data input, and EN, the additional enable input for control. For
EN = 0, regardless of the value on IN(denoted by X), the output value is Hi-Z. For EN = 1, the output
value follows the input value.
Data input, IN, can be inverted. Control input, EN, can be inverted by addition of "bubbles" to signals IN
OUT EN.
This requires two inputs: input and enable EN is to make output Hi-Z or follow input.
STANDARD TTL NAND GATE:
CMOS TECHNOLOGY:-
MOS stands for Metal Oxide Semiconductor and this technology uses FETs.
MOS can be classified into three sub-families:
PMOS (P-channel)
NMOS (N-channel)
CMOS (Complementary MOS, most common)
The following simplified symbols are used to represent MOSFET transistors in most CMOS. The gate
of a MOS transistor controls the flow of the current between the drain and the source. The MOS
transistor can be viewed as a simple ON/OFF switch.
Advantages of MOS Digital ICs:-
They are simple and inexpensive to fabricate.
Can be used for Higher integration and consume little power.
Disadvantages of MOS Digital ICs:-
There is possibility for Static-electricity damage.
They are slower than TTL.
COUNTER
A counter is a device which stores (and sometimes displays) the number of times a particular event or
process has occurred. In electronics, counters can be implemented quite easily using register-type
circuits.
There are different types of counters, viz.
Synchronous counter
Synchronous counters can also be implemented with hardware finite state machines, which are more
complex but allow for smoother, more stable transitions.
Asynchronous Counter
An asynchronous (ripple) counter is a single d-type flip-flop, with its J (data) input fed from its own
inverted output.
This circuit can store one bit, and hence can count from zero to one before it overflows (starts over from
0).
This counter will increment once for every clock cycle and takes two clock cycles to overflow, so every
cycle it will alternate between a transition from 0 to 1 and a transition from 1 to 0.
This creates a new clock with a 50% duty cycle at exactly half the frequency of the input clock.
If this output is then used as the clock signal for a similarly arranged D flip-flop, remembering to invert
the output to the input, one will get another 1 bit counter that counts half as fast. These together yield a
two-bit counter.
Additional flip-flops can be added, by always inverting the output to its own input, and using the output
n
from the previous flip-flop as the clock signal. The result is called a ripple counter, which can count to 2
– 1, where n is the number of bits (flip-flop stages) in the counter.
Ripple counters suffer from unstable outputs as the overflows "ripple" from stage to stage, but they find
application as dividers for clock signals.
Modulus Counter
A modulus counter is that which produces an output pulse after a certain number of input pulses is
applied.
In modulus counter the total count possible is based on the number of stages, i.e., digit positions.
Up/Down Counter
In a synchronous up-down binary counter the flip-flop in the lowest-order position is complemented with
every pulse.
A flip-flop in any other position is complemented with a pulse, provided all the lower-order pulse equal
to 0.
Up/Down counter is used to control the direction of the counter through a certain sequence.
These characteristics are implemented with the AND, OR & NOT logic connected as shown in the logic
diagram above.
REGISTERS
INTRODUCTION:-
The sequential circuits known as register are very important logical block in most of the digital systems.
Registers are used for storage and transfer of binary information in a digital system.
A register is mostly used for the purpose of storing and shifting binary data entered into it from an
external source and has no characteristics internal sequence of states.
The storage capacity of a register is defined as the number of bits of digital data, it can store or retain.
These registers are normally used for temporary storage of data.
BUFFER REGISTER:-
These are the simplest registers and are used for simply storing a binary word.
These may be controlled by Controlled Buffer Register.
D flip – flops are used for constructing a buffer register or other flip- flop can be used.
The figure shown below is a 4- bit buffer register.
If CLR goes LOW, all the flip-flops are RESET and the output becomes, Q = 0000.
When CLR is HIGH, the register is ready for action
The bidirectional is achieved by using the mode signal and two AND gates and one OR gate for each
stage.
A HIGH on the Right/Left control input enables the AND gates G1, G2, G3 and G4 and disables the AND
gates G5, G6, G7 and G8 and the state of Q output of each FF is passed through the gate to the D input
of the following FF. When clock pulse occurs, the data bits are effectively shifted one place to the right.
A LOW Right/Left control input enables the AND gates G5, G6, G7 and G8 and disables the AND gates
G1, G2, G3 and G4 and the Q output of each FF is passed to the D input of the preceding FF. When
clock pulse occurs the data bits are then effectively shifted one place to the left.
So, the circuit works as a bidirectional shift register.
Shift registers are used for converting serial data to parallel form, so that a serial input can be
processed by a parallel system and for converting parallel data to serial form, so that parallel
data can be transmitted serially.
A serial in, parallel out shift register can be used to perform serial-to parallel conversion, and a
parallel in, serial out shift register can be used to perform parallel- to –serial conversion.
A universal shift register can be used to perform both the serial- to – parallel and parallel-to-
serial data conversion.
A bidirectional shift register can be used to reverse the order of data.
The most significant bit (MSB) resistance is one-eighth of the least significant bit (LSB) resistance. is much larger than
8R. The voltages , , and can be either equal to V (for logic 1) or 0 (for logical 0). Thus there are 2 = 16 input
combinations from 0000 to 1111. The output voltage , given by Millman’s theorem is
When input is 0001, = = = 0 and = V and output is V/15. If input is 0010, = = =0 and =V giving an
output of 2V/15. If input is 0011, = =0 and = = V giving an output of 3v/15. Thus, the output voltage varies
from 0 to V in steps of V/15.
The weighted resistor network requires a range of resistor values. The binary ladder network requires only two
resistance values. From node 1, the resistance to the digital source is 2R and resistance to ground is also 2R. From node
2, the resistance to digital source is 2R and resistance to ground =
Thus, from each of the nodes 1,2,3,4, the resistance to source and ground is 2R each. A digital input 0001 means that D is
connected to V and A, B, C are grounded. The output voltage is V/16. Thus as input varies from 0000 to 1111, the
output varies from V/16 to V in steps of V/16.
A complete digital-to-analog converter circuit consists of a number of ladder networks (to deal with more bits of data),
operational amplifier, gates etc.
The performance characteristics of D/A converters are resolution, accuracy, linear errors, monotonicity, setting time and
temperature sensitivity.
(a) Resolution: It is the reciprocal of the number of discrete steps in the D/A output. Evidently resolution depends
on the number of bits. The percentage resolution is [1/ (2 -1)] * 100 where N is the number of bits. The
percentage resolution for different values of N is given in table.
(b) Accuracy: It is a measure of the difference between actual output and expected output. It is expressed as a
percentage of the maximum output voltage. If the maximum output voltage (or full scale deflection) is 5 V and
.
accuracy is ±0.1%, then the maximum error is * 5 = 0.005 V or 5 mV. Ideally the accuracy should be better
than ±0.5 of LSB. In an 8 bit converter, LSB is 1/256 or 0.39% of full scale. The accuracy should be better than
0.2%.
(c) Setting Time: When the input signal changes, it is desirable that analog output signal should immediately show
the new output value. However in actual practice, the D/A converter takes some time to settle at the new
position of the output voltage. Setting time is defined as the time taken by the D/A converter to settle with ±1/2
LSB of its final value when a change in input digital signal occurs. The final time taken to settle down to new
value is due to the transients and oscillations in the output voltage. Figure shows the definition of setting time.
Fig 1
Quantization error:
An analog to digital converter changes analog signal into digital signal. It is important to note that in D/A
converter the number of input is fixed. In 4 bit D/a converter there are 16 possible inputs and in 6 bit D/A
converter there are 64 possible inputs. However, in A/D converter the analog input voltage can have any value in
the specified range but the digital output can have only 2 discrete levels (for N bit converter). This means that
there is a certain range of input voltage which correspond to every discrete output level.
Consider a 4 bit A/D converter having a resolution of 1 count per 100 mV. Fig (b) shows the analog input and
digital output. It is seen that for input voltage range of 50 mV to 150 mV, the output is same i.e. 0001, for input
voltage range of 150 mV to 250 mV, the output is the same, i.e. 0010. Thus we have one digital output for each
100 mV input range. If the digital signal of 0010 is fed to a D/A converter, it will show an output of 200 V
whereas the original input voltage was between 150 V and 250 v. This error is called quntisation error and in this
case this quntisation error can be ±50 mV and is equal to ±1/2 LSB.
becomes Low and disables the clock signal to the AND gate. The counter is therefore stopped and the binary
counter is latched. This completes one conversion cycle. The binary count is propor tional to analog input .
(d) A/D speed: It can be defined in two ways, i.e. either the time necessary to do one conversion or the line
between successive conversion at the highest rate possible. Speed depends on the settling time of
components and the speed of the logic.