0% found this document useful (0 votes)
18 views22 pages

BEEE-Unit-6 Digital Electronics

BEEE UNIT 6

Uploaded by

koti babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views22 pages

BEEE-Unit-6 Digital Electronics

BEEE UNIT 6

Uploaded by

koti babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

UNIT-VI

DIGITAL ELECTRONICS
Syllabus: Overview of Number Systems, Logic gates including Universal Gates,
BCD codes, Excess-3 code, Gray code, Hamming code. Boolean Algebra, Basic
Theorems and properties of Boolean Algebra, Truth Tables and Functionality of
Logic Gates – NOT, OR, AND, NOR, NAND, XOR and XNOR. Simple
combinational circuits–Half and Full Adders. Introduction to sequential
circuits, Flip flops, Registers and counters (Elementary Treatment only)
Text Books
[1] R. P. Jain, Modern Digital Electronics, 4th Edition, Tata McGraw Hill, 2009.
[2] D.P.Kothari and J.S.Dhillon, “Digital Circuits and Design” Pearson, 2015.
[3] M.Morris Mano, “Digital Logic and Computer Design” Pearson, 2017.
Abbreviations
A/D = Analog – to – Digital
BCD = Binary coded decimal
LSB = Least significant bit
MSB = Most significant bit
S.No. Contents Page
6.1 Introduction 1
6.2 Overview of Number Systems 1
6.3 Logic gates including Universal Gates 7
Truth Tables and Functionality of Logic Gates –
8
NOT, OR, AND, NOR, NAND, XOR and XNOR.
6.4 BCD code 10
6.5 Excess-3 code 11
6.6 Gray code 11
6.7 Hamming code 13
6.8 Boolean Algebra: Basic theorems and properties 15
6.9 Combinational circuits: Half and Full Adders 16
6.10 Sequential circuits: Flip flops, Registers & counters 19
6.1 Introduction
Inside today’s computers, data is represented as 1’s and 0’s. These 1’s and
0’s might be stored magnetically on a disk (or) as a state in a transistor. To
perform useful operations on these 1’s and 0’s one have to organize them together
into patterns that make up codes.
Modern digital systems do not represent numeric values using the decimal
system. Instead, they typically use a binary or two’s complement numbering
system. To understand the digital system arithmetic, one must understand how
digital systems represent numbers.
This chapter discusses several important concepts including the binary,
octal and hexadecimal numbering systems, binary data organization (bits, nibbles,
bytes, words, and double words), signed and unsigned numbering systems.
6.2 Overview of Number Systems
 The smallest “unit” of data in digital system is a single Bit. It is either 0 or 1.
 A nibble is a collection of four bits.
 A byte is a group of eight bits.
 A word is a group of 16 bits.
 A double word is exactly what its name implies, a pair of words. Therefore, a
double word quantity is 32 bits long.
The different types of number systems are:
(i) Decimal number System (Base- 10)
(ii) Binary number system (Base- 2)
(iii) Octal numbering system (Base- 8)
(iv) Hexadecimal numbering system (Base-16)
BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 1
Fig.6.1 Number base conversions

Decimal Binary Octal Hexadecimal


0 00000 0 0
1 00001 1 1
2 00010 2 2
3 00011 3 3
4 00100 4 4
5 00101 5 5
6 00110 6 6
7 00111 7 7
8 01000 10 8
9 01001 11 9
10 01010 12 A
11 01011 13 B
12 01100 14 C
13 01101 15 D
14 01110 16 E
15 01111 17 F
16 10000 20 10

(i) Decimal number system:


10 variables, Base-10, [ 0,1,2,3,4,5,6,7,8,9 ]
The decimal number system, also known as the base-10 number system, is the
most widely used numerical system in the world. It is called "decimal" because it is
based on ten distinct digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Each position in a decimal
number represents a power of 10, with the rightmost digit representing 100100, the
next representing 101101, and so on.
Each digit appearing to the left of the decimal point represents a value
between zero and nine times an increasing power of ten. Digits appearing to the
right of the decimal point represent a value between zero and nine times an
increasing negative power of ten.
103=1000 102=100 101=10 100=1 . 10-1=0.1 10-2=0.01 10-3=0.001
Most Least
Decimal
Significant Significant
Point
Digit(MSD) Digit (LSD)

Example1: the value 123.456 means:


1x102 + 2x101 + 3x100 + 4x10-1 + 5x10-2 + 6x10-3

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 2


