Digital Electronic
Digital Electronic
Digital Electronic
Dear Students
1.0 Objectives: This chapter would make you understand the following concepts
What is difference between analog and digital system?
Different numbering system.
Conversion from one number system to another
Floating point numbers
Weighted codes binary coded decimal
Non-weighted codes Excess 3 code
Gray code and Alphanumeric codes
Error detection and correction
Universal Product Code and Code conversion
1.1 Introduction
The study of number systems is important from the viewpoint of understanding how
data are represented before they can be processed by any digital system including a
digital computer. In this chapter we will discuss different number systems commonly
used to represent data such as the binary, octal and hexadecimal number systems.
1.2 Analog system, digital system
Digital as well as Analog System, both are used to transmit signals from one place to
another like audio/video. Digital system uses binary format as 0 and 1 whereas
analog system uses electronic pulses with varying magnitude to send data.
1.2.1 Analog system
A signal is defined as any physical quantity that varies with time, space, or any other
independent variable or variables. Mathematically signal can be function of one or
more independent variables, for example,
S1 (t) = 10 t
S2 (t) = 10 t2
Most of the signals find in science and engineering are analog in nature i.e. the
signals are functions of a continuous variable, such as time or space, and usually
take on values in continuous range. The most common example of analog signal is
sinusoidal waveform as shown Fig. 1.2.1
The expression for the signal can be written as
S(t) = A sin ( t + )
Where, A = Amplitude
= Radian/sec
= Phase
T = Time duration of one cycle
F = Frequency = 1/T
Fig. 1.2.1 Sine Wave
To measure an analog signal analog multimeter is used. The main problem with an
analog signal is continuously varying with respect to time; the person has to be
expert in Time domain analysis to find out perfect result.
1.2.2 Digital system
To overcome the problems of an analog system; the digital system developed.
Digital system requires digital information. Digital information can be represented by
fixed number of non – continuous or discrete symbols called as Digits. In digital
system binary system is used which has only two digits ‘0’ and ‘1’.
Binary system: as we are using binary in digital system which restricts the digital
signal to have only two distinct values.
Advantages of Binary system:
1. Most information processing systems are constructed by using switches (binary
devices).
2. Binary signal are more reliable.
3. The basic decision making processes required of digital systems are binary.
Bits: As binary quantities are encountered in many different physical forms, it is
convenient to have a common way of representing binary states by using digit
symbols ‘0’ and ‘1’ to represent two possible values of binary quantity at any time.
These symbols are called as ‘bits’, abbreviation of term ‘Binary digits’. Fig. 1.2.2
shows digital and analog signal. We use ‘1’ to denote ‘HIGH’ and ‘0’ to denote ‘LOW’
level of the signal. Binary voltage values VH and VL are represented as ‘1’ and ‘0’
respectively.
Number Base:
The decimal number notation can be written in generalized form where quantity 10 is
replaced by ‘r’ called as base or radix, of the number system. We will represent
number x2 x1 x0 . x-1 x-2 as
x2 x1 x0 . x-1 x-2 = x2 X r2 + x1 X r1 + x0 X r0. x-1 X r-1 + x-2 X r-2 … (3)
Following table shows various number systems of our interest.
System Name Base ‘r’ Digits / symbols used in the system
Decimal 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Binary 2 0, 1
Octal 8 0, 1, 2, 3, 4, 5, 6, 7
Hexadecimal 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
There are many methods or techniques which can be used to convert numbers from
one base to another. In this chapter, we'll demonstrate the following −
Binary to Octal
Octal to Binary
Binary to Hexadecimal
Hexadecimal to Binary
1.4.1 Decimal to Other Base System
Step 1 − Divide the decimal number to be converted by the value of the new base.
Step 2 − Get the remainder from Step 1 as the rightmost digit (least significant digit)
of the new base number.
Step 3 − Divide the quotient of the previous divide by the new base.
Step 4 − Record the remainder from Step 3 as the next digit (to the left) of the new
base number.
Repeat Steps 3 and 4, getting remainders from right to left, until the quotient
becomes zero in Step 3.
The last remainder thus obtained will be the Most Significant Digit (MSD) of the new
base number.
Example
Step 1 29 / 2 14 1
Step 2 14 / 2 7 0
Step 3 7/2 3 1
Step 4 3/2 1 1
Step 5 1/2 0 1
Step 3 − Sum the products calculated in Step 2. The total is the equivalent value in
decimal.
Example
Step 1 − Divide the binary digits into groups of three (starting from the right).
Step 2 − Convert each group of three binary digits to one octal digit.
Example
Step 2 101012 28 58
Step 2 − Combine all the resulting binary groups (of 3 digits each) into a single
binary number.
Example
Step 2 − Combine all the resulting binary groups (of 4 digits each) into a single
binary number.
Example
Floating point numbers are used to represent non integer fractional numbers and are
used in technical calculations. E.g. 3.256, 2.1 and 0.0036.
The most commonly used floating point standard is the IEEE standard.
According to this standard, floating point numbers are represented with 32 bits
(single precision) or 64 bits (double precision).
It is an arithmetic operations consist of addition, subtraction, multiplication and
division.
These operations are done with algorithms similar to those used on sign magnitude
integers (because of the similarity of representation) example, only add numbers of
the same sign. If the numbers are of opposite sign, must do subtraction.
ADDITION:
Example on decimal value given in scientific notation:
3.25 x 10 ** 3
+ 2.63 x 10 ** -1
------------------------
First step: align decimal points
Second step: add
3.25 x 10 ** 3
+ 0.000263 x 10 ** 3
---------------------------
3.250263 x 10 ** 3
(presumes use of infinite precision, without regard for accuracy)
Third step: normalize the result (already normalized!)
Example on fl pt. value given in binary:
S E F
.25 = 0 01111101 00000000000000000000000
100 = 0 10000101 10010000000000000000000
to add these fl. pt. representations,
step 1: align radix points
-> choose to shift the .25, since we want to increase it's exponent.
-> shift by 10000101
-01111101
---------------
00001000 (8) places.
with hidden bit and radix point shown, for clarity
0 01111101 00000000000000000000000 (original value)
0 01111110 10000000000000000000000 (shifted 1 place)
(note that hidden bit is shifted into msb of mantissa)
0 01111111 01000000000000000000000 (shifted 2 places)
0 10000000 00100000000000000000000 (shifted 3 places)
0 10000001 00010000000000000000000 (shifted 4 places)
0 10000010 00001000000000000000000 (shifted 5 places)
0 10000011 00000100000000000000000 (shifted 6 places)
0 10000100 00000010000000000000000 (shifted 7 places)
0 10000101 00000001000000000000000 (shifted 8 places)
step 2: add (don't forget the hidden bit for the 100)
SUBTRACTION
Like addition as far as alignment of radix points then the algorithm for subtraction of
sign mag. numbers takes over.
Before subtracting,
Compare magnitudes (don't forget the hidden bit!)
Change sign bit if order of operands is changed.
Don't forget to normalize number afterward.
EXAMPLE:
0 10000001 10010001000000000000000 (the representations)
- 0 10000000 11100000000000000000000
---------------------------------------------------------
step 1: align radix points
0 10000000 11100000000000000000000
becomes
0 10000001 11110000000000000000000 (notice hidden bit shifted in)
0 10000001 1.10010001000000000000000
- 0 10000001 0.11110000000000000000000
--------------------------------------------------------------
MULTIPLICATION:
example on decimal values given in scientific notation:
3.0 x 10 ** 1
+ 0.5 x 10 ** 2
-----------------
algorithm: multiply mantissas
add exponents
3.0 x 10 ** 1
+ 0.5 x 10 ** 2
-----------------
1.50 x 10 ** 3
0 10000100 0100
x 1 00111100 1100
--------------------------
mantissa multiplication: 1.0100
(don't forget hidden bit) x 1.1100
----------------
00000
00000
10100
10100
10100
-----------
1000110000
becomes 10.00110000
add exponents: always add true exponents
(otherwise the bias gets added in twice)
biased:
10000100
+ 00111100
-------------------
Decimal Digit 8421 Code 2421 Code 84-2-1 Code Excess 3 Code
The following table shows the 4-bit Gray codes corresponding to each 4-bit binary
code.
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 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
1.8.2 EBCDIC
The EBCDIC stands for Extended Binary Coded Decimal Interchange Code. IBM
invented this code to extend the Binary Coded Decimal which existed at that time. All
the IBM computers and peripherals use this code. It is an 8 bit code and therefore
can accommodate 256 characters. Below is given some characters of EBCDIC code
to get familiar with it.
Char EBCDIC HEX Char EBCDIC HEX Char EBCDIC HEX
A 1100 0001 C1 P 1101 0111 D7 4 1111 0100 F4
B 1100 0010 C2 Q 1101 1000 D8 5 1111 0101 F5
C 1100 0011 C3 R 1101 1001 D9 6 1111 0110 F6
D 1100 0100 C4 S 1110 0010 E2 7 1111 0111 F7
E 1100 0101 C5 T 1110 0011 E3 8 1111 1000 F8
F 1100 0110 C6 U 1110 0100 E4 9 1111 1001 F9
G 1100 0111 C7 V 1110 0101 E5 blank … …
H 1100 1000 C8 W 1110 0110 E6 . … …
I 1100 1001 C9 X 1110 0111 E7 ( … …
J 1101 0001 D1 Y 1110 1000 E8 + … …
K 1101 0010 D2 Z 1110 1001 E9 $ … …
L 1101 0011 D3 0 1111 0000 F0 * … …
M 1101 0100 D4 1 1111 0001 F1 ) … …
N 1101 0101 D5 2 1111 0010 F2 – … …
O 1101 0110 D6 3 1111 0011 F3 /
Error-Detecting codes
Whenever a message is transmitted, it may get scrambled by noise or data may get
corrupted. To avoid this, we use error-detecting codes which are additional data
added to a given digital message to help us detect if an error occurred during
transmission of the message. A simple example of error-detecting code is parity
check.
Error-Correcting codes
Along with error-detecting code, we can also pass some data to figure out the
original message from the corrupt message that we received. This type of code is
called an error-correcting code. Error-correcting codes also deploy the same strategy
as error-detecting codes but additionally, such codes also detect the exact location
of the corrupt bit.
In error-correcting codes, parity check has a simple way to detect errors along with a
sophisticated mechanism to determine the corrupt bit location. Once the corrupt bit is
located, its value is reverted (from 0 to 1 or 1 to 0) to get the original message
1.10 Universal Product Code
A UPC, short for universal product code, is a type of code printed on retail product
packaging to aid in identifying a particular item. It consists of two parts – the
machine-readable barcode, which is a series of unique black bars, and the unique
12-digit number beneath it.
The purpose of UPCs is to make it easy to identify product features, such as the
brand name, item, size, and color, when an item is scanned at checkout. In fact,
that’s why they were created in the first place – to speed up the checkout process at
grocery stores. UPCs are also helpful in tracking inventory within a store or
warehouse.
To obtain a UPC for use on a product a company has to first apply to become part of
the system. GS1 US, the Global Standards Organization, formerly known as the
Uniform Code Council, manages the assigning of UPCs within the US.
Parts of a UPC
After paying a fee to join, GS1 assigns a 6-digit manufacturer identification number,
which becomes the first six digits in the UPC on all the company’s products. That
number identifies the particular manufacturer of the item.
The next five digits of the UPC is called an item number. It refers to the actual
product itself. Within each company is a person responsible for issuing item
numbers, to ensure that the same number isn’t used more than once and that old
numbers referring to discontinued products are phased out.
Many consumer products have several variations, based on, for example, size,
flavor, or color. Each variety requires its own item number. So a box of 24 one-inch
nails has a different item number than a box of 24 two-inch nails, or a box of 50 one-
inch nails.
The last digit in the 12-digit UPC is called the check digit. It is the product of several
calculations – adding and multiplying several digits in the code – to confirm to the
checkout scanner that the UPC is valid. If the check digit code is incorrect, the UPC
won’t scan properly.
Advantages of UPCs
• UPCs have a number of advantages to businesses and consumers. Because
they make it possible for barcode scanners to immediately identify a product and its
associated price, UPCs improve speed.
• They improve efficiency and productivity, by eliminating the need to manually
enter product information.
• They also make it possible to track inventory much more accurately than hand
counting, to know when more product is needed on retail shelves or in warehouses.
Or when there is an issue with a particular product and consumers who purchased it
need to be alerted or a recall issued, UPCs allow products to be tracked through
production to distribution to retail stores and even into consumer homes.
1.11 Code conversion
1.11.1 Binary Arithmetic:
Binary arithmetic is essential part of all the digital computers and much other digital
system.
Binary Addition: It is a key for binary subtraction, multiplication, division. There are
four rules of binary addition.
Example − Addition
Binary Subtraction
Subtraction and Borrow, these two words will be used very frequently for the
binary subtraction. There are four rules of binary subtraction.
Example − Subtraction
Binary Multiplication
Binary multiplication is similar to decimal multiplication. It is simpler than decimal
multiplication because only 0s and 1s are involved. There are four rules of binary
multiplication.
Example − Multiplication
Binary Division
Binary division is similar to decimal division. It is called as the long division
procedure.
Example − Division
Octal Subtraction
The subtraction of octal numbers follows the same rules as the subtraction of
numbers in any other number system. The only variation is in borrowed number. In
the decimal system, you borrow a group of 10 10. In the binary system, you borrow a
group of 210. In the octal system you borrow a group of 810.
Example − Subtraction
Step 2 19FDE16 ((1 × 164) + (9 × 163) + (15 × 162) + (13 × 161) + (14 ×
160))10
Hexadecimal Subtraction
The subtraction of hexadecimal numbers follow the same rules as the subtraction of
numbers in any other number system. The only variation is in borrowed number. In
the decimal system, you borrow a group of 10 10. In the binary system, you borrow a
group of 210. In the hexadecimal system you borrow a group of 1610.
Example - Subtraction
There are many methods or techniques which can be used to convert code from
one format to another. We'll demonstrate here the following
Result
(11101)2 = (00101001)BCD
BCD to Binary Conversion
Steps
Step 1 -- Convert the BCD number to decimal.
Step 2 -- Convert decimal to binary.
Example − convert (00101001)BCD to Binary.
Step 1 - Convert to BCD
BCD Number − (00101001)BCD
Calculating Decimal Equivalent. Convert each four digit into a group and get
decimal equivalent for each group.
Step 1 29 / 2 14 1
Step 2 14 / 2 7 0
Step 3 7 / 2 3 1
Step 4 3 / 2 1 1
Step 5 1 / 2 0 1
1.12 Summary
Chapter - 1
Combinational Logic Circuits are circuits designed by using different types of logic
gates. A logic gate is a fundamental building block of any electronic circuit. In other
word Combinational Logic Circuits are memoryless digital logic circuits whose output
at any instant in time depends only on the combination of its inputs. Means these
circuits do not make use of any memory or storage device.
1
Combinational circuit consists of logic gates whose output at any time is determined
from the present combination of inputs. The logic gate is the most basic building
block of combinational logic circuit.
- Input variables
- Logic gates
- Output variables
The logic gates accept signals from inputs and output signals are generated
according to the logic circuits working in it. Binary information from the given data
transforms to preferred output data in this process. Both input and output are
apparently the binary signals, i.e. both the input and output signals are of two
probable states, logic ‘1’ and logic ‘0’. Logical function performed by a
combinational circuit is completely defined by a set of Boolean expressions.
Combinational logic circuits may be very simple or very complicated and any
combinational circuit can be implemented with only NAND and NOR gates as these
are classified as universal gates.
Design Procedure
At all combinational circuit can be designed by the following steps of design process-
2
1. Stated problem
The logic gates are combined in such a way that the output state depends
completely on the input states. Combinational logic circuits have no memory, timing
or feedback loops, there operation is prompt. A combinational logic circuit performs
an operation assigned logically by a Boolean expression or truth table.
The three main methods of specifying the function of a combinational logic circuit as-
1. Boolean Algebra – This forms the algebraic expression viewing the operation
of the logic circuit for each input variable whicheverTrue or False that results in a
logic ―1‖ output.
2. Truth Table – A truth table expresses the function of a logic gate by providing a
brief list that shows all the output states in tabular form for each possible
combination of input variable that the gate could meet.
3
Fig. : Combinational Circuit Diagram, Boolean Expression & truth Table
As combinational logic circuits are made up from discrete logic gates only, they can
also be considered as decision making circuits and combinational logic is nearby
combining logic gates together to process two or more signals in order to produce at
least one output signal according to the logical function of each logic gate. General
combinational circuits made up from individual logic gates that carry out a anticipated
application comprise Full and Half Adders Multiplexers, De-
multiplexers, Encoders, Decoders etc.
4
One of the greatest uses of combinational logic is in Multiplexer and De-multiplexer
type circuits. Here, multiple inputs or outputs are connected to a common signal
stripe and logic gates are used to decode an address to select a single data input or
output switch.
………………………………………………………………………………………………
Combinational Logic Circuits are made up from basic logic NAND, NOR or NOT
gates that are connected together to produce more complex switching circuits.
These logic gates are the building blocks of combinational logic circuits. An example
of a combinational circuit-Decoder, which converts the binary code data present at
its input into a number of diverse output lines, one at a time producing an equivalent
decimal code at its output.
The number of possible input states is equal to two to the power of the number of
inputs:
5
This increase in the number of possible input states obviously allows for more
complex gate performance. Instead of simply inverting a single ―high‖ or ―low‖ logic
level, the output of the gate will be determined by whatsoever combination of 1‘s and
0‘s is present at the input stations.
Since many combinations are possible with just a limited input stations, there are
many different types of multiple-input gates, unlike single-input gates which can
simply be inverters. Each basic gate type will be shown as its standard symbol, truth
table, andoperation.
a) AND Gate
b) NAND Gate
c) Negative AND Gate
d) OR Gate
e) NOR Gate
f) Negative OR Gate
g) Exclusive OR Gate
h) Encoder
i) Multiplexer
a) AND Gate
The simple multiple-input gates to recognize is the AND gate, the output of this gate
will be ―high‖ (1) if and only if all inputs are ―high‖ (1). If any input(s) is ―low‖ (0), the
output is certain to be in a ―low‖ state.
Two input AND gate Three input AND gate Truth Table
6
AND Gate Circuit Operation
The truth table means in practical terms is shown in the following sequence as, with
the 2-input AND gate exposed to all possibilities of input logic levels. An LED
provides visual signal of the output logic level.
Circuit Diagram
It is only with all inputs raised to ―high‖ logic levels that the AND gate‘s output goes
―high,‖ thus stimulating the LED for only one out of the four input combination states.
b) NAND Gate
A distinction on the idea of the AND gate is called the NAND gate. The term ―NAND‖
is a verbal contraction of the words NOT and AND. Fundamentally, a NAND gate
performs the same as an AND gate with a NOT gate connected to the output
terminal. To represent this output signal inversion, the NAND gate symbol has a
bubble on the output line.The truth table for a NAND gate is as one might expect,
preciselyopposite as that of an AND gate
7
As with AND gates, NAND gates are made with more than two inputs. In such cases,
the same over-allstandardrelates: the output will be ―low‖ (0) if and only if all inputs
are ―high‖ (1). If any input is ―low‖ (0), the output will go ―high‖ (1).
A Negative-AND gate purposes the same as an AND gate with all its inputs inverted
(connected through NOT gates). In trust with standard gate symbol convention,
these inverted inputs are showed by bubbles. Opposing to most publics‘ first nature,
the logical conduct of a Negative-AND gate is not the same as a NAND gate. Its truth
table, essentially, is matching to a NOR gate:
d) OR Gate
Next gate to study is the OR gate, so-called because the output of this gate will be
―high‖ (1) if any of the inputs are ―high‖ (1). The output of an OR gate goes ―low‖ (0) if
and only if all inputs are ―low‖ (0).
8
A two-input OR gate‘s truth table appearances like the following sequence of
drawingsproves the OR gate‘s function, with the 2-inputs undergoing all possible logic levels.
An LED delivers visual indication of the gate‘s output logic level
Circuit Diagram
A condition of any input being outstretched to a ―high‖ logic level makes the OR
gate‘s output go ―high,‖ thus stimulating the LED for three out of the four input
combination states.
e) NOR gate
The NOR gate is an OR gate with its output inverted, just like a NAND gate is an
AND gate with an inverted output.
9
NOR gates, like all the other multiple-input gates realized thus outlying, can be
synthetic with more than two inputs. Still, the same logical standard applies. The
output goes ―low‖ (0) if any of the inputs are made ―high‖ (1). The output is ―high‖ (1)
only when all inputs are ―low‖ (0
e) Negative-OR Gate
A Negative-OR gate functions the same as an OR gate with all its inputs inverted. In
possession with standard gate symbol convention, these inverted inputs are showed
by bubbles. The performance and truth table of a Negative-OR gate is the same as
for a NAND gate:
e) Exclusive OR Gate
This gate is direct variations on three basic functions- AND, OR, and NOT. The
Exclusive-OR gate, however, is approximatelyfairly different. Exclusive-OR gates
output a ―high‖ (1) logic level if the inputs are at different logic levels, either 0 and 1
10
or 1 and 0. Contrariwise, the output a ―low‖ (0) logic level if the inputs are at the
same logic levels.
The Exclusive-OR ( XOR) gate has both a symbol and a truth table pattern that is
distinctive:
There are corresponding circuits for an Exclusive-OR gate made up of AND, OR,
and NOT gates, just as there were for NAND, NOR, and the negative-input gates. A
slightly direct method to simulating an Exclusive-OR gate is to start with a regular
OR gate, then add additional gates to prevent the output from going ―high‖ (1) when
both inputs are ―high‖ (1):
h) Encoder
11
It has 2n input lines, only one which ‗1‘ is active at any time and ‘n‗output lines. It
encodes one of the active inputs to a coded binary output with ‘n‗ bits. In an encoder,
the number of outputs is less than the number of inputs.
a) Octal-to-Binary Encoder
It has eight inputs and the three outputs that produce the equivalent binary number.
It is assumed that only one input has a value of ‗1‘ at any given time.
12
Fig. Circuit diagram of Octal-to-Binary Encoder
Alternative problem in the octal-to-binary encoder is that an output with all 0‗s is
generated when all the inputs are 0; this output is same as when D0 is equal to 1.
The discrepancy can be resolved by providing one more output to show that at least
one input is equal to 1.
Fig. multiplexer
13
j) 2-to-1- line Multiplexer
This circuit has two data input lines, one output line and one selection line. When S=
0, the upper AND gate is enabled and I0 has a path to the output.
When S=1, the lower AND gate is enabled and I1 has a path to the output.
The multiplexer acts like an electronic switch that selects one of the two sources.
14
Fig. Circuit diagram of 4-to-1-line Multiplexer
To establish the circuit operation, consider the case when S1S0= 10. The AND gate
associated with input I2 has two of its inputs equal to 1 and the third input connected
to I2. The other three AND gates have at least one input equal to 0, which makes
their outputs equal to 0. The OR output is now equal to the value of I 2, providing a
path from the selected input to the output.
The data output is equal to I0 only if S1= 0 and S0= 0; Y= I0S1‗S0‗. The data output is
equal to I1 only if S1= 0 and S0= 1; Y= I1S1‗S0. The data output is equal to I2 only if
S1= 1 and S0= 0; Y= I2S1S0‗. The data output is equal to I3 only if S1= 1 and S0= 1; Y=
I3S1S0.
When these terms are ORed, the total expression for the data output is,
Y= I0S1‘S0‘+ I1S1‘S0 +I2S1S0‘+ I3S1S0.
15
As in decoder, multiplexers may have an enable input to control the operation of the
unit. When the enable input is in the inactive state, the outputs are disabled, and
when it is in the active state, the circuit functions as a usual multiplexer.
………………………………………………………………………………………….............
.
A combinational circuit has output values that depend only on the current input
values irrespective of presence or absence of responses.Circuits that implement
these functions may be combined into expensive single circuit with multiple outputs
by sharing some gates desirable in the implementation of the single functions.
Boolean expressions are used to output a Boolean function of number of variables.
There are circuits which have multiple outputs and multiple inputs. Conventional
combinational circuits are normally acyclic but these circuits can have feedbacks
(cycles) which will give more minimized expressions as compared to usual
combinational circuits. Thoughtfulintegration of such cycles or feedbacks in usual
combinational circuits eventually results in reduction in number of literals in the
expression of the combinational circuits. The reduction in literal counts decreases
the number of gates required to implement the expressions of the combinational
circuits. Hence, the decrease in number of gates leads to reduction in transistor
counts. A cyclic combinational circuit is defined as the circuit whose output depends
on present inputs only, but at the same time contains one or more feedbacks
(cycles)
Types of multiple-output circuits
i) Decoder
A decoder is a combinational circuit that converts binary information from ‗‘n‗ input
lines to a maximum of ‗2n unique output lines. The general structure of decoder
circuit is
16
Fig. Decoder block diagram
A binary decoder has ‘n‗ bit binary input and a one activated output out of 2 n outputs.
A binary decoder is used when it is necessary to activate exactly one of 2 n outputs
based on an n-bit input value.
17
Here the 2 inputs are decoded into 4 outputs, each output signifying one of the
minterms of the two input variables.
As shown in the truth table, if enable input is 1 (EN= 1) only one of the outputs (Y 0 –
Y3), is active for a given input.
The output Y0 is active, i.e., Y0= 1 when inputs A= B= 0, Y1 is active when inputs, A=
0 and B= 1,
Y2 is active, when input A= 1 and B= 0, Y3 is active, when inputs A= B= 1.
A 3-to-8 line decoder has three inputs (A, B, C) and eight outputs (Y0- Y7). Based on
the 3 inputs one of the eight outputs is selected.
The three inputs are decoded into eight outputs, each output signifying one of the
minterms of the 3-input variables. This decoder is used for binary-to-octal
conversion. The input variables may represent a binary number and the outputs will
signify the eight digits in the octal number system. The output variables are mutually
exclusive because only one output can be equal to 1 at any one time. The output line
whose value is equal to 1 signifies the minterm equivalent of the binary number
presently accessible in the input lines.
18
Fig.Truth table 3- to-8 Line Decoder
ii) Demultiplexer
19
Fig. Demultiplexer circuit
The block diagram of a demultiplexer which is opposite to a multiplexer in its
operation is shown above. The circuit has one input signal, ‘n‗ select signals and 2n
output signals. The select inputs determine to which output the data input will be
connected. As the serial data is changed to parallel data, i.e., the input produced to
appear on one of the n output lines, the demultiplexer is also called a ―data
distributer.
i) 1-to-4 Demultiplexer:
A 1-to-4 demultiplexer has a single input, Din, four outputs (Y0 to Y3) and two select
inputs (S1 and S0).
20
Table: Input /Output of 1-to-4 Demultiplexer
From the truth table, it is clear that the data input, Din is connected to the output Y 0,
when S1= 0 and S0= 0 and the data input is connected to output Y1 when S1= 0 and
S0= 1. Similarly, the data input is connected to output Y2 and Y3 when S1= 1 and S0=
0 and when S1= 1 and S0= 1, respectively. From the truth table, the expression for
outputs can be written as follows,
Y0= S1‘S0‘Din
Y1= S1‘S0Din
Y2= S1S0‘Din
Y3= S1S0Din
21
Now, using the above expressions, a 1-to-4 demultiplexer can be applied using four
3-input AND gates and two NOT gates. Here, the input data line Din, is connected to
all the AND gates. The two select lines S1, S0 enable only one gate at a time
and the data that appears on the input line passes through the selected gate to the
associated output line.
b)1-to-8 Demultiplexer
A 1-to-8 demultiplexer has a single input, Din, eight outputs (Y0 to Y7) and three
select inputs (S2, S1 and S0). It distributes one input line to eight output lines based
on the select inputs. The truth table of 1-to-8 demultiplexer is shown below.
From the above truth table, it is clear that the data input is connected with one of the
eight outputs based on the select inputs. Now from this truth table, the expression for
eight outputs can be written as follows:
Y0= S2‗S1‗S0‗Din Y4= S2 S1‗S0‗Din
Y1= S2‗S1‗S0Din Y5= S2 S1‗S0Din
Y2= S2‗S1S0‗Din Y6= S2 S1S0‗Din
Y3= S2‗S1S0Din Y7= S2S1S0Din
Now using the above expressions, the logic diagram of a 1-to-8 demultiplexer can be
drawn as shown below. Here, the single data line, Din is connected to all the eight
AND gates, but only one of the eight AND gates will be enabled by the select input
lines. For example, if S2S1S0= 000, then only AND gate-0 will be enabled and
thereby the data input, Din will appear at Y0. Similarly, the different combinations of
the select inputs, the input Din will appear at the respective output.
22
Fig.Circuit diagram 1-to-8 Demultiplexer
………………………………………………………………………………………………
Introduction
The converters, which convert one code to another code are called as code
converters. These code converters basically consist of Logic gates. The availability
of a large variety of codes for the same distinct elements of information outcomes in
the use of different codes by different digital systems. It is necessary to use the
output of one system as the input to the other. Thus a conversion circuit must be
introduced between the two systems if each uses different codes for the same
information. A code converter is a circuit that makes the two systems well-matched
even though each uses the different codes. Code converters are used for protecting
private information from detectives. They are also used to enhance data portability
and tractability. Code converters have found applications in algorithm generation
and communication. Some of the major codes are as follows:
23
Binary Code: A symbolic representation of data/information is called code. The
base or radix of the binary number is 2. Hence, it has two independent symbols.
The symbols used are 0 and 1. A binary digit is called a bit. A binary number
consists of sequence of bits, each of which is either a 0 or 1. Each bit carries a
weight based on its position comparative to the binary point. The weight of each bit
position is one power of 2 greater than the weight of the position to its immediate
right.
Code Converters Design and Implementation done with the help of following way as
below-
c) Parity Checker
Let us implement a converter, which converts a 4-bit binary code WXYZ into its
equivalent Gray code ABCD.
The following table shows the Truth table of a 4-bit binary code to Gray code
converter.
0000 0000
0001 0001
0010 0011
24
0011 0010
0100 0110
0101 0111
0110 0101
0111 0100
1000 1100
1001 1101
1010 1111
1011 1110
1100 1010
1101 1011
1110 1001
1111 1000
Boolean Expression
From Truth table, we can write the Boolean functions for each output bit of Gray
code as below.
A=∑m(8,9,10,11,12,13,14,15)
B=∑m(4,5,6,7,8,9,10,11)
C=∑m(2,3,4,5,10,11,12,13)
D=∑m(1,2,5,6,9,10,13,14)
K-Map
The following figure shows the 4 variable K-Map for simplifying Boolean
function, A.
25
Fig. 4 variable K-Maps
The following figure shows the 4 variable K-Map for simplifying Boolean function, B.
There are two groups of 4 adjacent ones. After grouping, we will get B as
B=W′X+WX′=W⊕XB=W′X+WX′=W⊕X
Similarly, we will get the following Boolean functions for C & D after simplifying.
C=X′Y+XY′=X⊕YC=X′Y+XY′=X⊕Y
D=Y′Z+YZ′=Y⊕ZD=Y′Z+YZ′=Y⊕Z
Circuit Diagram
The following figure shows the circuit diagram of 4-bit binary code to Gray code
converter.
26
Fig. 4-bit binary code to Gray code converter.
Since the outputs depend only on the present inputs, this 4-bit Binary code to Gray
code converter is a combinational circuit. Similarly, you can implement other code
converters.
There are two types of parity bit generators based on the type of parity bit being
generated. Even parity generator generates an even parity bit. Similarly, odd parity
generator generates an odd parity bit.
Let us implement an even parity generator for a 3-bit binary input, WXY. It
generates an even parity bit, P. If odd number of ones present in the input, then
even parity bit, P should be ‗1‘ so that the resultant word contains even number of
ones. For other combinations of input, even parity bit, P should be ‗0‘. The following
table shows the Truth table of even parity generator.
Binary Even
Input Parity
WXY bit P
000 0
001 1
010 1
27
011 0
100 1
101 0
110 0
111 1
From the above Truth table, we can write the Boolean function for even parity bit as
P=W′X′Y+W′XY′+WX′Y′+WXYP=W′X′Y+W′XY′+WX′Y′+WXY
⇒P=W′(X′Y+XY′)+W(X′Y′+XY)⇒P=W′(X′Y+XY′)+W(X′Y′+XY)
⇒P=W′(X⊕Y)+W(X⊕Y)′=W⊕X⊕Y⇒P=W′(X⊕Y)+W(X⊕Y)′=W⊕X⊕Y
The following figure shows the circuit diagram of even parity generator.
This circuit consists of two Exclusive-OR gates having two inputs each. First
Exclusive OR gate having two inputs W & X and produces an output W ⊕ X. This
output is given as one input of second Exclusive-OR gate. The other input of this
second Exclusive-OR gate is Y and produces an output of W ⊕ X ⊕ Y.
If even number of ones present in the input, then odd parity bit, P should be ‗1‘ so
that the resultant word contains odd number of ones. For other combinations of
input, odd parity bit, P should be ‗0‘.Follow the same procedure of even parity
generator for implementing odd parity generator. The circuit diagram of odd parity
generator is shown in the following figure.
28
Fig: circuit diagram of odd parity generator
The above circuit diagram consists of Ex-OR gate in first level and Ex-NOR gate in
second level. Since the odd parity is just opposite to even parity, we can place an
inverter at the output of even parity generator. In that case, the first and second
levels contain an Ex-OR gate in each level and third level consist of an inverter.
c) Parity Checker
There are two types of parity checkers based on the type of parity has to be
checked. Even parity checker checks error in the transmitted data, which contains
message bits along with even parity. Similarly, odd parity checker checks error in
the transmitted data, which contains message bits along with odd parity.
Let us implement an even parity checker circuit. Consider a 3-bit binary input, WXY
is transmitted along with an even parity bit, P. So, the resultant word data contains 4
bits, which will be received as the input of even parity checker.
It generates an even parity check bit, E. This bit will be zero, if the received data
contains an even number of ones. That means, there is no error in the received
data. This even parity check bit will be one, if the received data contains an odd
number of ones. That means, there is an error in the received data.The following
table shows the Truth table of an even parity checker.
29
0000 0
0001 1
0010 1
0011 0
0100 1
0101 0
0110 0
0111 1
1000 1
1001 0
1010 0
1011 1
1100 0
1101 1
1110 1
1111 0
30
From the above Truth table, we can perceive that the even parity check bit value is
‗1‘, when odd number of ones present in the received data. That means the Boolean
function of even parity check bit is an odd function. Exclusive-OR function satisfies
this condition. Hence, we can directly write the Boolean function of even parity
check bit as
E=W⊕X⊕Y⊕PE=W⊕X⊕Y⊕P
The following figure shows the circuit diagram of even parity checker.
This circuit consists of three Exclusive-OR gates having two inputs each. The first
level gates produce outputs of W⊕XW⊕X & Y⊕PY⊕P. The Exclusive-OR gate,
which is in second level produces an output of W⊕X⊕Y⊕PW⊕X⊕Y⊕P
Consider a 3-bit binary input, WXY is transmitted along with odd parity bit, P. So,
the resultant word data contains 4 bits, which will be received as the input of odd
parity checker.
It generates an odd parity check bit, E. This bit will be zero, if the received data
contains an odd number of ones. That means, there is no error in the received data.
This odd parity check bit will be one, if the received data contains even number of
ones. That means, there is an error in the received data.Follow the same procedure
of an even parity checker for implementing an odd parity checker. The circuit
diagram of odd parity checker is shown in the following figure.
31
Fig: circuit diagram of odd parity checker
The above circuit diagram consists of Ex-OR gates in first level and Ex-NOR gate in
second level. Since the odd parity is just opposite to even parity, we can place an
inverter at the output of even parity checker. In that case, the first, second and third
levels contain two Ex-OR gates, one Ex-OR gate and one inverter correspondingly.
…………………………………………………………………………………………………
32
Chapter - 2
3.4.2 Adder
3.4.1 Introduction
The output of combinational circuit at any instant of time, depends only on the
stages present at input stations.
The combinational circuit do not use any memory. The previous state of input
does not have any effect on the present state of the circuit.
A combinational circuit can have an ‗n‘ number of inputs and ‗m‘ number of
outputs.
3.4.2 Adder
a) Half Adder
33
Introduction
Half adder is a combinational logic circuit with two inputs and two outputs.
The half adder circuit is designed to add two single bit binary number A and
B. It is the basic building block for addition of two single bit numbers. This
circuit has two outputs carry and sum.
b) Full Adder
Introduction
Full adder is designed to overcome the drawback of Half Adder circuit. It can
add two one-bit numbers A and B, and carry C. The full adder is a three input
and two output combinational circuit.
34
N-Bit Parallel Adder
Introduction
The Full Adder is capable of adding only two single digit binary number along with a
carry input. But in practical we need to add binary numbers which are much longer
than just one bit. To add two n-bit binary numbers, we need to use the n-bit parallel
adder. It uses a number of full adders in cataract. The carry output of the previous
full adder is connected to carry input of the next full adder.
Introduction
In the block diagram, A0 and B0 represent the Least Significant Bits(LSB) of the four
bit words A and B. Hence Full Adder-0 is the lowest stage. Hence its Cin has been
permanently made 0. The rest of the connections are precisely same as those of n-
bit parallel adder is shown in fig. The four bit parallel adder is a very common logic
circuit.
Block diagram
Introduction
A 4-bit binary adder that is accomplished of adding two 4-bit words having
a BCD (binary-coded decimal) format. The result of the addition is a BCD-format 4-
35
bit output word, demonstrating the decimal sum of the addend and augend, and a
carry that is generated if this sum exceeds a decimal value of 9.
A BCD 1-digit adder is a circuit that adds two BCD digits in parallel and also
produces the Sum digit in BCD along with the essential correction logic. It can be
seen that a 4-bit binary adder is used originally to add two BCD digits with a carry-
input. When the binary sum is less than or equal to 9, it also correctly represents
the sum in BCD. When the binary sum is greater than 9, however, it does not
represent the correct BCD sum. The sum in BCD is to be attained by adding 6 to it.
In the BCD representation system each digit is encoded into its binary equivalent
with four (4) bits.
Decimal BCD
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
Observe that only 10 of the 16 possible bit-patterns are used in BCD. That means
the remaining 6 patterns could be treated as don't-care cases. For the arithmetic
addition of two decimal digits in BCD, the maximum value that may be produced as
the result is 9 + 9 + 1 = 19 (two largest operands plus the carry). If we try to add two
decimal digits in BCD with a 4-bit ripple-carry adder we will get a binary sum
36
extending from 0 to 19. When the binary sum is less than or equal to 9, it may
represents the sum in BCD. When the binary sum is greater than 9, however, it
does not represent the correct BCD sum. The sum in BCD is to be obtained by
adding 6 to it.
1) 7 + 4
2) 3 + 2
3) 9 + 9
The above examples should benefit you realize when the conversion is necessary
and what should be done to perform the conversion correctly.
Decimal
Inputs Binary Sum BCD Sum
Number
Cin X Y Cout Z Cout S
0 0000 0000 0 0000 0 0000 0
0 0000 0001 0 0001 0 0001 1
37
0 0001 0001
0 0101 0100
0 0101 0101
0 0101 0110
0 1000 1000 1 0000 1 0110 16
0 1000 1001
0 1001 1001
1 1001 1001
Table: Truth table - 1-digit BCD adder
Upon an examination of the 1-digit BCD adder block diagram shown above, you
should notice that the only block you do not have a circuit for is the ―Sum >
9”? block. Having the circuit just excitingly appear on your circuit diagrams.
The excess-3 code is a non-weighted code used to express code used to express
decimal numbers. It is a self-complementary Binary Coded Decimal (BCD) code and
numerical system which has partial representation.
The primary benefit of excess-3 coding over non-biased coding is that a decimal
number can be nines' complemented as easily as a binary number can be ones'
complemented, just by inverting all bits.Excess-3 is a modified form of a BCD number.
The excess-3 code can be derived from the natural BCD code by adding 3 to each coded
number.
For example, decimal 12 can be represented in BCD as 0001 0010. Now adding 3 to
each digit we get excess-3 code as 0100 0101 (12 in decimal). With this information
the truth table for BCD to Excess-3 code converter can be determined as-
38
Table: Truth Table - Excess-3 Adder
From the truth table, the logic expression for the Excess-3 code outputs can be
written as,
E3= Σm (5, 6, 7, 8, 9) + Σd (10, 11, 12, 13, 14, 15)
E2= Σm (1, 2, 3, 4, 9) + Σd (10, 11, 12, 13, 14, 15)
E1= Σm (0, 3, 4, 7, 8) + Σd (10, 11, 12, 13, 14, 15)
E0= Σm (0, 2, 4, 6, 8) + Σd (10, 11, 12, 13, 14, 15)
K-map Simplification
39
Circuit Diagram
Introduction
The subtraction can be carried out by taking the 1's or 2's complement of the
number to be subtracted. For example we can perform the subtraction (A-B) by
40
adding either 1's or 2's complement of B to A. That means we can use a binary
adder to perform the binary subtraction.
Introduction
The number to be subtracted (B) is first accepted through inverters to obtain its 1's
complement. The 4-bit adder then adds A and 2's complement of B to produce the
subtraction. S3 S2 S1 S0 represents the result of binary subtraction (A-B) and carry
output Cout represents the polarity of the result. If A > B then Cout = 0 and the result
of binary form (A-B) then Cout = 1 and the result is in the 2's complement form.
Block diagram
Types of Subtractors
a) HalfSubtractors
Introduction
Half subtractor is a combination circuit with two inputs and two outputs. It produces
the difference between the two binary bits at the input and also produces an output
to indicate if a 1 has been borrowed. In the subtraction (A-B), A is called as
Minuend bit and B is called as Subtrahend bit.
41
Truth Table Circuit Diagram
a) Full Subtractors
Introduction
The drawback of a half subtractor is overcome by full subtractor. The full subtractor
is a combinational circuit with three inputs A,B,C and two output D and C'. A is the
'minuend', B is 'subtrahend', C is the 'borrow' produced by the previous stage, D is
the difference output and C' is the borrow output.
Introduction
42
A Binary Coded Decimal (BCD) adder is a circuit which adds two 4-bit BCD numbers
in parallel and produces a 4-bit BCD result. The block diagram of
conventional BCD adder. The circuit must include the correction logic to produce
valid BCD output.subtractor an electronic logic circuit for calculating the difference
between two binary numbers, the minuend and the number to be subtracted, the
subtrahend . A full subtractor performs this calculation with three inputs- subtrahend
bit, minuend bit, and borrow bit
BCD Subtraction:
Addition of signed BCD numbers can be accomplished by using 9‘s or 10‘s
complement methods. A negative BCD number can be expressed by taking the 9‘s
or 10‘s complement.The BCD Subtraction using 9‘s Complement and BCD
Subtraction using 10‘s Complement numbers and BCD Subtraction process using it.
9s Complement
The 9‘s complement of a decimal number is found by subtracting each digit in the
number from 9. The 9‘s complement of each of the decimal digits is as follows :
Table:9s Complement
43
In 9s Complement subtraction when 9s Complement of smaller number is added to
the larger number carry is produced. It is essential to add this carry to the result.
When larger number is subtracted from smaller one, there is no carry, and the result
is in 9s complement form and negative. This is demonstrated in following ways as-
The 10‘s complement of a decimal number is equal to the 9’s complement plus 1.
44
From the above examples we can review steps for 9s Complement BCD subtraction
as follows:
45
Fig.4 bit BCD substractor using 9‘s complement
46
Above figure demonstrate the logic diagram of the circuit to implement above stated
steps to perform BCD subtraction using 9s Complement method. First binary adder
finds the 9s Complement of the negative number. It does this by inverting each bit of
BCD number and adding 10 (1 0 1 02) to it. Let us find the 9‘s complement of 2
Next two 4-bit binary adders accomplish the BCD addition. The last adder finds the
9s Complement of the result if carry is not generated after BCD addition otherwise it
adds carry in the result.From the above examples we can summarize steps for 10s
complement BCD subtraction as -
47
Fig.4 bit BCD substractorusing 10‘s complement
48
The logic diagram of the circuit to implement above stated steps to perform
subtraction using 10s Complement method. First binary adder finds the 10s
Complement of the negative number (9‘s complement + 1). Next two 4-bit binary
adders perform the BCD addition. Lastly, last 4-bit binary adder finds the 10‘s
complement of the number if carry is not generated after BCD addition.
…………………………………………………………………………………………………
Chapter - 3
3.5 Multiplexer
Introduction
Multiplexer is a distinct type of combinational circuit. There are ‗n‘data inputs, one
output and ‗m‘ select inputs with 2m = ‗n‘. It is a digital circuit which selects one of
the ‗n‘ data inputs and routes it to the output. The selection of one of the ‗n‘ inputs is
done by the selected inputs. Depending on the digital code applied at the selected
inputs, one out of ‗n‘ data sources is selected and transmitted to the single output
‗Y‘. ‗E‘ is called the strobe or enable input which is useful for the cascading. It is
commonly an active low terminal that means it will complete the required operation
when it is low.
Block diagram
Types of Multiplexer
49
Multiplexers come in multiple variations
a) 2 : 1 multiplexer
b) 4 : 1 multiplexer
c) 16 : 1 multiplexer
d) 32 : 1 multiplexer
a) 2 : 1 multiplexer
Block Diagram
Fig.2:1 multiplexer
Truth Table
Demultiplexers
Introduction
50
A demultiplexer achieves the reverse operation of a multiplexer i.e. it receives one
input and distributes it over several outputs. It has only one input, n outputs, m
select input. At a time only one output line is selected by the select lines and the
input is transmitted to the selected output line.
Types of demultiplexer
a) 1 : 2 demultiplexer
b) 1 : 4 demultiplexer
c) 1 : 16 demultiplexer
d) 1 : 32 demultiplexer
a) 1 : 2 demultiplexer
Block diagram
Truth Table
51
Table : 1:2 Demux truth table
…………………………………………………………………………………………………..
......
3.6 Comparator
Introduction
Usage
This logic circuit is used for testing whether the binary number at one input is greater
than or less than or equal to another binary number. In other word, Comparator is a
very useful combinational circuit capable of comparing two numbers as input in
binary form and determines whether one number is greater than, less than or equal
to other number. Comparators can also be used as window detectors.
A comparator is used to compare two voltages and determine whether a given input
voltage is under voltage or over voltage. Comparators are used in central processing
unit (CPUs) and microcontrollers (MCUs).
Types of Comparators
52
1. Equality or Identity Comparator
Identity Comparator is a digital comparator that has only one output. The
circuit of the equality comparator is made up from an exclusive NOR gate
(XNOR) per pair of input bits. If the two inputs are equal (both logic 1 or both
logic 0) then a logic 1 is output
Equality
The binary numbers A and B will be equal if all the pairs of significant digits of both
numbers are equal, i.e.,
53
Since the numbers are binary, the digits are either 0 or 1 and the Boolean function
for equality of any two digits Ai and Bi can be expressed as
So the equality condition of A and B can be implemented using the AND operation
as
The binary variable (A=B) is 1 only if all pairs of digits of the two numbers are equal
To manually determine the greater of two binary numbers, you have inspect the
relative magnitudes of pairs of significant digits, starting from the most significant bit,
gradually proceeding towards lower significant bits until an inequality is found. When
an inequality is found, if the corresponding bit of A is 1 and that of B is 0 then we
conclude that A>B.
54
(A>B) and (A < B) are output binary variables, which are equal to 1 when A>B or
A<B respectively.
List of References
1. https://study.com/academy/lesson/basic-combinational-circuits-types-
examples.html
2. https://www.electronics-tutorials.ws/combination/comb_1.html
3. https://www.tutorialspoint.com/computer_logical_organization/combinational_
circuits.htm
4. https://www.tutorialspoint.com/digital_circuits/digital_arithmetic_circuits.htm
5. https://www.allaboutcircuits.com/textbook/digital/chpt-3/multiple-input-gates/
55
UNIT IV
Chapter 1: Multiplexer and Demultiplexer
Unit Structure
9.0 Multiplexer
9.1 Demultiplexer
9.2 Decoder
9.3 Encoder
9.4 Arithmetic Logic Unit
9.5 Questions
9.6 Further Reading
9.0 Objective
This chapter takes a comprehensive look at another class of building blocks used to design
more complex combinational circuits, and covers building blocks such as multiplexers and
demultiplexers and other derived devices such as encoders and decoders. Particular
emphasis is given to the operational basics and use of these devices to design more
complex combinational circuits.
9.1 Multiplexer
Select lines
D3
D2
D1
D0
In other words, for S1S0 = 00, the first AND gate to which D0 is connected remains active
and equal to D0 and all other AND gate are inactive with output held at logic 0.
Thus, multiplexer output Y is same as D0.
If D0 =0, Y=0 and if D0 = 1, Y= 1.
Each of the four input lines, D0 to D3, is applied to one input of an AND gate. Selection lines
s1 and s0 are decoded to select a particular AND gate. The function table in the figure lists
the input-to-output path for each possible bit combination of the selection lines.
To demonstrate the circuit operation, consider the case when s1s0 = 10. The AND gate
associated with input D2 has two of its inputs equal to 1 and the third input connected to D2.
The other three AND gates have at least one input equal to 0, which makes their output
equal to 0.
The OR-gate output is now equal to the value of D2, thus providing a path from the selected
input to the output.
S1 S0
9.2Demultiplexer
Select lines
Fig.4. Demultiplexer Block diagram
Demultiplexer has single data input (D) and n outputs (Y0 – Yn-1).
While number of Select lines depends on number of outputs.
If ‘n’ is number of outputs and ‘m’ is number of select lines then the relation between
them is given by n = 2m.
1 to 4 Demultiplexer
From the truth table it is clear that, when S1=0 and S0= 0, the data input is connected to
output Y0 and when S1= 0 and S0=1, then the data input is connected to output Y1.
Similarly, other outputs are connected to the input for other two combinations of select lines.
̅ ̅
̅
S1 S0
2 to 4 Decoder
Y0
S0
2 to 4 Y1
Decoder
S1 Y2
Y3
The two inputs are decoded into four outputs, each output representing one of the minterms
of the 2-input variables. The two inverters provide the complement of the inputs, and each
one of the four AND gates generates one of the minterms. A particular application of this
decoder would be a binary-to-octal conversion. The input variables may represent a binary
number, and the outputs will then represent the four digits. However, a 2-to-4 line decoder
can be used for decoding any 2-bit code to provide four outputs, one for each element of
the code.
̅ ̅
Inputs Outputs
S1 S0 Y3 Y2 Y1 Y0
X X 0 0 0 0
0 0 0 0 0 1
0 1 0 0 1 0
1 0 0 1 0 0
1 1 1 0 0 0
Y0
Y1
Y2
Y3
Encoder
An Encoder is a combinational circuit that performs the reverse operation of Decoder.
An encoder converts an active input signal into a coded output signal
There are n input lines, only one of which is active.
Internal logic within the encoder converts this active input to a coded binary output with m
bits.
Decimal-to-BCD Encoder
Figure shows a common type of encoder-the decimal-to-BCD encoder.
The switches are push-button switches like those of a pocket calculator.
When button 3 is pressed, the C and D OR gates have high inputs; therefore, the output is
ABCD=0011
If button 5 is pressed, the output becomes
ABCD=0101
When switch 9 is pressed,
ABCD= 1001
A B C D
Encoders Decoders
Encoders may have more than one input Decoders may have more than one input
line active and may have more than one line active at any given time but only one
output line active at any given time output line will be active
Number of input lines is more than number Number of output lines is more than
of output lines number of input lines
Number of input lines = 2Number of output lines Number of output lines = 2Number of input lines
Encoder is logic device used to create Decoder is logic device used to decode
binary code for given decimal input binary input to give decimal output
Priority Encoder
A priority encoder is a practical form of an encoder. The encoders available in IC form are
all priority encoders. In this type of encoder, a priority is assigned to each input so that,
when more than one input is simultaneously active, the input with the highest priority is
encoded.
In previous cases we saw that if two or more input lines are activated then output code is
invalid. Therefore we have to modify the circuit. The modification is we have to define the
priority of given number. It means whenever two or more inputs are applied at a time,
internal hardware will check this condition and if priority is set such that higher input is to be
taken into account and remaining are considered as don’t care then output code that will
appear is of higher input.
9.5 Questions
1. Define Multiplexer.
2. Write short note on 4 –to- 1 Channel Multiplexer.
3. Explain 4- to -2 Channel Multiplexer With help of suitable diagram.
4. What is De-Multiplexer?
5. What is Digital Encoder? Explain 4- to -2 Bit Binary Encoder with help of suitable
diagram.
6. What is Priority Encoder? Explain 8- to -3 Priority Encoder with the help of suitable
diagram.
7. List and Explain Applications of Encoder.
8. Explain in detail Binary Decoder.
Chapter 2:
Flip-flops
2.0 Objective
2.1 Introduction to Sequential Circuits
2.2 SR Flip-Flop
2.3 D Flip-Flop
2.4 JK Flip-Flop
2.5 Race Around Condition
2.6 Master Slave JK Flip-Flop
2.7 T Flip-Flop
2.8 Conversion of flip-flop from one type to another
2.9 Applications of Flip-Flop
2.0 Objective:
After completing this chapter, you will be able to:
Understand the basics of Sequential Logic Circuits.
Learn different types of Flips –Flops, their working and applications with the help of
suitable diagrams.
2.1 Introduction to Sequential Circuits:
Sequential Circuits: Digital electronics is classified into combinational logic and sequential
logic. Combinational logic output depends on the inputs levels, whereas sequential logic
output depends on stored levels and also the input levels.
Register: The register is just m latches in a row and is able to store an m-bit word; that is,
the register is a device that stores one memory word. A computer‟s memory is just a very
large array of registers.
Flip-flop:
In the electronics world, a flip-flop is a type of circuit that has two states (i.e., on or off, 1 or
0). These circuits are often used to store state information. By sending a signal to the flip-
flop, the state can be changed. Flip-flops are used in many electronics, including computers
and communications equipment.
Flip-flops and latches are used as data storage elements. Such data storage can be used
for storage of state, and such a circuit is described as sequential logic. When used in a
finite-state machine, the output and next state depend not only on its current input, but also
on its current state (and hence, previous inputs). It can also be used for counting of pulses,
and for synchronizing variably-timed input signals to some reference timing signal. A flip-
flop can be symbolically represented as shown below:
Generally, Set and Reset Pins are input pins; whereas Q and Q‟ are output pins.
When Set Pin= logic 1, the output Q is SET to 1. (Q‟= 0)
When Reset Pin=logic 1, the output Q is RESET to 0. (Q‟=1)
Note that Q‟ is complement of Q at all times.
2.2 SR Flip- flop:
The R-S flip-flop is the most basic of all flip-flops. The letters „R‟ and „S‟ here stand for
RESET
and SET.
It is constructed by feeding the outputs of two NOR gates back to the other NOR gates as
shown below:
RS Flip-Flop composed of two NOR
Gates.
To understand the operation of the RS-flip-flop (or RS-latch) consider the following
scenarios:
S=1 and R=0:
o The output of the bottom NOR gate is equal to zero, Q'=0.
o Hence both inputs to the top NOR gate are equal to one, thus, Q=1.
o Hence, the input combination S=1 and R=0 leads to the flip-flop being set to
Q=1.
S=0 and R=1:
o The output of the top NOR gate is equal to zero, Q=0.
o Hence, the inputs to the bottom NOR gate are equal to 1, thus Q‟=1
o We say that the flip-flop is reset, that is reset to Q=0.
S=0 and R=0:
o Assume the flip-flop is set (Q=0 and Q'=1), then the output of the top NOR
gate remains at Q=1 and the bottom NOR gate stays at Q'=0.
o Similarly, when the flip-flop is in a reset state (Q=1 and Q'=0), it will remain
there with this input combination.
o Therefore, with inputs S=0 and R=0, the flip-flop remains in its state.
S=1 and R=1:
o This input combination must be avoided.
We can summarize the operation of the RS-flip-flop by the following truth table.
R S Q Q' Comment
0 1 1 0 Set
1 0 0 1 Reset
1 1 ? ? Avoid
S’ R’ Q Q’ State
1 0 0 1 RESET
0 1 1 0 SET
0 0 ? ? Forbidden
2.3 D Flip-Flop:
The Delay Flip-Flop or D Flip-flop is easily formed from SR flip-flop by adding a NOT
We have observed that S‟=0, R‟=0 is a forbidden condition in SR NAND gate flip-flop. We
can prevent this from happening by connecting a NOT gate between S and R inputs.
The D flip-flop ensures that S and R can never be simultaneously equal to each other.
The single input then is called the Data input or simply D input.
If D=1, then S=1 in the above circuit resulting in Q=1 and Q‟=0
If D=0, then R=1 in the above circuit resulting in Q‟=1 and Q=0.
Thus, the D input condition is copied to the output Q when the clock input is active. Once
the clock input goes low, the output at Q and Q‟ will remain unchanged. We say that the
output is “latched” at logic 0 or logic 1.
Memory
↓»0 X Q Q‟
no change
↑»1 0 0 1 Reset Q » 0
↑»1 1 1 0 Set Q » 1
Note that: ↓ and ↑ indicates direction of clock pulse as it is assumed D-type flip flops are
edge triggered
2.4 JK Flip-Flop:
We have seen that S=0 and R=0 condition in SR NAND flip-flop is forbidden and should be
avoided. Also, while Enable input is HIGH, the correct latching may not occur, if S or R
changes state during this period. To overcome these two problems, the JK flip-flop was
developed. The inputs J and K are derived from its inventor Jack Kilby.
The operation of JK flip-flop is same as the SR flip-flop for same S and R inputs. The
difference is that it has no forbidden or invalid states of SR flip-flop.
The JK flip flop is obtained by adding two NAND gates to SR NAND gate flip-flop as shown
below:
The Basic JK Flip-flop
Both the S and the R inputs of the previous SR bi-stable have now been replaced by two
inputs called the J and K inputs. Thus, J = S and K = R.
The two 2-input AND gates of the gated SR bi-stable have now been replaced by two 3-
input NAND gates with the third input of each gate connected to the outputs at Q and Q‟.
This cross coupling of the SR flip-flop allows the previously invalid condition of S = “1”
and R = “1” state to be used to produce a “toggle action” as the two inputs are now
interlocked.
If the circuit is now “SET”, then the J input is inhibited by the “0” status of Q through the
lower NAND gate. If the circuit is “RESET” the K input is inhibited by the “0” status
of Q through the upper NAND gate. As Q and Q‟ are always different we can use them to
control the input. When both inputs J and K are equal to logic “1”, the JK flip flop toggles as
shown in the following truth table.
Description
same as
for the Clk J K Q Q‟
SR Latch
X 0 0 1 0
Memory
no change
X 0 0 0 1
↓ 0 1 1 0
Reset Q » 0
X 0 1 0 1
↓ 1 0 0 1
Set Q » 1
X 1 0 1 0
↓ 1 1 0 1
toggle
Toggle
action
↓ 1 1 1 0
2.5 Race-Around Condition:
Before getting into the race around condition, let us have a look at the JK flip-flop‟s truth
table.
Inputs Outputs
J K Q Q'
Same as Same as
0 X X No change
previous previous
Clock
Comments
Input Same as Same as
1 0 0 No change
previous previous
1 0 1 0 1 Reset
1 1 0 1 0 Set
Opposite of Opposite of
1 1 1 Toggle
previous previous
Here, Q is the present state and Q‟ is the next state. As you can see, when J, K and Clock
are equal to 1, toggling takes place, i.e. The next state will be equal to the complement of
the present state.
This is what was expected, but the output may not be like this all the time. This is
where Race around condition comes into the play.
Let us look at the timing diagram of JK flip-flop when the race around condition is
considered.
When J, K and Clock are equal to 1, toggling takes place. Here, propagation delay has also
been reduced, so the output will be given out at the instant input is given. So there is a
toggling again. Therefore, whenever Clock is equal to 1 there are consecutive toggling. This
condition is called as Race around condition. To put it in words, “For JK flip-flop if J, K and
Clock are equal to 1 the state of flip-flop keeps on toggling which leads to uncertainty in
determining the output of the flip-flop. This problem is called Race around condition. “‟ This
condition also exists in T flip-flop since T flip-flop also has toggling options.
The master slave JK flip flop is a combination of a clocked JK flip-flop and a clocked
SR flip-flop. The clocked JK flip-flop acts as the master and the clocked SR flip-flop
acts as the slave.
Master is positive level triggered and due to the presence of an inverter in the clock
line, the slave is negative level edge triggered. Hence when clock=1, the master is
active and slave is inactive. Vice versa happens when clock=0.
Case I: When clock is not given, both master and slave are inactive and there will be no
change in outputs.
Case II: For clock=1, master is active, slave inactive. As J=K=0, output of master Q and Q'
will not change. As soon as clock goes to 0, slave becomes active, and master is inactive.
But since input to slave S and R is same, output of slave will also remain same.
Case III: For clock=1, master is active and slave is inactive. When J=0 and K=1, outputs of
master will be Q=0, Q'=1, which will be inputs to slave. When clock=0, slave becomes
active and takes inputs 0,1 to give output Q=0, Q'=1. This output will not change if clock is
again made 1and then 0. Hence we get a stable output from master and slave.
Case IV: For clock=1, master is active and slave is inactive. When J=1 and K=0, outputs of
master will be Q=1, Q'=0, which will be inputs to slave. When clock=0, slave becomes
active and takes inputs 1,0 to give output Q=1, Q'=0. This output will not change if clock is
again made 1 and then 0. Hence we get a stable output from master and slave.
Case V: When clock =1, J=K=1, master output will toggle. So S and R will invert. But slave
remains inactive all this time since clock is 1. As soon as clock becomes 0, slave becomes
active and master becomes inactive. So slave will also toggle. These changed outputs are
returned through feedback to the master, but master does not respond to them because
clock is now 0 and master is inactive. Thus, in one clock period, master and slave both
toggle only once, avoiding race condition caused by multiple toggling.
2.7 T Flip-Flop:
We can construct a T flip – flop by any of the following methods.
(2) Connecting the XOR of T input and Q PREVIOUS output to the Data input, in D flip –
flop.
(3) Wiring the J and K inputs together and connecting it to T input, in JK flip – flop. This is
illustrated in the figures below:
Figure (1) From SR flip flop.
Working:
Toggle Flip flop changes its output whenever it is edge-triggered. What it means is that
whenever the clock changes its state from low to high or high to low.
T flip flops are not available as Integrated Circuits(ICs). But, they can be easily constructed
using SR flip-flop, JK flip-flop or D flip-flop as shown above.
4. Draw the logic circuit diagram of the flip-flop to be formed according to the
simplified expression. Use flip-flop in hand and logic gates to achieve this.
Let us understand this with an example. Let us consider converting SR flip-flop to a D flip
flop.
Step 1. Prepare truth table of desired flip flop, that is D flip flop.
D Q (t) Q (t+1)
0 0 1
0 1 0
1 0 1
1 1 1
Step 2. SR flip-flop has two inputs S and R. Write the excitation values of SR flip flop for
each combination of present state and next state. The above table will now be modified to
D Q(t) Q(t+1) S R
0 0 1 0 X
0 1 0 0 1
1 0 1 1 0
1 1 1 X 0
Step 3.
From the above table, we can write the Boolean functions for each input as below.
S=m2+d3S=m2+d3
R=m1+d0R=m1+d0
We can use 2 variable K-Maps for getting simplified expressions for these inputs. The k-
Maps for S & R are shown below.
Step 4.
The circuit diagram of D flip-flop is shown in the following figure.
This circuit contains a NOT gate connected in addition to SR flip-flop.
(1) Registers
(2) Counters
(1) Registers
Registers are storage devices used to store memory. Each flip-flop can store a single bit.
Figure 1 shows cascading three D flip-flops to store 3-bit information.
The data can be shifted within registers in/out of the register by applying clock pulses.
These registers are called shift registers and can be pictorially represented as in Figure 2.
(2) Counters:
Counters are used for the purpose of counting. A series of flip –flops are cascaded to form
counters. These counters can be synchronous or asynchronous. They can be positive-edge
triggered or negative-edge triggered. Counters are used as up-counter, down counter, ring
counter, Johnson counter etc. Figure 3 shows a 3-bit asynchronous positive edge triggered
up-counter.
(3) Event Detectors
These are circuits which are used to find occurrence of a particular event. Flip-flops do not
change their state unless triggered. This can be used to detect and store occurrence of an
event. Figure 4a shows one such event detector which detects the event of switching‟ ON‟
of light. The working is illustrated in Figure 4b.
(4) Data Synchronizers:
Outputs of a particular combinational circuit should change their states simultaneously.
Using Data synchronizers, this can be easily achieved as illustrated in Figure 5 below:
………………………………………………………X………………………………………………
Unit 5: Chapter 9
Counters
Unit Structure
9.0 Objectives
9.1 Introduction
9.2 Asynchronous counter
9.3 Terms related to counters
9.4 IC 7493 (4-bit binary counter)
9.5 Synchronous counter
9.6 Bushing
9.7 Type T Design
9.8 Type JK Design
9.9 Presettable counter
9.10 IC 7490
9.11 IC 7492
9.12 Synchronous counter ICs
9.13 Analysis of counter circuits
9.14 Summary
9.15 Reference for further reading
9.0 Objectives: This chapter would make you understand the following concepts
What is counter?
Different types of counters – Asynchronous and synchronous counter.
Terms related to counters.
IC 7493 (4-bit binary counter)
Synchronous counter, Bushing, Type T Design, Type JK Design.
Presettable counter, IC 7490, IC 7492.
Synchronous counter ICs, Analysis of counter circuits.
9.1 Introduction
In the design of counters and registers FFs (flip-flops) are most widely used. The FF is
the basic building block of any sequential logic system. FF and combinational circuit are
used in the design of any sequential system.
Counter is a sequential circuit. A counter is a device that stores the number of times a
particular event or process has occurred, often in relationship to CLK (a clock) pulse.
Counters are used in digital electronics for counting purpose, they can count specific
event happening in the circuit.
9.1.1 Definition
A digital circuit which is used for counting pulses is known counter. Counter is the
widest application of FFs. It is a group of FFs with a CLK pulse applied. Counter is a
register that goes through a prescribed series of states. Counter is a circuit which cycle
through state sequence.
9.1.2 Types of Counters
The number of FFs used and the way in which they are connected determines the
number of states and also the specific sequence of states that the counter goes through
during each complete cycle. Counters are classified according to the way they are
clocked: Asynchronous or ripple counters and Synchronous counters.
Asynchronous counter Synchronous counter
1. It is also called as serial counter. 1. It is also called as parallel counter.
2. Simple and straight forward in 2. Complex in operation as compared to
operation. asynchronous.
3. Slower than synchronous. 3. Faster than asynchronous.
4. Next FF is triggered by previous 4. All FFs are triggered simultaneously by
FF. external CLK.
5. Problem of glitch. 5. No problem of glitch.
6. Settling time is more. 6. Settling time is less.
The waveforms given in Fig. 9.2.1(b) show the action of the counter as the clock runs.
Let's assume that the FFs are all initially reset to produce 0 outputs. If we consider A to
be the least-significant bit (LSB) and C the most-significant bit (MSB), we can say the
contents of the counter is CBA = 000.
Every time there is a clock NT (Negative Transition), FF A will change state. This is
indicated by the small arrows () on the time line. Thus at point a on the time line, A
goes high, at point b it goes back low, at c it goes back high, and so on. Notice that the
waveform at the output of FF A is one-half the clock frequency.
Since A acts as the clock for B, each time the waveform at A goes low, FF B will toggle.
Thus at point b on the time line, B goes high; it then goes low at point d and toggles
back high again at point f Notice that the waveform at the output of FF B is one-half the
frequency of A and one-fourth the clock frequency.
Since B acts as the clock for C, each time the waveform at B goes low, FF C will toggle.
Thus C goes high at point d on the time line and goes back low again at point h. The
frequency of the waveform at C is one-half that at B, but it is only one-eighth the clock
frequency.
9.3 Terms related to counters
Before we proceed further, we would like to study few things related to counter.
9.3.1 State Diagram:
State diagram means graphical representation of the states of counter circuit. For
example state diagram for 3 bit binary ripple up counter and 3 bit binary ripple down
counter can be as shown in Figures 9.3.1(a) and 9.3.1(b) respectively.
Figure 9.3.1(a): 3 bit binary ripple up counter Figure 9.3.1(b): 3 bit binary ripple down
Counter
9.3.2 Module N Counter:
If it is desired to have modulo N (mod – N) counter, the number of FFs required is
determined by,
N ≤ 2m where m = number of FFs
Let say m = 4, therefore N = 16. But if we require only 10 states out of 16, it is called as
modulus – 10 (Mod – 10) counter, but required FFs will be 4 only.
Mod – N can be achieved by resetting the FF. This should be done at the N state. In
Mod – 10, counter will count from 0 to 9, and at 10th state it will reset back to 0. Mod –
10 counter is also called as decade counter.
Up till now we have seen that counter is sequential and number of states provided are
N = 2m. Now let us take a case of truncated ripple counter when n (number of actual
state) < N.
Example 1: Design mod – 3 ripple counter.
Solution:
1) State diagram = 3 states → 0 to 2
2) No of actual states are n = 3
n < N = 2m 3 ≤ 2m therefore m=2
Hence 2 FFs are required.
3) Here FF used should have clear terminal for resetting or clearing.
4) Assumption: considering FF and gates are having 0 propagation delay.
5) Reset logic circuit required to terminate count after 2.
6) 2 FFs are used therefore N = 4
Normally CLR terminal is ACTIVE LOW therefore Design a reset logic combinational
circuit such that output Y should be 1 when valid states are there and Y = 0 when
Invalid states are present.
Circuit Diagram:
K-map:
Points:
1) Counter is up counter, therefore we have to cascade Q output, -ve edge
triggered FF and final output from Q.
2) FF should have ACTIVE LOW reset (clear) terminal.
3) Propagation delay presently assumed 0 n sec.
Circuit diagram:
With respect to CLK edge QB changes state after 20 ᶯ sec. (Part (b)).
9.6 Bushing
If you observe examples solved up till now, in full sequence ‗0‘ is always present and
once counter enters in valid state, it will continue the chain unless and until power
supply is switched off. To enter in the chain we use power on reset circuit, therefore first
state is normally ‗0‘.
Problem:
1) In some of the applications we don‘t require ‗0‘ state at all.
2) Secondly due to power supply fluctuation (glitch of power supply),
Electromagnetic inference and RFI (radio frequency interference), it may happen
that counter will enter in invalid state.
If due to problem stated above it enters in to invalid condition then what will
happen?
Then here your luck factor counts
(1) LOCK OUT STATE (IF LUCK IS BAD).
It may happen that counter will lock itself in invalid states only. Let‘s say in above
case counter enters into state 1; because of logic circuit next state happens to be
6. After 6 next state happens to be 1. Then counter will toggle between two
states only, as shown in state diagram figure 9.6(a).
Step 3: Now start from state of counter. Treat this state as previous state. Take next
state of counter from state diagram, and it will be obviously next state.
In our case 1st state = AB = 00 → Previous state.
6. Circuit diagram
Example 6: Design synchronous counter for state diagram shown in Figure 9.7.2.
6. Circuit diagram
7. Waveforms
4. K-Map:
5. Circuit Diagram:
4. K – Map:
5. Circuit diagram:
9.10 IC 7490:
IC 7490 is TT1 MSI decade counter. It contains four M/S FF and additional gating to
provide divide by 2 counter (Mod-2) and three stage binary counter which provides
divide by 5 counter (Mod-5).
Figure 9.10 shows block diagram of IC 7490.
Figure 9.10: Block diagram of IC 7490
7490 have gated zero reset (R0(1), R0(2)) and gated set to nine inputs R9(1), R9(2) for use
in BCD nine's complement applications.
Example 9: Implement sequential decade counter using IC 7490 and write counter
states.
Solution: In IC 7490 mod-2 counter and mod-5 counter is available 2 x 5 = 10
gives decade counter.
As mentioned in above example, requirement is sequential decade counter. Apply
CLK IN to INPUT A pin. Output QA is connected to INPUT B i.e. input of mod-5 counter.
Output terminals are QD Qc QB QA, where QD = MSB, QB = LSB connections are shown
in Figure 9.10.1(a).
9.11 IC 7492:
IC 7492 is TTL, MSI divide by 12 counter. IC 7492 is having 2 counter inside it. mod 2
(÷ 2) and mod 6 (÷ 6) counter.
Combination of both gives 2 x 6 = 12 ÷ 12 counter.
Block diagram of IC 7492:
IC 74190
IC 74190 is UP/DOWN decade counter with preset and ripple clock. It is a reversible
BCD (8421) decade counter featuring synchronous counting and asynchronous
presetting. Reversible BCD means it can count 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 i.e. up and
9, 8, 7, 6, 5, 4, 3, 2, 1, 0. 9 i.e. down. Asynchronous presetting means parallel input data
can be loaded at any instant, it is not dependent upon CLK input.
Pin configuration and logic symbol is as shown in Figure 9.12 (a) & (b)
IC 74191
IC 74191 is binary up/down counter with preset and ripple clock. If you compare it with
74190, IC 74190 is decade counter, whereas 74191 counts 0 to 15. This IC can count
up or down synchronously and has a synchronous preset. Preset feature allows the chip
to be used in dividers. The pin configuration and logic symbol is as shown in figure
9.12.1
Figure 9.12.1: Pinout and Logic Symbol – IC 74191
Pin names are as follows
Pin Names Description
Count enable input (Active low)
1 0 0 Count Up
1 0 1 Count down
0 X X X Preset (Async)
1 1 X X No Change (HOLD)
The modes are same as 74190, therefore the explanation given in 74190 holds for
74191 also.
For cascading or multistage counter, the configuration explained in 74190 holds for
74191 also. RC truth table is also similar.
9.13 Analysis of Counter Circuits:
Up till now we have solved some example based on T, D and JK FF design. This part
was designing the counter circuit or synthesis of counter, where we were given state
diagram and we have to find circuit for the same.
Now it is analysis, i.e. circuit will be given to you and we have to find state diagram, and
some time unused state will be given to us and we have to find how counter is going to
behave.
The method is very simple. Explained it point by point
(1) Firstly present state will be given to you e.g. say presently counter is in CBA = 010,
now next states.
By chance if the state is not given, you assume some state. The thumb rule is to
start from 000.
(2) This present state is now previous state for us.
(3) You have to now find out, I/ps to all the FFs, because of this previous state.
(4) After finding out inputs of all FFs. assume that CLK edge hits. Now you already
know the input, you know the truth table of each FF. So find out what will be Q
output of FF. This 'new' state will be next state of the FF.
(5) Now von assume the next state as previous and start from point 3.
This chain should be combined unless and until you get next state, which already exists
previously. For example, We started with slate 4. From 4 next state is 6. From 6 next is
8. From 8 next is 9 and from 9 next state is 4. Means '4' has occurred twice so chain is
complete. If you want you can draw state diagram as shown in Figure 9.13(a).
9.14 Summary:
In this chapter we have studied in detail about counters which includes asynchronous,
synchronous counters, terms related to counters, IC 7493 (4-bit binary counter),
Bushing, Type T Design, Type JK Design, Presettable counter , IC 7490, IC 7492, and
Synchronous counter ICs with examples.
9.15 Reference for further reading:
For further detailed study following are books prescribed by the University
1. Digital Electronics and Logic Design by N. G. Palan
2. Modern Digital Electronics by R. P. Jain
3. Digital Principles and Applications by Malvino and Leach
Unit 5: Chapter 10
Registers
Unit Structure
10.0 Objectives
10.1 Introduction
10.2 Parallel and Shift registers
10.3 Serial Shifting
10.4 Serial - in Serial - out (SISO)
10.5 Serial - in Parallel - out
10.6 Parallel - in Parallel - out
10.7 Ring counter
10.8 Johnson counter
10.9 Application of shift registers
10.10 Pseudo-random binary sequence generator
10.11 IC7495
10.12 Seven Segment displays
10.13 Analysis of shift counters.
10.14 Summary
10.15 Reference for further reading
10.0 Objectives: This chapter would make you understand the following concepts
What is register?
Different types of registers – Parallel and Shift registers.
Serial Shifting,
Ring counter, Johnson Counter.
Applications of Shift Register.
Pseudo-random binary sequence generator
IC7495, Analysis of Shift Counter
10.1 Introduction
Till this point, we have studied different flip-flops and conversion from one to another.
Now let's concentrate on application part of flip-flops. The most common use of FF is a
simple Register (OR a n bit memory storage device). In this section, we will start with
basic definition of register and slowly move on to shift register.
Register is a group of memory element that works together as a unit. Register simply
stores a binary word. When register accepts parallel data and outputs parallel data, the
same is referred as Parallel register or buffer register. About shift register, it is nothing
but memory element with facility of shifting left and right, bit by bit. Before going deep
into shift register, let's see structure of buffer register.
10.2 Parallel and shift registers:
10.2.1 Buffer Register:
Buffer register is simplest kind of register and stores digital word. The structure of buffer
register, built with the edge triggered D type FF is shown in Figure 10.2
One more method of loading or shifting the data is called Serial Shifting. What do you
mean by serial?
Serial means bit by bit data flow, serially, on single line. Serial shifting has only single bit
data line, not 4 or 8 as in parallel loading. The serial shifting can be represented by
block schematically, as shown in Figure 10.3.
Single bit data is entered in register and serially single data bit is taken out, through
register. A group of flip-flops connected to provide serial out, when serial input is given,
is called as Shift register.
Application:
Ring counters are invaluable when it is necessary to control sequence of operation.
Mainly ring counters are used in microprocessor.
Relationship of number of states and FFs:
In ring counter number of FFs and number of states are equal. Ring counter using JK
FF is shown in Figure 10.7.1.
The working of circuit is same as that of, when D FF is used.
In ring counter output shift register was fed back to input of first FF, that technique was
referred as direct feedback. But if outputs of last FF are crossed and then connected to
inputs of first FF. the technique is called inverse feedback. The counter we get from this
technique is called Johnson counter or twisted ring counter.
Circuit:
Let's draw circuit of Johnson counter using positive edge triggered JK FF.
(2) Calculate number of distinct timing intervals. In short you calculate number of bits of
pulse train. In our case it is
(3) Number of FFs can be given by equation,
10.11 IC7495:
We are going to study now TTL MSI Chip 7495. 4 bit shift register with serial and
parallel synchronous operating mode.
Features of the chip are:
(1) Synchronous shift left capability.
(2) Synchronous parallel load.
(3) Separate shift and load clock inputs.
(4) Synchronous expandable shift right. Let's see internal block of IC 7495 and Pin
configuration.