To Digital Electronics: Bharati Vidyapeeth's Institute of Computer Applications and Management, New Delhi-63
To Digital Electronics: Bharati Vidyapeeth's Institute of Computer Applications and Management, New Delhi-63
to
Digital Electronics
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 2
Analog and Digital
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 3
Analog and Digital Data and Signal
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 4
Comparison of Analog and Digital
Signals
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 5
Digital Electronics
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 6
Electronic Aspects of Digital
Design
• How we represent digital information in electronic
devices?
By discrete voltages.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 7
What is the
Basic Digital Element
in Electronics
?
a Switch
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 8
Using Switch to Represent Digital
Information
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 9
Digital Abstraction
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 10
Logic levels
• Undefined region
is inherent
digital, not analog
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 11
Analog versus Digital
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 12
Representing Information
Electronically
“Analog electronics” deals with non-discrete values
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 13
Benefits of Digital over Analog
• Reproducibility
• Not effected by noise means quality
• Ease of design
• Data protection
• Programmable
• Speed
• Economy
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 14
Digital Revolution
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 15
Basic terminology
Gate
A device that performs a basic operation on electrical signals
Circuits
Gates combined to perform more complicated tasks
Boolean expressions
Uses Boolean algebra, a mathematical notation for expressing two-
valued logic
Logic diagrams
A graphical representation of a circuit; each gate has its own symbol
Truth tables
A table showing all possible input value and the associated output
values
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 16
Circuits
Combinational circuit
Input(s) Output(s)
circuit
memory
Sequential circuit
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 17
Digital Devices
• Combinational circuit
Gates
Multiplexer
Demultiplexer
Adders
Encoder
Decoder
• Sequential circuit
Flip-Flops
Registers
Counters
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 18
Combinational Circuits
• Gates
• Iterative combinational circuits
• Binary adders
Half and full adders
Ripple carry
Binary subtraction
• Binary adder-subtractors
Signed binary numbers
Signed binary addition and subtraction
Overflow
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 20
Combinational Circuits
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 21
Gates
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 22
Digital Logic
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 23
NOT Gate
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 24
AND Gate
•An AND gate accepts two input signals
•If both are 1, the output is 1; otherwise the output is 0
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 25
OR Gate
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 26
XOR Gate
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 27
XOR Gate
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 28
NAND Gate
•The NAND gate accepts two input signals
•If both are 1, the output is 0; otherwise, the output is 1
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 29
NOR Gate
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 30
De Morgan again
A NAND gate:
Y = A.B = A + B
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 31
Dual gates
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 32
Truth Tables and Boolean
Notation
NAND Gate
Representation
It is possible to NOT
implement any X X
boolean expression
using only NAND AND A.B
A
gates B
A.B
OR
A
A B A.B A+B
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 33
Truth Tables and Boolean
Notation
NAND Gate representation
Implement the following circuit using only NAND gates
x2
x4
x3
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 34
Solution
B
AND feeding OR
x2
x4
x3
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 35
Exercise
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 36
Solution
Similar pattern to using NAND gates (not surprising)
NOT
X X X X
A.B A
A
A.B
B
AND A.B
A+B A.B
A
A+B
B
B OR
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 37
Logic Gates
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 38
Truth Tables and Boolean
Notation
NOR Gate representation
It is also possible to implement any boolean expression using
only NOR gates
Implement the following circuit using only NOR gates
X4
X3
X2
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 39
Solution
X4
X3
X2
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 40
Logic Gates
Gates can have multiple inputs and more than one output.
A second output can be provided for the complement
of the operation.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 41
Conclusion
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 42
Implementation
F=X.Y.+X’.Y’.Z
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 43
Iterative Combinational
Circuits
• Arithmetic functions
Operate on binary vectors
Use the same subfunction in each bit position
• Can design functional block for subfunction and repeat to
obtain functional block for overall function
• Cell - subfunction block
• Iterative array - a array of interconnected cells
• An iterative array can be in a single dimension (1D) or
multiple dimensions
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 44
Block Diagram of a 1D Iterative
Array
A n-1B n-1 A1 B0
X n-1 X2 X1
Xn X0
Cell n-1 Y n-1 Y2 Cell 1 Y1 Cell 0
Yn Y0
Cn-1 C1 C0
Example: n = 32
Number of inputs = ?
Truth table rows = ?
Equations with up to ? input variables
Equations with huge number of terms
Design impractical!
Iterative array takes advantage of the regularity to make design feasible
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 45
Functional Blocks: Addition
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 46
Functional Block: Half-Adder
X Y C S
0 0 0 0
X 0 0 1 1
0 1 0 1
+Y +0 +1 +0 +1
1 0 0 1
CS 00 01 01 10
1 1 1 0
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 47
Logic Simplification: Half-
Adder
The K-Map for S, C is:
This is a pretty trivial map! S Y C Y
By inspection:
0 11 0 1
X 12 3 X 2 13
S XY XY X Y
S ( X Y )( X Y )
and
C XY
C ( ( XY ) )
These equations lead to several implementations.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 48
Five Implementations: Half-
Adder
• We can derive following sets of equations for a half-adder:
• (a), (b), and (e) are SOP, POS, and XOR implementations for S.
• In (c), the C function is used as a term in the AND-NOR
implementation of S, and in (d), theC function is used in a POS
term for S.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 49
Implementations: Half-Adder
SX Y C
C XY
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 50
Functional Block: Full-Adder
• A full adder is similar to a half adder, but includes a carry-
in bit from lower stages. Like the half-adder, it computes
a sum bit, S and a carry bit, C.
For a carry-in (Z) of
Z 0 0 0 0
0, it is the same as
the half-adder: X 0 0 1 1
+Y +0 +1 +0 +1
For a carry- in CS 00 01 01 10
(Z) of 1:
Z 1 1 1 1
X 0 0 1 1
+Y +0 +1 +0 +1
CS 01 10 10 11
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 51
Logic Optimization: Full-Adder
Full-Adder Truth Table:
X Y Z C S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
Full-Adder K-Map: 1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
S Y C Y
0
11 3
12 0 1
13 2
X 14 17 X 15 17 16
5 6 4
Z Z
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 52
Equations: Full-Adder
• From the K-Map, we get:
SX YZ X Y Z X YZ X YZ
C X Y X Z Y Z
• The S function is the three-bit XOR function (Odd Function):
SX Y Z
• The Carry bit C is 1 if both X and Y are 1 (the sum is 2), or if the
sum is 1 and a carry-in (Z) occurs. Thus C can be re-written as:
C X Y (X Y) Z
• The term X·Y is carry generate.
• The term XY is carry propagate.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 53
Full Adder Circuit
X
Y Sum
Cout
Z=Cin
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 54
Binary Adders
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 56
Combinational Circuits
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 57
4-bit Ripple-Carry Binary Adder
B3 A3 B2 A2 B1 A1 B0 A
C3 C2 C1
FA FA FA C0
C4 S3 S2 S1 S0
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 58
Signed Integer Representations
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 59
Signed Integers
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 61
2’s Complement Method
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 62
Signed Integer Representation
Example
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 63
Signed-Complement Arithmetic
Addition:
1. Add the numbers including the sign bits, discarding a carry
out of the sign bits (2's Complement), or using an end-around
carry (1's Complement).
2. If the sign bits were the same for both numbers and the sign of
the result is different, an overflow has occurred.
3. The sign of the result is computed in step 1.
Subtraction:
Form the complement of the number you are subtracting and
follow the rules for addition.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 64
2’s Complement Adder/Subtractor
of B is formed by using S
XORs to form the 1’s
comp and adding the 1
applied to C0.
For S = 0, add, B is FA
C3
FA
C2
FA
C1
FA
C0
passed through
unchanged C4 S3 S2 S1 S0
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 65
Overflow Detection
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 66
Overflow Detection
• Signed number cases with carries Cn and Cn-1 shown for correct result signs:
0 00 01 11 1
0 0 1 1
+0 -1 -0 +1
0 0 1 1
• Signed number cases with carries shown for erroneous result signs (indicating
overflow):
0 10 11 01 0
0 0 1 1
+ 0 - 1 -0 + 1
1 1 0 0
• Simplest way to implement overflow V = Cn + Cn - 1
• This works correctly only if 1’s complement and the addition of the carry in of
1 is used to implement the complementation! Otherwise fails for - 10 ... 0
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 67
Other Arithmetic Functions
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 68
Incrementing & Decrementing
Incrementing
Adding a fixed value to an arithmetic variable
Fixed value is often 1, called counting (up)
Examples: A + 1, B + 4
Functional block is called incrementer
Decrementing
Subtracting a fixed value from an arithmetic variable
Fixed value is often 1, called counting (down)
Examples: A - 1, B - 4
Functional block is called decrementer
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 69
Multiplication/Division by 2n
(a) Multiplication
by 100 B3 B2 B1 B0
Shift left by 2
0 0
(b) Division C5 C4 C3 C2 C1 C0
(a)
by 100
Shift right by 2
B3 B2 B1 B0
Remainder
preserved 0 0
C3 C2 C1 C0 C21 C22
(b)
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 70
Combinational Circuits
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 71
Example of a Combinatorial Circuit:
A Multiplexer
(MUX)
• Consider an integer ‘m’, which is
• constrained by the following relation:
• m = 2n , where m and n
are both integers.
• A m-to-1 Multiplexer has
m Inputs: I0, I1, I2, ................ I(m-1)
one Output: Y
n Control inputs: S0, S1, S2, ...... S(n-1)
One (or more) Enable input(s)
• such that Y may be equal to one of the inputs, depending upon
the control inputs.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 72
Examples
The Multiplexer
Selects one of 2n inputs and copies it to a single
output
The selected line is determined from the bit
combination (address) on the n selection lines
e.g. 1 from 2 mutiplexer n=1
a 0 out
sel a b out b 1
0 0 0
0 0 1 sel
0 1 0
ab
00 01 11 10
0 1 1 sel
0
1 0 0
1
1 0 1
1 1 0 out =
1 1 1
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 73
K map for 2:1 Multiplexer
AB
sel 00 01 11 10
sel
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 74
2:1 Multiplexer
sel a b out
sel a b out 0 0 ? 0
0 0 0 0 0 1 ? 1
0 0 1 0 1 ? 0 0
0 1 0 1 1 ? 1 1
0 1 1 1 if a is selected, don’t
care about b.
1 0 0 0
AB
1 0 1 1
sel 00 01 11 10
1 1 0 0
0 1 1
1 1 1 1
1 1 1
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 75
Combinational Circuits
If S0 = 1 and S1 = 0,
which input is
transferred to the
output?
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 76
Demultiplexer (DMUX)/
Decoder
• A 1-to-m DMUX, with ACTIVE HIGH Outputs, has
• 1 Input: I ( also called as the Enable input when the
device is called a Decoder)
• m ACTIVE HIGH Outputs: Y0, Y1,
Y2, ..................................... …………….Y(m-1)
• n Control inputs: S0, S1, S2, ...... S(m-1)
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 77
Characteristic table of the 1-to-4 DMUX
with ACTIVE HIGH Outputs:
Table 1
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 78
Characteristic Table of a 1-to-4 DMUX, with
ACTIVE LOW Outputs:
Table 2
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 79
The diagram below shows the relation
between a multiplexer and a Demultiplexer.
Y0
I0 4 to 1 1 to 4
MUX DEMUX
I1
Y1
Y out Input
I2 Y2
I3 Y4
S1 S0 S1 S0
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 80
Combinational Circuits
• Decoders are another important type of combinational circuit.
• Among other things, they are useful in selecting a memory
location according a binary value placed on the address lines
of a memory bus.
• Address decoders with n inputs can select any of 2n
locations.
This is a block
diagram for a
decoder.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 81
Combinational Circuits
If x = 0 and y = 1,
which output line
is enabled?
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 82
A Decoder is a Demultiplexer with a change in
the name of the inputs :
Y0
2 to 4
Decoder
ENABLE Y1
INPUT Y2
Y4
S1 S0
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 83
DECODER
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 84
Characteristic Table of a 2-to-4 DECODER, with ACTIVE
LOW Outputs and with ACTIVE LOW Enable Input:
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 85
Encoders
• Multiple-input/multiple-output
device.
code words.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 86
Encoders vs. Decoders
Decoder Encoder
Binary decoders/encoders
n-to-2^n 2^n-to-n encoder
Input code : Binary Code Input code : 1-out-of-
2^n.
Output code :1-out-of-
2^n. Output code : Binary
Code
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 87
Encoder/Decoder Vocabulary
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 88
ENCODERS AND DECODERS
A0 O0 A0 O0
A1 O1 A1 O1
A2 O2 A2 O2
A3 ENCODER DECODER O3
A4 O4
A5 O5
A6 O6
A7 O7
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 89
Binary Encoder
Binary encoder
• I1
Input code : 1-out-of-2^n.
I2 Y0
• Output code : Binary Code
I3 Y1
• Example : n=3, 8-to-3 encoder
I4 Y2
Inputs Outputs
I5
I0 I1 I2 I3 I4 I5 I6 I7 Y2 Y1 Y0 I6
1 0 0 0 0 0 0 0 0 0 0 I7
0 1 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 0 1 1 1 1
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 90
8-to-3 encoder Implementation
• Simplified implementation:
- From the truth table
I0
Y0 = I1 + I3 + I5 + I7
Y1 = I2 + I3 + I6 + I7 I1
Y2
Y2 = I4 + I5 + I6 + I7
I2
• Limitations :
- I0 has no effect on the output I3
- Only one input can be activated I4 Y1
• Application: I5
Handling multiple devices requests
I6
But, no simultaneous requests
Y0
• Establishing priorities solve the I7
problem of multiple requests
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 91
What you should be able to
do:
•Change circuits using one set of gates (e.g. AND, OR, NOT)
to their equivalent using NAND or NOR gates only (and vice
versa).
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 92
TEST
ANSWER THE FOLLOWING QUESTIONS WITH ONE OR MORE
OF THESE WORDS: MUX, DEMUX, ENCODER, DECODER.
A. Has more inputs than outputs. ENCODER, MUX
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 93
Sequential Logic
X=X+A
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 95
Sequential Circuits
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 96
Integrated Circuits
• A collection of one or more gates fabricated on a
single silicon chip is called an integrated circuit (IC).
• ICs were classified by size:
SSI - small scale integration - 1~20 gates
MSI - medium scale integration - 20~200 gates
LSI - large scale integration - 200~200,000 gates
VLSI - very large scale integration - over 1M transistors
• Pentium-III - 40 million transistors
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 97
Sequential circuit concepts
•The addition of a memory device to a combinational circuit allows
the output to be fed back into the input:
•To retain their state values, sequential circuits rely on feedback.
•Feedback in digital circuits occurs when an output is looped back to
the input.
Input(s) Output(s)
circuit
memory
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 98
Synchronous and
Asynchronous
Input(s) Output(s)
circuit
memory
Clock
pulse
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 99
Sequential Circuits
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 100
Sequential Circuits
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 101
Sequential Circuits
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 102
Clock Pulse Definition
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 103
Flip-flops
• A device that stores either a 0 or 1.
• Stored value can be changed only at certain times
determined by a clock input.
• New value depend on the current state and it’s
control inputs
• A digital circuit that contains filp-flops is called a
sequential circuit
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 104
Flip-flops
J-K flip-flops
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 105
Latches
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 106
Latches
The SR Latch
Consider the following circuit
1
R Q R R Q Q
0
S S Q Q
1 Q
S
Symbol
0 Circuit
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 107
SR Latch operation
Assume some previous operation has Q as a 1
Assume R and S are initially inactive
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 108
Reset goes active
R=1
When R goes active 1, the output Q=0
from the first gate must be 0.
This 0 feeds
S=0 ~Q = 1
back to gate 2
S=0 ~Q = 1
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 109
Reset goes in-active
When R now goes in-active 0, the
feedback from ~Q (still 1), holds R=0
Q=0
Q at 0.
S=0 ~Q = 1
The “pulse” in R has changed
the output as shown in the
function table:
R S Qn+1
We went from here 0 0 Qn
0 1 1 And back
To here 1 0 0 again
1 1 ?
In that process, Q changed from 1 to 0. Further signals on R
will have no effect.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 110
Set the latch
•Similar sequences can be followed to show that setting S to 1 then 0 –
activating S – will set Q to a 1 stable state.
•When R and S are activated simultaneously both outputs will go to a 0
R=1
Q=0
S=1 ~Q = 0
R S Qn+1
This collapse is 0 0 Qn Future output = present output
unpredictable. Set the latch
0 1 1
1 0 0 Reset the latch
Thus our function table: 1 1 ? Don’t know
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 112
Sequential Switching Elements
R-S Latch Revisited
Truth Table: Derived K-Map:
Next State = F(S, R, Current State) S
SR
S(t) R(t) Q(t) Q(t+) 00 01 11 10
Q( t )
0 0 0 0 HOLD 0 0 0 X 1
0 0 1 1
1 1 0 X 1
0 1 0 0 RESET
0 1 1 0 R
1 0 0 1 SET
1 0 1 1 Characteristic Equation:
1 1 0 X Not Allowed Q+ = S + R Q t
1 1 1 X
S
R-S
R Latch Q+
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 113
Application of the SR Latch
An important application of SR latches is for recording short
lived events
e.g. pressing an alarm bell in a hospital
bed1
R Q light
RS
Latch
1 S
bed1
button bed2
R Q light
bed2 RS
button Latch
1 S warning
bell
1 master
reset
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 114
Clocks and synchronization
• A clock is a special device that whose output continuously alternates between 0
and 1.
clock period
• The time it takes the clock to change from 1 to 0 and back to 1 is called the
clock period, or clock cycle time.
• The clock frequency is the inverse of the clock period. The unit of measurement
for frequency is the hertz.
• Clocks are often used to synchronize circuits.
They generate a repeating, predictable pattern of 0s and 1s that can trigger
certain events in a circuit, such as writing to a latch.
If several circuits share a common clock signal, they can coordinate their
actions with respect to one another.
• This is similar to how humans use real clocks for synchronization.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 115
The Clocked SR Latch
R
Q
Q
S
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 116
Clocked SR Latch
R S C Qn+1
R R Q Q X X 0 Qn Hold
C 0 0 1 Qn Hold
C
0 1 1 1 Set
S S Q Q 1 0 1 0 Reset
1 1 1 ? Unused
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 117
Clocked D Latch
D S
Q
Q
R
D
S Q Q
D Q D C Qn+1
C C X 0 Qn Hold
R Q Q C Q 0 1 0 Reset
1 1 1 Set
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 119
Transparency
1
C
0 When the clock
1
t “gate” opens,
D changes in input
0
t
take effect at
1 outputs –
Q transparency.
0
t Also known as
“level-triggered”.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 120
Latches - Summary
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 121
Latches and Flip Flops
• Terms are sometimes used confusingly:
• A latch is not clocked whereas a flip-flop is clocked.
• A clocked latch can therefore equally be referred to as a flip flop
(SR flip flop, D flip flop).
• However, as we shall see, all practical flip flops are edge- triggered
on the clock pulse.
• Sometimes latches are included within flip flops as a sub-type.
Clocked latches are level triggered. While the clock is high, inputs
and thus outputs can change.
• This is not always desirable.
• A Flip Flop is edge-triggered – either by the leading or falling edge
• of the clock pulse.
• Ideally, it responds to the inputs only at a particular instant in time.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 122
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Deepali Kamthania 123