(ii) Binary number system:
2 variables, Base-2, [ 0, 1 ]
Most modern digital systems operate using binary logic. The digital systems
represents values using two voltage levels (usually 0V and +5V). With two such
levels one can represent exactly two different values. These could be any two
different values, but by convention we use the values zero and one. These two
values, coincidentally, correspond to the two digits used by the binary numbering
system.
23=8 22=4 21=2 20=1 . 2-1=1/2 2-2=1/4 2-3=1/8
Most Least
Binary
Significant Significant
Point
Digit(MSD) Digit (LSD)

Example 2: Convert (25)10 into binary


This method uses repeated division by 2
25/2 = 12 + remainder 1 (Least significant bit)
12/2 = 6 + remainder 0
6/2 = 3 + remainder 0
3/2 = 1 + remainder 1
1/2 = 0 + remainder 1 (Most significant bit)
Result: (25)10 = 11001
Example 3: Convert (600)10 into binary

All of the remainders from the division are then arranged in reverse order, from
MSB to LSB to form the correct binary sequence. Therefore, the binary equivalent
of decimal number (600)10 is (1001011000)2
Example 4: Convert (0.625)10 into binary
Ans) To convert a fractional decimal number to a binary number, we multiply the
fractional part of the number repeatedly by base 2. The integer part obtained after
multiplication is noted separately and the fractional part is again considered for
further multiplication. This process will continue till a zero fractional part has
been obtained. In this conversion method, the first integer is Most Significant Bit
(MSB) and the last integer is the Least Significant Bit (LSB) of the fractional
decimal number.
Fractional
Product Fractional part Integer part
number
0.625 0.625 x 2 = 1.25 0.25 1 MSB
0.25 0.25 x 2 = 0.5 0.5 0
0.5 0.5 x 2 = 1 0 1 LSB
The binary equivalent of (.625)10 is (.101)2

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 3


Example 5: Convert (0.475)10 into binary
Fractional
Product Fractional part Integer part
number
0.475 0.475 x 2 = 0.95 0.95 0 MSB
0.95 0.95 x 2 =1.9 0.9 1
0.9 0.9 x 2 =1.8 0.8 1
0.8 0.8 x 2 =1.6 0.6 1
0.6 0.6 x 2 = 1.2 0.2 1
0.2 0.2 x 2 = 0.4 0.4 0
0.4 0.4 x 2 = 0.8 0.8 0
0.8 0.8 x 2 = 1.6 0.6 1 LSB

The binary equivalent of (.475)10 is (.01111001100…) 10 2.

(iii) Octal number system


8 variables, Base-8, [ 0,1,2,3,4,5,6,7 ]
The octal number system has a base of eight, meaning that it has eight possible
digits: 0,1,2,3,4,5,6, and 7. The octal number system is shown in Table
83=512 82=64 81=8 80=1 . 8-1=1/8 8-2=1/64 8-3=1/512
Most Least
Octal
Significant Significant
Point
Digit(MSD) Digit (LSD)

Example 6: Convert 17810 into octal system


Ans) 178/8 = 22 + remainder 2 = 2 (LSB)
22/8 = 2 + remainder 6 = 6
2/8 = 0 + remainder 2 = 2 (MSB)
The octal equivalent of 17810 is 2628
Example 7: Convert 60210 into octal system

All of the remainders from the division are then arranged in reverse order, from MSD to LSD to
form the correct octal sequence. Therefore the octal equivalent of decimal number (602)10 is (1132)8.
Binary-to-Octal/Octal-to-Binary Conversion

Example 8: Convert (111 100 111 010)2 into octal system


(111 100 111 010)2 = (111) (100) (111) (010) = (7 4 7 2 )2.

Example 9: Convert octal number (24657)8 into binary system


(24657)8 can represented by binary number (010) (100) (110) (101) (111) = (010100110101111)2.

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 4


(iv) Hexadecimal numbering system
16 variables, Base-16, [ 0,1,2,3,4,5,6,7,8,9,A,B,,C,D,E,F ]
In hexadecimal system, the base is 16. So, this system has 16 possible digit
symbols. It uses the digit 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and the letters A, B, C, D, E,
and F as the 16 digit symbols. The letters A to F are used for the values of 10 –15.
This hexadecimal system is also used extensively in computing. The hexadecimal
equivalent of decimal numbers 0 to 15 is presented in Table 1.7. Table 1.8 shows
the hexadecimal number system.

Decimal Hexadecimal
(Base 10) (Base 16)
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 A
11 B
12 C
13 D
14 E
15 F

