BEEE-Unit-6 Digital Electronics
BEEE-Unit-6 Digital Electronics
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
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
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
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
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
A B Y
0 0 0
74LS08:
1 AND YA .B 1 0 0
Quad, 2-input AND gate.
0 1 0
1 1 1
.
A B Y
0 0 0
74LS32:
2 OR YA B 1 0 1
Quad, 2-input OR gate.
0 1 1
1 1 1
.
A Y 74LS04:
3 NOT YA 0 1 Hex, 1-input NOT gate.
1 0
A B Y
0 0 1
74LS00:
4 NAND YA .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 YA B 0 1 0 Quad, 2-input NOR gate.
1 1 0
A B Y
0 0 0
74LS86:
6 XOR YA B 1 0 1
Quad, 2-input EX-OR gate.
0 1 1
1 1 0
.
A B Y
0 0 1
7 XNOR YA B 1 0 0 —
0 1 0
1 1 1
.
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
(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
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 OA B
0 0 0
1 0 1
0 1 1
1 1 0
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 OA B
0 0 1
1 0 0
0 1 0
1 1 1
Codes
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
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.
Applications:
(i) Satellites.
(ii) Modems.
(iii) Computer memory.
7 6 5 4 3 2 1
m4 m3 m2 P3 m1 P2 P1
22 21 20
1 0 1 P3 0 P2 P1
Full adder
Sequential Circuits
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.
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
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.