Beruflich Dokumente
Kultur Dokumente
= 5 x 82 + 6 x 81 + 7 x 80 + 5 x 8-1 + 6 x 8-2
= 5 x 64+ 6 x 8 + 7 + 0.625 + 0.09375
= 320 + 48 + 7 + 0.625 + 0.09375
= (375.71875)10
Therefore (565.56)8 = (375.71875)10
BINARY SUBTRACTION
The binary subtraction is performed in a manner similar to decimal subtraction. The rules for binary
subtraction are given in table. A is called Minuend and B is called Subtrahend. When A is greater than or
equal to B, Borrow = 0. When A is less than B, then Borrow =1.
0-0=0 1-1=0 1-0=1 0-1=1, with a borrow of 1
BINARY MULTIPLICATION
Binary multiplication is similar to decimal multiplication. In binary, each partial product is either zero
(multiply by 0) or exactly the same as the multiplicand (multiply by 1). The rules for multiplication are
given in table. A is called multiplicand and B is called Multiplier. In a digital circuit , the multiplication
operation is performed by repeated addition of all partial products to obtain the final product.
Example: Multiply (1011)2 by (1101)2
BINARY DIVISION
Binary division is carried out in the same manner as the decimal division.
Ex.1: Divide (11010)2 by (101)2 2. Divide (100010010)2 by (1101)2 3. Divide (100010010)2 by (1101)2
2 BCD, 2421, 5211 are examples. Excess-3, Gray code are the examples.
3 Uses: I/O operations in digital circuits, data Uses: arithmetic operations in digital computers,
manipulation during arithmetic operations, digital calculators, shift position encoders etc…
digital voltmeters, calculators etc..
EXCESS-3 CODE:
Excess-3 code is modified form of BCD number. The excess-3 code can be derived from the natural
BCD 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, the Excess-3 code is 0100 0101(12 in decimal).
It not weighted code.
Its self-complimenting code, means 1's complement of the coded number yields 9's complement of
the number itself.
It was mainly used in IBM mainframe computers. Used in digital system for performing subtraction
operations.
Table shows an Excess-3 codes to represent single decimal digit.
GRAY CODE:
Differs from leading and following number by a single bit. i.e any two adjacent numbers differs by
only one bit. Hence it is one type of unit distance code.
Gray code for 2 is 0011 and for 3 is 0010.
No weights are assigned to the bit positions.
Extensively used in shaft encoders.
It is an example for Reflecting code and Cyclic code.
BINARY – TO - GRAY CODE CONVERSION
To convert the binary number into the Gray code, the process is as follows.
The most significant bit (MSB) in Gray is taken directly from the MSB in binary. The rest of the
Gray bits comes from a XOR operation between the precedent binary bit(b(i-1)) and the current binary bit
(b(i)). It is shown in fig.
Example : Conversion from ‘11101’ binary to its equivalent in Gray code.
The ASCII codes are used to represent alphanumeric data in computer input/output.
Since it is a seven-bit code, it can almost represent 128 characters. These include 95 printable
characters including 26 upper-case letters (A to Z), 26 lowercase letters (a to z), 10 numerals (0 to 9)
and 33 special characters such as mathematical symbols, space character etc. The below table lists
the 7 bit ASCII code containing the 95 printable characters.
Ex: ASCII code for B is 1000010 (42)16
.
1.11 IMPORTANCE OF PARITY BIT
The simplest technique for detecting errors is that of adding an extra bit, known as the parity bit, to each
word being transmitted.
The parity bit is an extra bit included in a binary message to make the number of 1’s either odd or even.
The message, including the parity bit is transmitted and then checked at the receiving end for errors.
An error is detected if the checked parity does not match with the transmitted one.
The circuit that generates the parity bit in the transmitter called a parity generator and the circuit that
checks the parity in the receiver is called a parity checker.
There are two types of parity- Odd parity and Even parity. For odd parity, the parity bit is set to a 0 or
a 1 at the transmitter such that the total number of 1 bits in the word including the parity bit is an odd
number. For even parity, the parity bit is set to a 0 or 1 at the transmitter such that the total number of 1
bits in the word including the parity bit is an even number. Table shows the parity bits to be added to
transmit decimal digits 0 to 9 in the 8421 code.
When the digital data is received, a parity checking circuit generates an error signal if the total number
of 1’s is even in an odd parity system or odd in an even parity system. This parity check can always
detect a single bit error but cannot detect two or more errors within the same word.
1.12 DIFFERENT POSTULATES IN BOOLEAN ALGEBRA
The postulates of a mathematical system form the basic assumption from which it is possible to
deduce theorems, laws and properties of the system. Boolean algebra is formulated by a defined set of
elements, together with two binary operators ‘+’ and “.”. The postulates of Boolean algebra are shown in
table.
NOT GATE
A NOT gate is also called an Inverter. i.e., it performs complement operation. X = A’
It has only one input and only one output.
It is a device whose output is always the complement of its input. The output of a NOT gate is ‘1’
when its input is logic ‘0’. The output of a NOT gate is ‘0’ when its input is logic ‘1’.
The logic symbol and the truth table of an inverter is shown in figure.
NOR GATE
The NOT=OR operation is known as NOR operation. The NOR gate is equivalent to an OR gate
followed by a NOT gate.
The expression for the output of the NOR gate can be written as .
The output of NOR gate is logic 1 , only when all the inputs are at logic 0 level. For any other
combination of inputs, the output is a logic 0 level i.e., if any one input is ‘1’, the output is logic ‘0’.
The logic symbol and the truth table of two input NOR gate are shown in figure.
That means the complement of two or more variables OR together is the same as the AND of the
complements of each of the individual variables.
Schematically, each side of this law can be represented as: NOR GATE = BUBBLED AND GATE
Theorem 2: This law states that the compliment of the product of variables is equal to the sum of their
individual compliments.
That means the compliment of two or more variables AND together, is equal to the sum of compliments of
each of the individual variables.
Schematically, each side of this law can be represented as NAND GATE = BUBBLED OR GAE
1.17 DEMORGAN’S THEOREMS – PROOF
Theorem 1: This law states that the complement of a sum of variables is equal to the product of the
individual complements. This is illustrated in the truth table.
Theorem 2: This law states that the compliment of the product of variables is equal to the sum of their
individual compliments. This is illustrated in the truth table
Ex : .
PRODUCT OF SUMS FORM(POS):
The Product Of Sums or POS expression consist of two or more sum (OR) terms that are ANDed
together. A sum term is defined as either a literal or a sum of literals. Each sum term consists of one or
more literals appearing in either complemented or un complemented form.
Ex :
SSOP : If each product term in SOP form contains all the literals then the SOP form is knows as Standard
or canonical SOP form. Each individual term in Standard SOP or Canonical SOP form is called “min
term”. Therefore standard SOP form is also called min term canonical form.
Example of Standard Sum Of Product (SSOP) expression is
Example 1:
Using k-map simplify the following expressions to their minimum SOP form and realize using basic gates.
Y = Σm(1,3,4,6)
Example 2:
Example 3:
Assignment questions
Short answer questions
1. Convert the following
a) (38.15) 10 = (?)2 b)(101010.1011)2 =( ? )10 c) (1110011)2 = (?)16 d) (67)10 = (?)8 f)( 110010)2 = (?)H
4. Explain the operation of AND, OR, NOT and XOR gates using truth table.
Essay questions
1..Realize AND, OR, NOT gates using NAND & NOR gates.
2. Simplify the following Boolean expression using Boolean algebra and K-map
a) Y= Σm(,2,3,5,6,7) b) Y= Σm(,2,3,5,6,7) c) Y= Σm(0,1,2,3,8,9,10,11)
2. LOGIC FAMILIES
2.0 INTRODUCTION
In Digital Designs, primary aim is to create an Integrated Circuit (IC). Different circuit
configurations and production technologies are used during the production of digital integrated circuits.
Each of these approaches is called as specific Logic Families.
Now the idea of having different approaches or different logic families is that each ICs of same
family when fabricated will have identical electrical characteristics. The characteristics which are bound to
be identical are supply voltage range, speed of response, dissipation of power, input and output logic levels,
current sinking capability, current sourcing capability, noise margin, fan-out etc.
Digital ICs are the ones which make up the whole system. And if all the ICs are of same logic family
then they are compatible to each other and the intended logic functions are performed and the goal is
achieved. But in case ICs belonging to different logic families are used in a digital system then to ensure
compatibility interfacing techniques must be used. So, the knowledge of different logic families and use the
best combination of ICs during the design of a digital system is needed.
LEVEL (OR) SCALE OF INTEGRATION
Depending on the number of devices integrated on a substrate, the following are different levels of
Integration
Name of the group No of Transistors No of Gates Applications
Small Scale Integration Less than 100 UP TO 12 Used for educational purposes and
(SSI) interface complex digital devices.
Ex: 7400, 7412, 7432
Medium Scale Integration 100 - 1000 12-100 Used in multiplexers, de multiplexers,
(MSI) registers and counters etc.
Ex: 7490, 74121(MMV)
Large Scale Integration 1000 - 10000 100 - 1000 Used in small memory chips and
(LSI) Programmable Logic devices.
Ex: ROM & RAM ICs.
Very Large Scale More than 10000 1000 - Used in large computer memories,
Integration (VLSI) 10000 microprocessor, microcontrollers and
Digital Signal Processors.
Ex: 8085, 80386 etc.
Any integration beyond the capacity of VLSI are termed as Ultra Large Scale Integration (ULSI).
The Pentium III manufactured by INTEL belongs to this category and has more than one million (10 6)
components.
NOISE MARGIN : Noise margin is a parameter closely related to the input-output voltage characteristics.
This parameter allows us to determine the allowable noise voltage on the input of a gate so that the output
will not be affected.
Stray electric and magnetic fields may induce unwanted voltages known as noise on the connecting
wires between logic circuits. This may cause the voltage at the input to a logic circuit to drop below V IH or
rise above VIL and may produce undesired operation.
The circuit’s ability to tolerate noise signals is referred to as Noise Immunity, a quantitative
measure of which is called Noise Margin. It is shown in fig.
The specification most commonly used to specify noise margin (or noise immunity) is in terms of
two parameters. 1. LOW noise margin NML 2. HIGH noised margin NMH.
NML – Noise Margin Low is defined as the difference in magnitude between the maximum LOW
output voltage of the driving gate and the maximum input LOW voltage recognized by the driven gate.
NML (NOISE MARGIN low level) = NML = VIL – VOL
NMH - Noise Margin High is defined as is difference in magnitude between the minimum HIGH
output voltage of the driving gate and the minimum input HIGH voltage recognized by the receiving gate.
NMH (NOISE MARGIN high level ) = NMH = VOH – VIH
The noise margin defined above is dc noise margin. The ac noise margin is defined as the ability of a
logic circuit to tolerate a large noise amplitude if the noise is of very short duration. The ac noise margin is
greater than d.c noise margin.
Example : For a 4011B IC
VOH = 4.95V and VOL = 0.05V
VIH = 3.5V and VIL = 1.5V
Then NMH = VOH – VIH = 4.95 – 3.5 = 1.45 V
NML = VIL – VOL = 1.5 – 0.05 = 1.45 V
FAN-IN & FAN-OUT CAPACITY OF A DIGITAL IC.
Fan-In : Number of inputs connected to a gate is called the Fan-in of the gate. For example for a 2 input
gate, Fan-in is 2. For 4 input gate Fan-in is 4.
Gates with large Fan-in are bigger and slower. Fan in is always fixed for a gate. i.e., the no. of inputs
Fan Out : It is defined as the maximum number of logic gates that can be driven by a gate or number of
gates connected at the output of a gate
It is also knows as loading factor. Fan Out for TTL logic is around 10, that is connect more than 10
gates can be connected to an output of a TTL gate.
In CMOS it is up to 1000s of gate. A single gate is capable of driving thousands of gates but with each
gate added, its propagation delay is going to increase.
Fan out is determined by the internal design of the gate. Different logic families like TTL, CMOS,
ECL,SCHOTTKY has different fan-out for the same gate..
The Fan out depends on
the electric current sourcing capability of the output when the output is HIGH of the logic gate
the electric current sinking capability of the output when it is LOW.
And it also depends on the requirements of the inputs which are to be connected with the output
of the logic gate.
Hence it depends on IOH or IOL and the Fan-out is minimum of two ratios.
Fan-Out =min(IOH/IIH,IOL/IIL)
POWER DISSIPATION
Every IC requires a certain amount of electric power to operate. This power is supplied by one or
more supply voltages connected to the power pin(s) on the chip.
The amount of power that an IC dissipates is determined by the average supply current I CC that it draws
from the VCC supply. It is the product of ICC and VCC
For many ICs, the value of ICC for a LOW gate output is higher than for a HIGH output. Therefore the
current drawn on the supply depends on the logic states of the circuits on the chip.
Fig. Currents ICCH and ICCL
For example, in fig ICCH is the current drawn from VCC by the OR gate chip when all the gate outputs
are HIGH. Similarly, ICCL is the current drawn from VCC by the OR gate chip when all the gate outputs are
LOW. The average ICC is then determined based on 50% duty cycle operation of the gate (LOW half of
the time and HIGH half of the time.
Operation:
1. When A=0 and B=0, both p-MOSFETs i.e., Q1 and Q2 will be ON and both the N-MOSFETs Q3 and
Q4 will be OFF. Therefore Y=VCC = 1.
2. When A=0 and B=1, the output is High. For A =0 the transistor Q1 is ON and Q2 is OFF. For B=0 the
transistor Q3 is OFF and Q4 is ON. Therefore Y=VCC = 1.
3. When A=1 and B=0, the output is High. For A =1 the transistor Q1 is OFF and Q2 is ON. For B=0 the
transistor Q3 is ON and Q4 is OFF. Therefore Y=VCC = 1.
4. When A=1 and B=1, both p-MOSFETs i.e., Q1 and Q2 will be OFF and both the N-MOSFETs Q3 and
Q4 will be ON. Therefore Y=0V = 0
The operation of CMOS NAND gate is shown in truth table.
Assignment questions:
A CLC has ‘n’ inputs and ‘m’ outputs. For n inputs there are 2 n possible combinations of binary values.
For each input combination there is one output. ‘m’ Boolean functions are used to define each output
variable.
Operation can be described by the truth table.
It does not have clock signal and its action does not depend on clock transition.
Combinational logic circuits can be very simple and any combinational circuit can be implemented with
only NAND and NOR gates as these are classed as “universal” gates.
3.2 HALF ADDER & ITS FUNCTION USING TRUTH TABLE
Half adder is a combinational arithmetic circuit that adds two binary digits and produces a sum bit
(S) and carry bit (C) as the output.
If A and B are the input bits, then Sum bit (S) is the X-OR of A and B and the Carry bit (C) will be
the AND of A and B. From this it is clear that a half adder circuit can be easily constructed using one X-OR
gate and one AND gate.
The schematic symbol and logic circuit of a half adder are shown in the figure below.
OPERATION : The output logic expressions can be derived for the Sum and Carry outputs as a function of
inputs. It is shown in truth table.
When A=0 & B=0, the Sum is 0 and Carry is 0.
When A=0 & B=1, the Sum is 1 and Carry is 0.
When A=1 & B=0, the Sum is 1 and Carry is 0.
When A=1 & B=1 the Sum is 0 and Carry is 1.
The Sum(S) is 1 only if the input variables are not equal. Therefore the Sum can be expressed as XOR of
input variables.
Similarly the Carry is 1 only when both A and B are 1s. therefore Carry output can be expressed as AND of
input variables.
Carry = A.B
The Sum(S) is 1 only if the input variables are not equal. Therefore the Sum can be expressed as XOR of
input variables.
Similarly the Carry is 1 only when both A and B are 1s. therefore Carry output can be expressed as AND of
input variables.
Carry = A.B
So, a half adder can be constructed using and XOR gate and an AND gate as shown in fig.
3.3 HALF-ADDER USING I) NAND GATES ONLY AND II) NOR GATES ONLY
Realization of Half adder using NAND gates : A Half adder can be realized using only NAND gates as
shown in fig.
Note: Required number of NAND Gates to implement Half Adder = 5
Realization of Half adder using NOR gates : A Half adder can be realized using only NOR gates as
shown in fig.
Full Adder Logic circuit : Using the Logic expressions for SUM and Carry the full adder can be
constructed using basic gates as shown in fig.(a). The logic expressions can be simplified using Boolean
laws or K-maps and then the simplified logic circuit can be constructed and is shown in fig (b)
3.5 FULL-ADDER USING TWO HALF-ADDERS & AN OR GATE
A Full adder can be realized using two Half adders and an OR gate. The block schematic is shown in fig.
Fig. Block schematic of Full adder using two Half adders and OR gate
PROOF:
The above expressions suggest that Full Adder can be constructed using two Half adders and an OR gate.
Fig. Logic diagram of Full adder using Two half adders and OR gate
.
Fig. Serial Adder
A 4 to– 1 or 4X1 Multiplexer is combinational logic circuit with four inputs from I 0 to I4, two
selection inputs S1 and S0 and one output line Y. As there are two selection inputs therefore, they can have
only four possible combinations which are 00, 01, 10 and 11. When selection inputs are 00 the input line
I0 is selected and it is directed to output. Similarly other inputs are directed one by one to the output Y for
their combination of selection inputs. The Block Diagram of a 4 – to – 1 Multiplexer is shown below.
The output equation of the 4X1 Multiplexer is given below.
Y = I0S’1S’0 + I1S’1S0 + I2S1S’0 + I3S1S0
The Truth Table of 4X1 multiplexer is given. When S 1 and S0 are equal to 1 and 0 the input I 1 is
joined to output. Similarly for other values of S1and S0 the remaining inputs are directed to output.
The circuit diagram of the 4 – to – 1 Multiplexer is shown here. The implementation of this circuit is
done by the help of AND Gate, OR Gate and NOT Gate. NOT Gates are used to get the complement values
of selection inputs as shown in the picture. There are four AND Gate which give four different outputs for
different values of selection inputs. The output of each AND Gate is directed as input to OR Gate where OR
Gate gives the final output of the Multiplexer.
When both the selection lines S1 and S0 are both 0, the first AND gate is enabled and all other AND
gates are disabled. The output of first AND gate is 0, if A is 0 and 1 if A is 1. Thus Y is same as A.
In the similar manner the other combinations of the truth table can be verified.
3.15 DEMULTIPLEXER
A de multiplexer is a combinational circuit which is having one input, 2n outputs and n select lines.
The de multiplexer passes the binary data present on the input to any of the outputs depending upon the
select lines. The output line in which data is passed is decided by the select line.
De multiplexer means one to many. A de multiplexer is a circuit with one input and many output. By
applying control signal, any input can be transferred to the output. Few types of de multiplexer are 1-to 2, 1-
to-4, 1-to-8 and 1-to 16 de multiplexer.
Following figure illustrate the general idea of a de multiplexer with 1 input signal, m control signals,
and n (2m) output signals
WORKING OF 1 X 4 DE MULTIPLEXER CIRCUIT
The 1 to 4 de multiplexer has 1 input, 2 control bits, and 4 outputs. The four outputs are Y0,Y1,Y2
and Y3. The input bit is labeled as Data D. This data bit is transmitted to the data bit of the output lines. This
depends on the value of S1 and S0, the control inputs or select inputs.
De multiplexer is also called as data distributor or serial to parallel converter.
The logic symbol and truth table of 1 X 4 de multiplexer is given. From the truth table it is clear that
data input appears at output Y0 when S1=0 and S0=0 and at Y1 when S1=0 and S0=1. Similarly the data
input appears at output Y2 when S1=1 and S0=0 and at Y 3 when S1=1 and S0=1. Also from the truth table
the expressions for outputs can be written as follows.
Now using these expressions, a 1 to 4 de multiplexer can be implemented using four 3-input AND
gates and two NOT gates as shown in fig.
3.18 DECODERS
Decoder is a combinational circuit that essentially performs a reverse encoder function. The basic
function of decoder is to detect the presence of a specified combination of bits on its input and to indicate that
presence by a specified output level. In general a decodes has ‘n’ input lines to handle ‘n’ bits and 2 n output
lines. Only one of the output is high at a time. It accepts the input bits and delivers a logic 1 at any one of 2 n
outputs.
The logic symbol of a decoder is shown in fig.
Ex: 1. 3 to 8 line (Binary to Octal) decoder
2. 4 to 10 line (BCD to Decimal) decoder
3. 4 to 16 line (Binary to Hexadecimal)decoder
2 X 4 DECODER
A 2 X 4 decoder has 2 inputs and (22) 4 outputs. In decoder only one output is high for one
combination of input and all other outputs are low. Table summarizes the operation of 2 to 4 line decoder.
The logic symbol and Logic circuit of Octal to binary decoder is shown below.
. There are 3 inputs A B C and 8 decimal outputs Y0 to Y7.When A = 0,B=0,C=0, Y0 AND gate has all
high inputs. Therefore Y0 is high. And the remaining all AND gates have at least one low input as a result all
these AND gates have Low outputs.
Similarly when ABC = 111, the Y7 output is high. In general the subscript of high output equals the
Octal l equivalent of binary combination. From the above table each of these decoding functions is implemented
with AND gates.
The Boolean expressions for the outputs of decoder are given above.
ENCODERS
An encoder is a combinational logic circuit that accepts an active level on one of its inputs representing a
digit (such as decimal or octal digit) and converts it to a coded output(such as binary or BCD). Encoders also
used to encoder various symbols and alphabetic characters.
Encoder has number of input lines, but only one of the inputs is activated at a given time and
produces an N-bit output code that depends on the activated input.. The encoder allows 2 power N inputs
and generates N-number of outputs. For example, in 4-2 encoder, has 4 inputs and it produces only 2
outputs. The logic symbol of encoder is shown in fig.
4 TO 2 LINE OR 4 X 2 ENCODER
The encoder circuit is used to convert one form of data in to binary form. The input may be in
decimal , octal or hexadecimal and the output is in binary. The logic symbol, circuit and truth table of 4 X
encoder are given below.
Consider each input of encoder corresponds to each decimal digit and the output is a 2- bit binary code.
From the table we can determine the relationship between each 2-bit binary code and the decimal digits.
For instance, the MSB of 2-bit binary code, Y1 is a 1 for decimal digits 2 OR 3. Then the OR
expression for bit Y1 in terms of the decimal digits can be written as
Y1 = 2 +3
Similarly the OR expression for bit Y0 in terms of the decimal digits can be written as
Y0 = 1 + 3
The above logic expression can be implemented to obtain the logic circuitry required for encoding each
decimal digit to a 2-bit binary code. Note that the 0 digit input is not needed because the 2-bit binary code
outputs are all low, when there are no high inputs
Operation: When one of the decimal digit input is at high, the appropriate levels occurs on the 2 output lines.
When push button 0 is pressed, Y1 and Y0 OR gates have low outputs. Therefore output word is
Y1Y0 = 00 which is the binary code for decimal 0.
When push button 1 is pressed, Y1 and Y0 OR gates have low and high outputs. Therefore output word is
Y1Y0 = 01 which is the binary code for decimal 1.
When push button 2 is pressed, Y1 and Y0 OR gates have High and Low outputs. Therefore output word is
Y1Y0 = 10 which is the binary code for decimal 2.
When push button 3 is pressed, both Y1 and Y0 OR gates have High outputs. Therefore output word is
Y1Y0 = 11 which is the binary code for decimal 3.
Similarly any encoder can be constructed
3.21 DECIMAL TO BCD ENCODER / 10 TO 4 LINE ENCODER
This encoder consists of 10 input lines and 4 output lines. Each input line corresponds to the each
decimal digit and 4 outputs correspond to the BCD code.
This encoder accepts the decimal data as an input and encodes it to the BCD output which is
available on the output lines. The figure below shows the basic logic symbol of decimal to BCD encoder
along with its truth table.
The truth table represents the BCD code for each decimal digit. From the truth table the relationship
between the BCD bit and decimal digit can be determined.
From the above table, the expressions for BCD outputs are
1. Y3 is 1 for decimal digit 8 or 9. Therefore Y3 = 8 + 9
2. Y2 is 1 for decimal digit 4 or 5 or 6 or 7. Therefore Y2 =4 + 5 + 6 + 7
3. Y1 is 1 for decimal digit 2 or 3 or 6 or 7. Therefore Y1 = 2 + 3 + 6 + 7
4. Y0 is 1 for decimal digit 1 or 3 or 5 or 7 or 9. Therefore Y0 = 1 + 3 +5 + 7 + 9
From the above expressions, the decimal to BCD encoder logic circuit can be implemented by using set of
OR gates as shown in below figure
Fig. Logic circuit of Decimal to BCD encoder
Operation: Push button switches are used to select one of the inputs. When the switch is pressed the
corresponding input line is high and the appropriate output occurs on BCD output lines.
When push button 0 is pressed, all the OR gates have low outputs. Therefore output word is
Y3Y2Y1Y0 = 0000 which is the binary code for decimal 0.
When push button 1 is pressed, Y3,Y2, Y1 gates have low output and Y0 OR gate has high outputs.
Therefore output word is Y3Y2Y1Y0 = 0001 which is the binary code for decimal 1.
Similarly for all the decimal inputs selected the encoder gives the corresponding BCD output.
3.22 STATE THE NEED FOR TRI-STATE BUFFER /SWITCH
1. The output of a digital circuits has two states of output – Low or High. In complex digital circuits
like micro computer or microprocessor a number of gate outputs may be required to be connected
to a common line which is referred to as a bus. When a number of gate outputs are connected to a
bus, loading is increased and speed of operation will be decreased.
2. To avoid the problem of loading and speed of operation a special circuit with three states-Low,
High and High impedance(Float) states is needed. This circuit is knows as Tri-state buffer.
3. In many digital systems tri-state buffers are used to interface the buses and devices. When many
devices are interfaced to a common bus , tri state buffers are used to disconnect all devices except
the one which is communication at that time.
4. By replacing open collector outputs with tri-state buffers, the switching time needed to change the
output state is reduced.
These comparators can compare 2-bit, 4-bit and 8-bit numbers depending on the application requirement.
These are available in TTL as well as CMOS logic family ICs and some of these ICs include IC 7485 (4-bit
comparator), IC 4585 (4-bit comparator in CMOS family) and IC 74AS885 (8-bit comparator).
A comparator used to compare two bits, i.e., two numbers each of single bit is called a single bit
comparator. It consists of two inputs for allowing two single bit numbers and three outputs to generate less
than, equal and greater than comparison outputs.
The figure below shows the block diagram of a 1-bit or single bit magnitude comparator. This
comparator compares the two bits and produces one of the 3 outputs as (A<B), (A=B) and (A>B).
The truth table for the single bit comparator is given below. When A0 B0 = 00 & 11, both inputs are
equal, therefore A=B output will be high. When A0 B0 = 01, B is more than A and hence AB is active.
From the truth table logical expressions for each output can be expressed as
By using these Boolean expressions a logic circuit can be implemented for this comparator using two
AND gates, one NOT gate and one Ex-NOR gate as shown in below figure. AND gates are used to find
whether a binary digit is less than greater than another bit whereas Ex-NOR gate is used to find whether two
binary numbers are equal or not.
In the figure, one AND gate has inputs of A0 (B0) ̅ and another has inputs (A0) ̅ B0. Therefore, one
AND gate output is 1 if A0 > B0 (i.e., A0 =1 and B0 =0) and is zero if A0 < B0 (i.e., A0 =0 and B0 =1).
Similarly, other AND gate output is one if A0 < B0 (i.e., A0 =0 and B0 =1) and is zero if A0 > B0 (i.e., A0
=1and B0 =0).
The Ex-NOR gate has inputs A0 B0, hence the output of the Ex-NOR gate will be 1 if A0 = B0 and
the output will be 0 if A0 is not equal to B0.
2-BIT COMPARATOR
A 2-bit comparator compares two binary numbers, each of two bits and produces their relation such
as one number is equal or greater than or less than the other. The figure below shows the block diagram of a
two-bit comparator which has four inputs and three outputs.
The first number A is designated as A = A1A0 and the second number is designated as B = B1B0.
This comparator produces three outputs as A>B, A=B and A<B.
The truth table of this comparator is shown below which depicting various input and output states.
By using above obtained Boolean equation for each output, the logic diagram can be implemented by
using four NOT gates, seven AND gates, two OR gates and two Ex-NOR gates.
The figure below shows the logic diagram of a 2-bit comparator using basic logic gates.
Fig. Logic circuit of a 2-bit comparator
The logic for 2-bit magnitude comparator is given below. Let the two numbers to be compared are A
(A1A0) and B (B1B0).
1. A will be greater than B when any one of the following conditions is satisfied.
a. If A1 > B1 i.e., A1 =1 and B1 = 0 irrespective of other bits
b. If A1 = B1 and A0 >B0 i.e., A0 = 1 and B0 =0
2. A will be less than B when any one of the following conditions is satisfied.
a. If A1 <> B1 i.e., A1 =0 and B1 = 1 irrespective of other bits
b. If A1 = B1 and A0 <B0 i.e., A0 = 0 and B0 =1
3. A will be equal to B when the following conditions is satisfied.
If A1 = B1 and A0 = B0
To represent these conditions in the form of truth table, it requires 16 combination and hence a function
table is given below.
In the function table ‘X’ indicates don’t care condition. From the function table, the expression for
A>B, A=B and A <B can be written and shown in table. Then the logic circuit can be constructed using
various logic gates as shown in fig.
Fig. Logic circuit of a 2-bit comparator
APPLICATIONS OF ENCODERS
Encoders are used to convert data from any form to binary form. They are used as
1. Decimal to binary (BCD) converters
2. Octal to Binary converters
3. Hexadecimal to binary converters.
4. Used to drive seven segment displays
5. Key board encoders.
Assignment questions
1. List the applications of encoders, decoders, multiplexers and de mux.
2. State the need for tri-state buffer.
3. Explain the working of 4 x 1 mux
4. Explain the working of 1 x 4 de mux
5. Explain the working of encoders and decoders
6. Explain the working of Comparator.
4. SEQUENTIAL LOGIC CIRCUITS
The period is related to the frequency, f. In fact, they are inversely related f = 1/T. The frequency
means how many times the waveform repeats per second. The unit of measurement for frequency
is Hz (pronounced Hertz), and is for the time as f-1 (inverse seconds).
The higher the frequency, the shorter the period of one cycle.
Necessity of Clock:
Clock is necessary in digital systems
1. To Co-ordinate / Control the Flip-flops. i.e., to change the Flip flop output from one state to
another state
2. To Synchronize different functional systems.
Therefore in flip flops the output of the flip flop will change in accordance with inputs only when the clock
is applied.
Triggering : Preventing the flip flop output from changing its state until the clock pulse arrived is known as
Triggering or Clocking.
Triggering of a clock depends upon the following parameters.
i) Clock Edges ii) Clock Levels
Clock Edges: A clock also has "edges". Those are
Positive Edge (Rising Edge)
Negative Edge (Falling Edge)
Positive Edge (Rising Edge): These are the times that the clock transitions from 0 to 1 (this is called
a positive edge).
Negative Edge (Falling Edge) :These are the times that the clock transitions from 1 to 0 (this is called
a negative edge).
3 S = 1, R = 0, Output of NAND-3 i.e. R' = 0 and output of NAND-4 i.e. S' = 1.Hence
Clk = 1 output of S-R NAND latch is Qn+1 = 1 and Qn+1 bar = 0.
This is the SET condition.
The PRESET and CLEAR inputs override the other inputs, because they have top priority. For
example when PRESET low, the Q goes high and stays there irrespective of changes in S , R and CLK. The
flip-flop will returns to normal operation only when PRESET goes high. Similarly for CLEAR function.
These inputs affect the flip-flop independent of the clock. Thus PRESET and CLEARinputs are called as
asynchronous inputs. Where as S and R inputs are called Synchronous inputs.
Difference between synchronous and asynchronous inputs:
S. No Synchronous input Asynchronous inputs
1 The S-R, D and J-K inputs are called The asynchronous inputs are PRESET(PR)
synchronous inputs. and CLEAR (CLR)
2 The data on the synchronous input are The asynchronous inputs activate the flip-
transferred to the output of a flip-flop only on flop independently of the clock
the triggered edge of the clock pulse
3 These inputs will not affect the synchronous These inputs override the effect of the
inputs synchronous inputs
4 Low priority inputs High priority inputs. These are active Low
inputs
JK FLIP-FLOP SYMBOLS: In the following Figure (i): is the standard symbol for a positive edge
triggered JK flip-flop of any design. Fig 3(ii) is the symbol for a flip-flop with the preset an clear functions.
As usual, PR and CLR have active low states. Fig 3(iii) is another commercially available JK flip-flop. The
bubble on the clock input is the standard way to indicate negative edge triggering.
4.8. RACE AROUND CONDITION.
RACING IN JK FLIP-FLOP:
. For level clocking, with a high J, high K and CLK, the output will toggle. New outputs are then
feedback to the input gates. After two propagation times the output toggles again. And once more, new
outputs return to the input gates. In this way, the output can toggle repeatedly as long as the CLK is high.
That is, get oscillations during the positive half cycle of the clock. This is called Racing or Race around
condition. The JK flip-flop has to be edge triggered to avoid oscillations
“Toggling more than once during a clock cycle is called Racing.”
Methods avoid Race around condition in Level triggered JK flip-flop:
To avoid this Race around condition the Master-Slave JK flip-flop is used.
Edge triggered JK Flip-Flop is also used to avoid Race around condition.
Operation:
Condition Operation
Operation:
3 CLK = 1,T = 1 Output will toggle corresponding to every positive level of clock signal.
The truth table and timing diagram Illustrates the action. The output changes only on the rising edge
of the clock. In other words, the data is stored only on the positive going edge.
The truth table summarizes the operation of the positive edge triggered D flip-flop. The up and down
arrows represents the rising and falling edges of the clock. The first three entries indicates that there’s no
output change when the clock is low, high or on its negative edge. The last two entries indicates an output
change on the positive edge of the clock. In other words, input data D is stored only on the positive going
edge of the clock.
Example: A register used to store 8 bit binary number must have 8 flip flops. Naturally the flip flops must
be connected together. Such that binary numbers can be entered (or) shifted into register.
2. SERIAL- IN PARALLEL -OUT: It accepts data serially and data bits are taken out of register in
parallel form. Once the data is stored, the output of each state is available on its respective output line and all
bits are available simultaneously. It is to be noted that valid n-bit data word comes out of the n-bit SIPO
register just after the application of n clock pulses.
3. PARALLEL –IN SERIAL-OUT: In case of Parallel-In Serial-Out shift registers (Figure c), the data
loading happens in parallel fashion while the data retrieval is serial in nature. Here the entire input word
enters into the shift-register at a single clock cycle. From then on, for each clock cycle
1. Data within the register shifts either right or left by one bit
2. One bit exits the register.
This means that the data bits of the input word are obtained at the PISO output bit-by-bit. This
indicates that in order to obtain the entire n-bit input word, one would have to wait for additional n clock
cycles.
4. PARALLEL –IN PARALLEL-OUT: It accepts data in parallel form and produces output in parallel
form. It allows simultaneous entry of all data bits and as well as all the bits appear as parallel output. In
parallel-in parallel-out shift registers (Figure d) both data loading as well as data retrieval processes are
parallel in nature. This means that the entire data word can be entered into the registers at a single clock
tick.
Operation :
1. With M = 1 : Shift right operation
If M = 1, then the AND gates 1, 3, 5 and 7 are enabled whereas the remaining AND gates 2, 4, 6 and
8 will be disabled.The data at DR is shifted to right bit by bit from FF-3 to FF-0 on the application of clock
pulses. Thus with M = 1 the serial shift right operation is performed.
2. With M = 0 − Shift left operation
When the mode control M is connected to 0 then the AND gates 2, 4, 6 and 8 are enabled while 1, 3,
5 and 7 are disabled.The data at DL is shifted left bit by bit from FF-0 to FF-3 on the application of clock
pulses. Thus with M = 0 the serial shift left operation is achieved.
Note : Draw the truth tables and timing diagrams of Shift left and shift right registers
A 4 bit parallel in parallel out shift register is shown in below figure. The process of loading data in
to register is known as the ‘Write Operation’ and the process of reading is known as ‘Read operation’.
This type of shift register also acts as a temporary storage device or as a time delay device similar to
the SISO configuration above. The data is presented in a parallel format to the parallel input pins P3 to P0 and
then transferred together directly to their respective output pinsQ 3 to Q0 by the same clock pulse. Then one
clock pulse loads and unloads the register. This arrangement for parallel loading and unloading is shown
below.
5.0 INTRODUCTION
A group of flip flops connected together to perform counting operation is known as counter. A
counter is a sequential logic circuit used to count the number of clock cycles applied. The counter can be
used as an instrument for measuring time. the counters are mostly constructed using JK flip flops in toggle
mode or T-flip flops. There are basically two types of counters.
1. Asynchronous counters.
2. Synchronous counters.
In Asynchronous counters each flip-flop is triggered by the previous flip-flop output, and clock pulse
is applied to first flip-flop only. These are called as Serial or Ripple or Asynchronous counters. It has
speed limitation.
In Synchronous counter each flip-flop is triggered by clock at same time. This is done by connecting
the single clock pulse to each flip-flop of the counter. These are Parallel or synchronous counters.
Synchronous counters increase the speed of operation.
5.1 MODULUS OF A COUNTER
Modulus of the counter is defined as the total number of states that occur in the output of a counter.
The number of flip-flops needed for the counter depends on the maximum number it has to count.
If a counter consists of n- flip flops, then maximum possible number of states of a counter is 2 n (N).
Therefore the counter can count from 0 to 2n – 1. such counters are known as Modulus or Mod – N
counters.
For example binary counter has 4 flip flops, then maximum possible no of output states are 2 4 = 16.
Then the counter is Mod – 16 counter. a 3-bit binary counter is also called as Mod-8(2 3) counter.coumod-16
counter.
Operation:
1. The operation of the decade counter is performed by the application of ten clock pulses. The clock is input
is applied to first flip-flop only. The next flip-flops are triggered by the outputs of previous flip-flops. The
output of counter is given by Q=QD, QC, QB, QA.
2. From the timing diagram, the output of Q A toggles between HIGH and LOW for every clock pulse. The
output of QB changes its state when QA goes to HIGH to LOW transition, the output of Q C changes its state
when QB goes to negative transition and also QD changes its state when QC goes to negative transition. In this
manner, the counting process will be continued from the count 0000 to 1001.
3.When the counter goes to 1010, the NAND gate output goes LOW and flip-flops are in clear condition.
Thus, when 10th clock pulse occurred output Q is 0000 instead of 1010. Because only Q B & QD are connected
to the NAND gate inputs. The two unique states are QB=1 and QD=1 are sufficient to decode the 1010.
The timing diagram and truth table are shown in fig.
DRAWBACKS OF RIPPLE COUNTERS:
1. The propagation delay is the main disadvantage.
2. The speed of operation is low, because the flip-flops of these counters are not clocked simultaneously.
3. To obtain a truncated sequence it is necessary to force these counters to recycle before going through all
its normal states.
All these drawbacks are eliminated by Synchronous counters
5.4 4-BIT SYNCHRONOUS COUNTER
This counter is implemented with negative edge triggered flip-flops. The clock signal is given to all
the flip flops clock input i.e., all the flip-flops are connected to common clock input. (Synchronous)
This counter consists of 4 J K flip-flops, namely A, B, C and D. Where A flip-flop ii the LSB and D
flip-flop is the MSB of the counter. In synchronous binary counter, the flip-flop in the LSB position toggles
(complement) for every clock pulse. The other flip-flops are toggled (complemented) with a pulse provided
all the bits in lower order positions are equal to 1.
Operation:
The basic operation of the 4-bit synchronous counter can be illustrated from its timing diagram. The
output of counter is given by Q=QD, QC, QB and QA. Initially all the flip-flops are in reset condition and the
count Q=0000.
1. When the first clock pulse arrives the first flip-flop goes from LOW to HIGH. The output Q=0001.
In the timing diagram notice that QA changes to each clock pulse.
2. When the second clock pulse arrives, the first and second flip-flops toggles because of the HIGH
level at the both J & K inputs. Thus the first flip-flop goes to LOW and second flip-flop goes to
HIGH. Output of the counter Q=0010.
3. When the third clock pulse arrives the output of the counter Q=0011. Now both QA and QB are 1.
Hence the output of first AND gate is high. The output of this AND gate is connected to J and K
inputs of FF-C. therefore FF c toggles during the next clock pulse.
4. When fourth clock pulse arrives, the first and second flip-flops toggles and go to LOW. the third flip
flop also toggles and Qc becomes 1. Then the output Q=0100. Similarly the fifth, sixth and
seventh clock pulses occurs, then the counter counts from 0101 to 0111 respectively.
5. Whenever QA, QB, QC are at HIGH, the fourth flip-flop changes its state during the eight clock
pulse. the fourth flip flop toggles only twice in the sequence. This condition is detected by the AND
gate. So, that when the clock pulse occurs, the fourth flip-flop will change the state.
6. Whenever the clock pulse occurs periodically from eight clock pulse to fifteenth clock pulse, then the
counter counts from 1000 to 1111.
7.When sixteenth clock pulse occurs all the four flip-flops change from 1 to 0 and the output becomes
Q=0000.
TRUTH TABLE:
5.7 IC NUMBERS
FLIP FLOPS :
REGISTERS
TTL CMOS REGISTER FUNCTION
7491 4031 8-Bit Serial In Serial Out register
74164 4014 8-Bit Serial In Parallel Out register
74165 ------ 8-Bit Parallel In Serial Out register
74195 4035 4-Bit Parallel In Parallel Out register
74194 4034 4-Bit bidirectional universal shift register
COUNTERS
TTL IC FUNCTION CMOS FUNCTION
7490 Decade counter 4510 Up/down counter
7492 Divided by 12 counter 4518 Dual 4-bit decade
7493 4-bit (Mod-16) Ripple counter counter
74160 - 74163 4-bit synchronous counter 4520 Dual 4-bit Binary counter
74168,74169 4-bit Synchronous Up/Down counter