163=4096 162=256 161=16 160=1 . 16-1=1/16 16-2=1/256 16-3=1/4096


Most Least
Hexadecimal
Significant Significant
Point
Digit(MSD) Digit (LSD)

Decimal to Hexadecimal Conversion


Example 10: Convert 37810 to hexadecimal system
Ans) 378/16 = 23 + remainder10 A (Least Significant Digit)
23/16 = 1 + remainder 7 7
1/16 = 0 + remainder 1 1 (Most Significant Digit)
 The hexadecimal equivalent of 37810=17A16
Example 11: Convert 578910 to hexadecimal system

All of the remainders from the division are then arranged in reverse order, from
MSD to LSD to form the correct hexadecimal sequence. Therefore, the hexadecimal
equivalent of decimal number (5789) is (169D)10

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 5


Binary to Hexadecimal and Hexadecimal to Binary Conversion
Binary equivalent of hexadecimal digits (0 to F) are shown in Table. It is depicted in
this table. Each group of 4 binary digits (bits) = 1 hexadecimal digit.
Binary Equivalent Hexadecimal Digit
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F

Example 12: Binary to hexadecimal


(1111 1011 0011) = (1111) (1011) (0011) = (F B 3)16
Example 13: Hexadecimal to Binary
(24657A)16 = = (0010 0100 0110 0101 0111 1010)2.
Octal-to-Hexadecimal & Hexadecimal-to-Octal Conversion
Example 14: Octal-to-Hexadecimal
Step 1: Octal number is converted into binary.
Step 2: Regrouping the binary number in 4 bits and a group starts from the LSB.
Step 3: the 4 bits group binary number can be represented by hexadecimal number.
Convert octal number (547)8 to hexadecimal number
Ans) (547)8 = (101 100 111) (Binary) Step 1
= (0001) (0110) (0111) Step 2
= (167) (Hexadecimal ) Step 3
Example 15: Hexadecimal-to-Octal
Step 1: Convert hexadecimal to binary.
Step 2: Regrouping the binary number in 3 bits a group which starts from the LSB.
Step 3: The groups of 3 bits binary number can be represented by octal numbers.
Convert of (5A8)16 to Octal number
Ans) 5A816 = ( 0101 1010 1000 ) (Binary) Step 1
= (010) (110) (101) (000) Step 2
= (2 6 5 0) (Octal) Step 3
Exercise: Convert the following F2C16 =_____________10
11100112 =_________10 DF8.2816 =__________10
1101.112 =_________10 90510 =______________16
1110 =_______________2 678610 =_____________16
25510 =______________2 0.62510 =____________16
0.7210 =_____________2 2824.510 =___________16
24. 62510 =__________2
4168 =____________________________10 A4C16 =___________________________2
360.158 =_________________________10 3E7.DA16 =________________________2
23410 =____________________________8 1011110010112 =_________________16
2988.687510 =_____________________8 1011110011.001100102 =_________16
370.5268 =________________________2
27028 =___________________________2 7448 =________________16
101111001110. 0011002 =________8 3472.568 =____________16
0.1110011112 =___________________8 B7A416 =______________8
D43E.5A16 =___________8
BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 6
6.3 Logic gates including Universal Gates Truth Tables and
Functionality of Logic Gates NOT, OR, AND, NOR, NAND, XOR and XNOR.
S.No. Gate Logic Symbol Function Truth table Transistor equivalent

A B Y
0 0 0
74LS08:
1 AND YA .B 1 0 0
Quad, 2-input AND gate.
0 1 0
1 1 1
.

A B Y
0 0 0
74LS32:
2 OR YA  B 1 0 1
Quad, 2-input OR gate.
0 1 1
1 1 1
.

A Y 74LS04:
3 NOT YA 0 1 Hex, 1-input NOT gate.
1 0

A B Y
0 0 1
74LS00:
4 NAND YA .B 1 0 1
Quad, 2-input NAND gate.
0 1 1
1 1 0
.

A B Y
0 0 1
1 0 0 74LS02:
5 NOR YA  B 0 1 0 Quad, 2-input NOR gate.
1 1 0

A B Y
0 0 0
74LS86:
6 XOR YA  B 1 0 1
Quad, 2-input EX-OR gate.
0 1 1
1 1 0
.

A B Y
0 0 1
7 XNOR YA  B 1 0 0 —
0 1 0
1 1 1
.

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 7


Logic Gates
Logic gates are electronic circuits with a number of inputs and one output. The
output voltage depends on the input voltages. Logic gate circuits are most
commonly represented in a schematic by symbols in place of constituent
transistors and resistors.
The digital systems can be made by using three basic logic gates. These are AND
gate, OR gate and NOT gate. The AND gate is an electronic circuit whose output is
high when it’s all inputs are high. The OR gate is also an electronic circuit which
gives a high output if one or more of it’s inputs are high. The NOT gate generates
an inverted version of the input logic at it’s output.
The most commonly used other universal logic gates are NAND, NOR, XOR, INV,
and BUF. The term INV stand for “inverter” and BUF stand for “buffer”. In this
section, function of all logic gates have explained elaborately.
(i) AND gate:
The expression O = A .B means output “O ” equals A AND B . The “.” sign stands
for the AND operation and actually it is same as ordinary multiplication of 1s and
0s. The AND operation produces a result of ‘1’, when all input variables are ‘1’. But
the output is ‘0’ when one or more inputs are ‘0’. Fig. shows the two inputs AND
gate and truth table is given in Table

Inputs Output
A B O = A.B
0 0 0
1 0 0
0 1 0
1 1 1

(i) OR gate:
The expression O = A + B defined as output “O ” equals A OR B .
The “+” sign stands for the OR operation and it is not for arithmetic addition.
When any of the inputs of OR gate is ‘1’ the output of the OR gate will be ‘1’. But,
the output of OR gate is ‘0’ only when all the input variables are ‘0’. The symbol of
two inputs OR gate is shown in Fig. and truth table is also given in Table.

Inputs Output
A B O=A+B
0 0 0
1 0 1
0 1 1
1 1 1

(iii) NOT gate:


This inverter circuit is also represented by symbol as given in Fig. The NOT Gate
has one input signal and one output signal. When the input signal A is subjected
to the NOT operation, the output O can be expressed as
Input Output
A O=A1
0 1
1 0

(iv) NAND gate: The inverted operation of AND gate is the NAND gate and its
symbol is depicted in Fig.. There is a small circle on the output. This small circle
represents the inversion operation. The output of the two inputs NAND gate can be
expressed as

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 8


Inputs Output
A B O  AB   AB 
1

0 0 1
1 0 1
0 1 1
1 1 0

(v) NOR gate: NOR gate is extensively used in digital electronic circuit. This gate is
the combination of the basic gates AND, OR and NOT. NOR is the same as the
inverted OR gate and its symbol is shown in Fig. 2.27. This gate has a small circle on
the output. This small circle represents the inversion operation and the output
expression of the two inputs NOR gate is
O  A  B   A  B
1

Inputs Output
A B O  A  B   A  B
1

0 0 1
1 0 0
0 1 0
1 1 0

(v) XOR gate: The operation of Exclusive-OR gate is something quite different from
OR gate. When the inputs of Exclusive-OR gate are at different logic levels either ‘0’
and ‘1’ or ‘1’ and ‘0’, its output is “high”. On the other hand, output of Exclusive-
OR gate is “low” logic level if the inputs are at the same logic levels. The Exclusive-
OR gate can be written as XOR or Ex-OR gate. Fig. shows the two inputs Ex-OR
gate and truth table is given in Table.

Inputs Output
A B OA  B
0 0 0
1 0 1
0 1 1
1 1 0

(v) XNOR gate:


The last gate for analysis is the Exclusive-NOR gate and it is known as the XNOR
gate. It is equivalent to an Exclusive-OR gate with an inverted output. The truth
table of XNOR gate Inputs Output for this gate is absolutely opposite of the
Exclusive-OR gate as given in Table.

Figure shows the two inputs Ex-NOR gate. From the truth table, it is very clear
that the purpose of an Exclusive-NOR gate is to output a ‘high’ when both inputs
are at the same logic levels.
Inputs Output
A B OA  B
0 0 1
1 0 0
0 1 0
1 1 1

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 9


CODES
When numbers, letters, text represented by a group of symbols, these are called codes.

Codes

Self Error detecting


non-weighted Alphanumeric
Weighted codes complementing Sequential codes & correcting
codes code
codes code

Ex: Binary code No positionsl 2421 code Ex: 8421 code


values ASCII code Hamming code
8421 code excess3 code Excess3 code
Ex: Gray code
Excess3 code

6.4 BCD Code (8421 Code)


The BCD is a group of four binary bits that represent a decimal digit.
Each digit of a decimal number is replaced by a 4-bit binary number
Since a decimal digit is a number from 0 to 9, a nibble representing a number
greater than 9 is invalid BCD.

8 4 2 1
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

Decimal  BCD code


Example 16: (23)10 = 0010 0011
Example 17: (56.79)10= 0101 0110 . 0111 1001
Octal  Decimal  BCD code
Example 18:  6218  6x8 +2x8 +1x8   40110  0100 0000 0001
2 1 0

Hexadecimal  Decimal  BCD code


Example 19:  56 16  5x161  12x160   92 10  1001 0010
Advantages: Simple conversion
Disadvantages: (i) Less efficient code because of using more bits.
(ii) Addition, division, multiplication is also complicated.
1410  1110  Binary
1410  0001 0100  BCD code
BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 10
6.5 Excess-3 code
 During 1970's Excess-3 code were used on some older computers, in cash
registers and in the hand held portable electronic calculators.
 Excess-3 is a non-weighted and complementary BCD code.
 It is a way to represent values with a balanced number of positive and negative
numbers using a pre-specified number 3 as a biasing value.
 The Excess-3 is derived from 8421 BCD code by adding binary value (0011)2 to
each code in 8421.
BCD code
Decimal number  
Add
 Excess 3 code
 8421 0011

01 0 0
4  0100 
Add
0011

00 1 1
01 1 1
The relationship between the four bit binary codes & Excess -3 codes are shown in table.

Decimal BCD code 8421 Excess-3 code Excess – 3 code is self-complementing


0 0 0 0 0 0 0 1 1 9  complement of 0
1 0 0 0 1 0 1 0 0 8  complement of 1
2 0 0 1 0 0 1 0 1 7  complement of 2
3 0 0 1 1 0 1 1 0 6  complement of 3
4 0 1 0 0 0 1 1 1
5 0 1 0 1 1 0 0 0
6 0 1 1 0 1 0 0 1
7 0 1 1 1 1 0 1 0
8 1 0 0 0 1 0 1 1
9 1 0 0 1 1 1 0 0

6.6 Gray code


Gray code is a special case of unit-distance code. In unit-distance code,
bit patterns for two consecutive numbers differ in only one bit position. These
codes are also called cyclic codes. The Table shows the bit patterns assigned
for gray code from decimal 0 to decimal 15.
Gray code is an non-weighted code where bit positions lack specific weights,
making it unsuitable for arithmetic operations but useful in analog to digital
converters. The most commonly used form is a four-bit numeric code representing
decimal numbers 0 to 15, also known as unit distance or reflected code, as
consecutive codes differ by only one bit.
Gray code reduces switching activity, which is significant because binary
operations are represented by switches: a closed switch is '1' and an open switch
is '0'. Transitioning between states in binary, such as from 7 (0111) to 8 (1000),
requires all four switches to change, causing delays and increased power
consumption.
In contrast, the same transition in Gray code, from 7 (0100) to 8 (1100),
only changes one switch, thereby improving speed and reducing power
consumption.

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 11


 It is called after the name Frank Gray
 It is a non-weighted code (no positional weight)
 Also called reflected code (or) Cyclic code because each successive code word
differs from the preceding code word in only 1 bit position. Hence it is also
called as Unit distance code
 Reduces switching operations.
 Gray code is not suitable for arithmetic operations/mathematical operations
because it is not a sequence code.
 Gray code is a reflective code in which n-least significant bits for 2n through
2n+1  1 are the mirror images of those for ‘0’ through 2n  1
n=2 n=3 n=4 Applications:
2-1 3-1 4-1 (i) Shaft encoders
0 to 2 -1 0 to 2 -1 0 to 2 -1
(ii) I/O devices
0 to 1 0 to 3 0 to 7 (iii) A/D converters
   (iv) Instrumentation
(v) Data acquisition systems
22-1 to 22 -1 23-1 to 23 -1 24-1 to 24 -1 (vi) Error correction
2 to 3 4 to 7 8 to 15 (vii) Digital communication
(viii) K map reductions.

Decimal 4-bit Gray code


number Binary 1-Bit 2-Bit 3-Bit 4-Bit
0 0000 0 00 000 0000
1 0001 1 01 001 0001
2 0010 11 011 0011
3 0011 10 010 0010
4 0100 110 0110
5 0101 111 0111
6 0110 101 0101
7 0111 100 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
Example 20: Convert 10102 into gray code.
Ans) XOR
1 0 1 0 A B OA  B
 0 0 0
0 1 1
1 1 1 1 1 0 1
10102 = 1111gray 1 1 0
Example 21: Convert 01102 into gray code.
Ans)
0 1 1 0

0 1 0 1
01102 = 0101gray
BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 12
6.7 Hamming code
Hamming code is a method used for error detection and correction in digital
communication and storage. It was developed by Richard Hamming in the
1950s. The primary goal of Hamming code is to detect and correct single-bit
errors that may occur during data transmission.

 R.W.Hammings developed this code to detect the errors


 Used for single bit error detection & correction.
 Using parity data, error of the date is detected.
 Easy to implement.
 In Hamming code, the source encodes the message by adding parity bits
in the message. These parity bits are inserted and generated at Certain
positions in the message to accomplish Correction process.
 The process of encoding a message using Hamming code includes the
following steps:

Step1: Calculation of total number of parity bits:


Let us assume that the message contains
m = number of message bits
p = number of parity bits
Number of parity bits can be calculated by using the formula
2P  m+ p +1
where m + p = total number of bits

Example: If p=3, m=4 then, 23  4+3+1  8  8

Step2: Placing the parity bits in their correct position


p-parity bits should be placed at bit positions of powers of 2
P4 m4 m3 m2 P3 m1 P2 P1
8 7 6 5 4 3 2 1
23 22 21 20
Step 3: Calculating the values of parity bits:
The parity bits makes the number of 1’s either even or odd.
Odd parity: Total number of bits in the message is made odd is called
odd parity
Even parity: Total number of 1’s is even.

Applications:
(i) Satellites.
(ii) Modems.
(iii) Computer memory.

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 13


Example 22 : Generate the Hamming code for given message 1 0 1 0
sent with even parity. Find the error position of the received message if it
is received as 1010000

Ans) The number of message bits, m = 4


The number of parity bits required is calculated by
2P  m  p  1
23  4  3  1
88  true 
Number of parity bits, P=3
Total number of bits = m + p = 4 + 3 = 7

7 6 5 4 3 2 1
m4 m3 m2 P3 m1 P2 P1
22 21 20
1 0 1 P3 0 P2 P1

Parity bits P1 , P2 , P3 are calculated as


0 0 1  1
P1  1, 3, 5, 7
0 1 0  2
= P1 , 0, 1, 1
0 1 1
 3
=0 0 1 1  even parity 
1 0 0  4
 P1  0
1 0 1  5
P2  2, 3, 6, 7 
1 1 0 6
= P2 , 0, 0, 1
1 1 1
 7
=1 0 0 1  even parity 
 P2  1
P3  4, 5, 6, 7
= P3 , 1, 0, 1
=0 1 0 1  even parity 
 P3  0
Identify the error position = P3 P2 P1  0 1 0 = 2
The error is located at 2nd position in the message.

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 14


6.8 Boolean Algebra
 In 1854 George Boole gave the idea of Boolean algebra.
 In 1938 CE.Shanon illustrated two valued Boolean algebra called Switching diagram.
 The Boolean algebra is defined with a set of elements, a set of operators and
number of unproved axioms or postulates.
 The set of elements is any collection of objects, usually having a common property.
Let us assume ‘S’ is a set and x, y to be its object. Then x ε S, where x is the
number of set of ‘S’, where S = {x, y}.
 Before knowing about the boolean algebra let us understand what is ordinary
algebra.

The basic theorems of boolean algebra are (a) Demorgan’s theorem,


(b) Duality theorem
(c) Consensus theorem.
(a) Demorgan’s theorem
The Demorgan’s theorem can be stated as follows
(i) Complementing two or more variables and then applying AND operation is
equivalent to NOR operation is shown in Fig.6.12.

Fig. NOR function


(ii) Complementing two or more variables and then applying OR operation is
equivalent to a NAND operation is shown in Fig.6.13.

Fig. NAND function


(b) Duality Theorem
Duality theorem states that one part may be obtained from the other if the binary
operators and the identity elements are interchanged. Duality principle states that
every algebraic expression deducible from the postulates of Boolean algebra
remain valid if the operators and identity elements are interchanged. The
procedure of duality theorems are as follows
Step 1: Change each OR sign to AND sign
Step 2: Change each AND sign to OR sign
Step 3: Complementing constants ‘ 0 ’ to ‘ 1 ’ and ‘ 1 ’ to ‘ 0 ‘.
Example,
(i) The law of intersection x.0 equal to 0 becomes law of union x + 1 =1 by using
duality theorem.

(ii) The absorption law x. (x + y) = x becomes distributive law x + (x.y) =x by using


duality theorem.

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 15


(c) Consensus Theorem
The consensus theorem is given below
(i) Find Pair of terms, one of which contains variable and other contains its complement
(ii) Find third which should contain the remaining variables and its complement

Properties of Boolean algebra


The basic laws of boolean algebra are (a) Absorption law,
(b) Commutative law,
(c) Associative law and
(d) Distributive law.
(a) Absorption law
The absorption law are stated as follows
(i) The variable x is multiplied with the variable y and added to the variable x then
the result is x that is, x + xy = x
(ii) The variable x is complemented and the complemented variable is multiplied
by y and added with x to give the addition of variable x and y that is x y  x  x  y
(b) Commutative law:
The Commutative law are stated below.
(i) x y = y x The order in which AND ed makes no difference in the output.
(ii) x + y = x + y The order in which OR ed makes no difference in output.
(c) Associative law:
The associative law is stated as follows,
making AND (or) OR of several variables, the result is same regardless of grouping variable.
(i) x+(y+z) = (x+y)+z
(ii) x(yz) = (xy)z
(d) Distributive law:
The distributive law is stated as follows
(i) A(B+C) = AB+AC
(ii) A+BC = (A+B)(A+C)

6.9 Combinational circuits: Half and Full Adder


A combinational circuit is one whose present state output depends only on the
present state of inputs; no information about the previous output or input will be
available in order to determine the present output state. Hence, it is obvious that a
combinational circuit does not have memory in it and hence cannot store.
Arithmetic circuits like adders, subtractors, multiplexers, de-multiplexers,
encoders, decoders, gates, etc. are all some examples of combinational circuits.
The block diagram of a combinational circuit is shown in Fig.(a)

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 16


Half adder

Limitations of Half adder:

Full adder

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 17


BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 18
6.10 sequential circuits: Flip flops, Registers and counters
A sequential circuit is one whose present state output depends not only on the
present state of inputs, but also on the previous output; hence information about
the previous output should be made available in order to determine the present
output state. Hence, it is obvious that a sequential circuit does have memory in it
and hence can store. Latches, flip-flops, counters, registers, etc. are some
examples of sequential circuits. The block diagram of a sequential circuit is shown
in Fig.(b)

Sequential Circuits

 The combinational circuit does not use any memory.


 Hence the previous state of input does not have any effect on the present state of the circuit.
 But sequential circuit has memory so output can vary based on input.
 In other words, the combinational circuit with memory is called sequential circuit.

Flip-Flops
 A flip-flop is a memory element which is capable of storing one bit of information
and it is used in clocked sequential circuits.
 A flip-flop has two outputs, one for normal value and other for complement value.
 A flip flop is also known as bistable multivibrator.
 Flip flop is a sequential circuit which generally samples its inputs and changes its
outputs only at particular instants of time and not continuously.

Types of Flip-flops: Flip-fops are of different types depending on their input & clock pulse.

(i) S-R flip flop(Set-Reset)


(ii) J-K flip flop (Jack-Kilby)
(iii) D Flip –Flop (Delay)
(iii) T Flip –Flop (Toggle)

S-R Flip Flop


 It is basically S-R latch using NAND gates with an additional enable input.
 It is also known as Set-Reset FF.
 In this circuit when you Set "S" as active the output "Q" would be high and "Q" will be low.
 In short this circuit will operate as an S-R latch if E = 1 but there is no change in
the output if E = 0.

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 19


J-K Flip-Flop (Jack-Kilby)
 The J-K flip-flop is the most versatile of the basic flip-flops.
 The J-K Flip Flop is the most widely used flip flop.
 It is considered to be a universal flip-flop circuit.
 The sequential operation of the JK Flip Flop is the same as for the RS flip-flop for
the same SET and RESET input.
 The difference is that the JK Flip Flop does not the invalid input states of the RS
Latch (when S and R are 1)

D Flip Flop
 Delay Flip Flop or D Flip Flop is the simple gated S-R latch with a NAND inverter
connected between S and R inputs.
 It has only one input.
 The input data is appearing at the output after some time.
 Due to this data delay between i/p and o/p, it is called delay flip flop. S and R
Block Diagram.

T Flip Flop
Toggle flip flop is basically a JK flip flop with J and K terminals permanently
connected together.
It has only input denoted by T as shown in the Symbol Diagram

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 20


Flip-Flop Latch
A flip-flop contains a clock signal. A latch doesn't contain any clock signal.
FFs are designed with latches by adding
The structure of Latch is built with logic gates.
an extra clock signal.
Flip-Flops (FFs) are very slow Latches are very fast
Latches are responsive toward faults on
FFs are protected toward faults
enable pin
FFs consume more power A Latch may be Latches consume less power A flip-flop can be
clock-less (or) clocked. clocked for all time

Registers
Registers are fundamental components in digital electronics that serve as small
storage units within a digital system. They are used to store data temporarily and
play a crucial role in various operations within a computer or digital circuit. Here’s
an in-depth look at registers:

Registers are groups of flip-flops used to store multiple bits of data. A flip-flop is a
basic memory element capable of storing one bit of information, so a register is
essentially an array of flip-flops that can store a binary word of multiple bits (e.g.,
8-bit, 16-bit, 32-bit).
Functions of Registers
1. Data Storage: Registers temporarily hold data that is being processed,
transferred, or manipulated within the CPU or other digital circuits.
2. Data Transfer: They facilitate the movement of data between different parts
of the CPU or between the CPU and memory or I/O devices.
3. Data Manipulation: Registers are used to perform arithmetic and logical
operations directly on the data they hold.
4. Control Operations: They can store control information, such as the
instruction being executed, or flags indicating the status of operations.
Types of Registers
1. Data Registers: These hold data that is being processed by the CPU.
Examples include the accumulator, which is used in arithmetic and logic
operations, and general-purpose registers.
2. Address Registers: These hold memory addresses used in accessing data.
Examples include the program counter (PC), which points to the next
instruction to be executed, and the memory address register (MAR).
3. Status Registers: These hold flags or condition codes that indicate the
outcome of operations, such as zero, carry, sign, overflow, etc.
4. Control Registers: These hold control information used to manage the
operation of the CPU and other components. Examples include the
instruction register (IR), which holds the current instruction being executed,
and the control and status register (CSR).
Operations on Registers
 Load: Transfer data from memory or another register into the register.
 Store: Transfer data from the register to memory.
 Move: Transfer data from one register to another.
 Increment/Decrement: Increase or decrease the value stored in the register.
 Clear: Reset the register to zero.
 Set: Set the register to a particular value.
Applications
 Microprocessors: Registers are integral parts of the CPU, used for fast data
access and manipulation.
 Digital Signal Processing: Registers store intermediate results and control
data flow in DSP algorithms.
 Embedded Systems: Registers hold configuration and control data for
peripheral devices.
BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 21
Counters
 Counters are a type of sequential circuit in digital electronics that count
pulses and store the result of the count.
 They are widely used in various applications, including timers, frequency
dividers, digital clocks, and event counters.
 Counters can be classified based on their counting sequence, direction,
and implementation.
Types of Counters
1. Asynchronous (Ripple) Counters:
o In asynchronous counters, the flip-flops are not clocked
simultaneously. The output of one flip-flop acts as the clock for the
next flip-flop.
o The propagation delay of each flip-flop adds up, which limits the
speed of the counter.
o Example: A 4-bit asynchronous binary counter.
2. Synchronous Counters:
o In synchronous counters, all flip-flops are clocked simultaneously
by a common clock signal.
o They are faster than asynchronous counters because they avoid
cumulative propagation delays.
o Example: A 4-bit synchronous binary counter.
3. Up Counters and Down Counters:
o Up Counters: Count in an ascending order (0, 1, 2, 3, ...).
o Down Counters: Count in a descending order (N, N-1, N-2, ...).
4. Up/Down Counters:
o These counters can count both upwards and downwards,
depending on the mode control input.
o Example: A 4-bit up/down counter.
5. Decade Counters:
o Decade counters count from 0 to 9 and then reset to 0.
o They are used in applications where a decimal count is required,
such as digital clocks.
6. Ring Counters:
o A ring counter is a type of shift register where the output of the
last flip-flop is fed back to the input of the first flip-flop.
o It circulates a single '1' or '0' bit around the ring.
7. Johnson Counters:
o A Johnson counter is a variation of the ring counter where the
complement of the output of the last flip-flop is fed back to the
input of the first flip-flop.
o It has a counting sequence that is twice the length of the number
of flip-flops.
Applications of counter:
(i) Counting.
(ii) Time measurement.
(iii) Analog to digital converter.
(iv) Frequency division.

BEEE (23CS2T03) MIC23 Unit-6 Digital Electronics 22

You might also like