Digital-Electronics Easy Presentation PDF
Digital-Electronics Easy Presentation PDF
Digital-Electronics Easy Presentation PDF
ON
DIGITAL ELECTRONICS
4th semester
Branch-Electrical Engineering
AND Gate
1
0
0
Conversion Between Number Bases
Octal(base 8)
Hexadecimal
(base16)
° Learn to convert between bases.
° Conversion demonstrated in next slides
Convert an Integer from Decimal to Another Base
For each digit position:
1. Divide decimal number by the base (e.g. 2)
2. The remainder is the lowest-order digit
3. Repeat first two steps until no divisor remains.
2 22=4 10 210=1024
3 23=8 11 211=2048
4 24=16 12 212=4096
5 25=32 20 220=1M
Mega
6 26=64 30 230=1G
Giga
1 11 1 1 1 carries
11 1 1 0 1
+ 1 0 1 1 1
---------------------
1 0 1 0 1 0 0
Binary Subtraction
1 10 borrows
0 10 10 0 0 10
1 0
0 1 1 0 1
- 1 0 1 1 1
------------------------
1 1 0 1 1 0
Binary Multiplication
1
0 1 1 1
X 1 0 1 0
-----------------------
0 0 0 0 0
1 0 1 1 1
0 0 0 0 0
1 0 1 1 1
-----------------------
1 1 1 0 0 1 1 0
Convert an Integer from Decimal to Octal
For each digit position:
1. Divide decimal number by the base (8)
2. The remainder is the lowest-order digit
3. Repeat first two steps until no divisor remains.
000011002 = 1210
111100112 = -1210
0 1 1 0 0
Add + 0 0 0 0 1
Step 1: Add binary numbers --------------
Step 2: Add carry to low-order bit 0 0 1 1 0 1
Add carry 0
--------------
Final 0 1 1 0 1
Result
1’s Complement Subtraction
° Using 1’s complement numbers, subtracting numbers is also easy.
° For example, suppose we wish to subtract +(0001) 2 from +(1100)2.
° Let’s compute (12)10 - (1)10.
• (12)10 = +(1100)2 = 011002 in 1’s comp. 0 1 1 0 0
• (-1)10 = -(0001)2 = 111102 in 1’s comp. - 0 0 0 0 1
--------------
1’s comp
0 1 1 0 0
Step 1: Take 1’s complement of 2nd operand Add + 1 1 1 1 0
Step 2: Add binary numbers --------------
Step 3: Add carry to low order bit
1 0 1 0 1 0
Add carry 1
--------------
Final
Result 0 1 0 1 1
2’s Complement Addition
° Using 2’s complement numbers, adding numbers is easy.
° For example, suppose we wish to add +(1100)2 and +(0001)2.
° Let’s compute (12)10 + (1)10.
• (12)10 = +(1100)2 = 011002 in 2’s comp.
• (1)10 = +(0001)2 = 000012 in 2’s comp.
0 1 1 0 0
Add + 0 0 0 0 1
Step 1: Add binary numbers --------------
Step 2: Ignore carry bit Final 0 0 1 1 0 1
Result
Ignore
2’s Complement Subtraction
° Using 2’s complement numbers, follow steps for
subtraction
° For example, suppose we wish to subtract +(0001)2 from
+(1100)2.
0 1 1 0 0
° Let’s compute (12)10 - (1)10. - 0 0 0 0 1
• (12)10 = +(1100)2 = 011002 in 2’s comp. --------------
• (-1)10 = -(0001)2 = 111112 in 2’s comp.
2’s comp
0 1 1 0 0
Step 1: Take 2’s complement of 2nd operand Add + 1 1 1 1 1
Step 2: Add binary numbers --------------
Step 3: Ignore carry bit Final
Result 1 0 1 0 1 1
Ignore
Carry
2’s Complement Subtraction: Example #2
° Analysis problem:
. Logic .
Inputs Outputs
Circuit
. .
1 0
Symbol
Input Output
° Basic logic functions have symbols.
° The same functionality can be represented with truth tables.
• Truth table completely specifies outputs for all input combinations.
° The above circuit is an inverter.
• An input of 0 is inverted to a 1.
• An input of 1 is inverted to a 0.
The AND Gate
A
Y
B
1 1 1
The OR Gate
A
Y
B
° This is an OR gate. A B Y
° So, if either of the two 0 0 0
input signals are 0 1 1
asserted, or both of
1 0 1
them are, the output
1 1 1
will be asserted.
Describing Circuit Functionality: Waveforms
AND Gate
A B Y
0 0 0
0 1 0
1 0 0
1 1 1
3 Input OR Gate
Ordering Boolean Functions
° Basic logic functions can be made from AND, OR, and NOT (invert)
functions
° The behavior of digital circuits can be represented with waveforms, truth
tables, or symbols
° Primitive gates can be combined to form larger circuits
° Boolean algebra defines how binary variables can be combined
° Rules for associativity, commutativity, and distribution are similar to
algebra
° DeMorgan’s rules are important.
• Will allow us to reduce circuit sizes.
More Logic Functions: NAND, NOR, XOR
Overview
° Each truth table represents one possible function (e.g. AND, OR)
N
° If there are N inputs, there are 22
° For example, is N is 2 then there are 16 possible truth tables.
° So far, we have defined 2 of these functions
• 14 more are possible.
° Why consider new functions?
• Cheaper hardware, more flexibility.
x y G
0 0 0
0 1 0
1 0 0
1 1 1
The NAND Gate
A
Y
B
° These three properties show that a NAND gate with both of its
inputs driven by the same signal is equivalent to a NOT gate
° A NAND gate whose output is complemented is equivalent to an
AND gate, and a NAND gate with complemented inputs acts as an
OR gate.
° Therefore, we can use a NAND gate to implement all three of the
elementary operators (AND,OR,NOT).
° Therefore, ANY switching function can be constructed using only
NAND gates. Such a gate is said to be primitive or functionally
complete.
NAND Gates into Other Gates
A
Y
NOT Gate A
B Y
A AND Gate
Y
B
OR Gate
The NOR Gate
A
Y
B
NOT Gate A
B Y
A OR Gate
Y
B
AND Gate
The XOR Gate (Exclusive-OR)
A
Y
B
° This is a XOR gate.
° XOR gates assert their output A B Y
0 0 0
when exactly one of the inputs
0 1 1
is asserted, hence the name.
1 0 1
° The switching algebra symbol
1 1 0
for this operation is , i.e.
1 1 = 0 and 1 0 = 1.
The XNOR Gate
A
Y
B
° This is a XNOR gate.
° This functions as an A B Y
exclusive-NOR gate, or 0 0 1
simply the complement of 0 1 0
the XOR gate. 1 0 0
° Basic logic functions can be made from NAND, and NOR functions
° The behavior of digital circuits can be represented with waveforms, truth
tables, or symbols
° Primitive gates can be combined to form larger circuits
° Boolean algebra defines how binary variables with NAND, NOR can be
combined
° DeMorgan’s rules are important.
• Allow conversion to NAND/NOR representations
More Boolean Algebra
Overview
x y z F
0 0 0 0
0 0 1 0 x
0 1 0 0 y
0 1 1 0 F = x(y+z’)
z y+z’
1 0 0 1 z’
1 0 1 0
1 1 0 1
1 1 1 1 F = x(y+z’)
Boolean Functions
x y z xy yz G
0 0 0 0 0 0
0 0 1 0 0 0 x xy
0 1 0 0 0 0 y
0 1 1 0 1 1 G = xy +yz
1 0 0 0 0 0 z
yz
1 0 1 0 0 0
1 1 0 1 0 1
We will learn how to transition between equation,
1 1 1 1 1 1 symbols, and truth table.
Representation Conversion
° Need to transition between boolean expression, truth table,
and circuit (symbols).
° Converting between truth table and expression is easy.
° Converting between expression and circuit is easy.
° More difficult to convert to truth table.
Circuit Boolean
Expression
Truth
Table
Truth Table to Expression
x y z
G = xyz + xyz’ + x’yz
Reducing Boolean Expressions
° Is this the smallest possible implementation of this
expression? No! G = xyz + xyz’ + x’yz
° Use Boolean Algebra rules to reduce complexity while
preserving functionality.
° Step 1: Use Theorum 1 (a + a = a)
• So xyz + xyz’ + x’yz = xyz + xyz + xyz’ + x’yz
x y z
G = xyz + xyz’ + x’yz = xy + yz
Minterms and Maxterms
x y z Minterm x y z Maxterm
0 0 0 x’y’z’ m0 0 0 0 x+y+z M0
0 0 1 x’y’z m1 0 0 1 x+y+z’ M1
… …
1 0 0 xy’z’ m4 1 0 0 x’+y+z M4
… …
1 1 1 xyz m7 1 1 1 x’+y’+z’ M7
Representing Functions with Minterms
° Minterm number same as row position in truth table (starting
from top from 0)
° Shorthand way to represent functions
x y z G
0 0 0 0 G = xyz + xyz’ + x’yz
0 0 1 0
0 1 0 0
0 1 1 1
G = m7 + m6 + m3 = Σ(3, 6, 7)
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
Complementing Functions
° Minterm number same as row position in truth table (starting from top
from 0)
° Shorthand way to represent functions
x y z G G’
0 0 0 0 1 G = xyz + xyz’ + x’yz
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0 G’ = (xyz + xyz’ + x’yz)’ =
1 0 0 0 1
1 0 1 0 1
1 1 0 1 0 Can we find a simpler representation?
1 1 1 1 0
Complementing Functions
x y z G
0 0 0 0 G = xyz + xyz’ + x’yz
0 0 1 0
0 1 0 0
0 1 1 1 G = m7 + m6 + m3 = Σ(3, 6, 7)
1 0 0 0
1 0 1 0
1 1 0 1 G = M0M1M2M4M5 = Π(0,1,2,4,5)
1 1 1 1
G = (x+y+z)(x+y+z’)(x+y’+z)(x’+y+z)(x’+y+z’)
Representation of Circuits
° All logic expressions can be represented in 2-level format
° Circuits can be reduced to minimal 2-level representation
° Sum of products representation most common in industry.
Summary
Rules to consider
Ê Every cell containing a 1 must be included at least once.
B0 1 B0 1
A A
00 1
F=AB +A’B
00 1 F=AB +AB +AB
11 0 11 1 F=A+B
° Three variable maps.
BC
00 01 11 10
A
00 1 0 1
1 1 1 1 1 F=A+B C +BC
AB A
C 00 01 11 10
0
A
0 0 1 1 C 1
G(A,B,C) = A
C 0 0 1 1 B
B
A
1 0 0 1
F(A,B,C) = m(0,4,5,7) = AC + B’C’
C 0 0 1 1
B
More Karnaugh Map Examples
° Examples a
b 0 1 a
0 0 1 b 0 1
1 0 1 0 1 1
1 0 0
f=a
g = b'
ab ab
c 00 01 11 10 c 00 01 11 10
0 0 0 1 0 0 0 0 1 1
1 0 1 1 1 1 0 0 1 1
cout = ab + bc + ac
f=a
Cin
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
A 0 1 0 1 0
Adder S 0 1 1 0 1
B 1 0 0 1 0 How to use a Karnaugh
1 0 1 0 1
1 1 0 0 1 Map instead of the
Cout +
1 1 1 1 1 Algebraic simplification?
Cin
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
A 0 1 0 1 0
Adder S 0 1 1 0 1
B 1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
Cout +
1 1 1 1 1
A
Cin
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
A 0 1 0 1 0
Adder S 0 1 1 0 1
B 1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
Cout +
1 1 1 1 1
A
Now we have to cover all the 1s in the
0 0 1 0 Karnaugh Map using the largest
rectangles and as few rectangles
B 0 1 1 1 as we can.
Cin
Cout = ACin
Karnaugh Map for Cout
Application of Karnaugh Maps: The One-bit Adder
Cin
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
A 0 1 0 1 0
Adder S 0 1 1 0 1
B 1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
Cout +
1 1 1 1 1
A
Now we have to cover all the 1s in the
0 0 1 0 Karnaugh Map using the largest
rectangles and as few rectangles
B 0 1 1 1 as we can.
Cin
Cout = Acin + AB
Karnaugh Map for Cout
Application of Karnaugh Maps: The One-bit Adder
Cin
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
A 0 1 0 1 0
Adder S 0 1 1 0 1
B 1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
Cout +
1 1 1 1 1
A
Now we have to cover all the 1s in the
0 0 1 0 Karnaugh Map using the largest
rectangles and as few rectangles
B 0 1 1 1 as we can.
Cin
Cout = ACin + AB + BCin
Karnaugh Map for Cout
Application of Karnaugh Maps: The One-bit Adder
Cin
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
A 0 1 0 1 0
Adder S 0 1 1 0 1
B 1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
Cout +
1 1 1 1 1
A
0 1 0 1
B 1 0 1 0
Cin S = A’BCin’
Karnaugh Map for S
Application of Karnaugh Maps: The One-bit Adder
Cin
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
A 0 1 0 1 0
Adder S 0 1 1 0 1
B 1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
Cout +
1 1 1 1 1
A
0 1 0 1
B 1 0 1 0
Cin
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
A 0 1 0 1 0
Adder S 0 1 1 0 1
B 1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
Cout +
1 1 1 1 1
A
0 1 0 1
B 1 0 1 0
Cin
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
A 0 1 0 1 0
Adder S 0 1 1 0 1
B 1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
Cout +
1 1 1 1 1
A
0 1 0 1
B 1 0 1 0
° F(A,B,C,D) = m(0,2,3,5,6,7,8,10,11,14,15)
F =C+A’BD+B’D’
A
1 0 0 1
0 1 0 0
D
1 1 1 1
C
1 1 1 1
B
Design examples
A A A
0 0 0 0 1 0 0 0 0 1 1 1
1 0 0 0 0 1 0 0 0 0 1 1
D D D
1 1 0 1 0 0 1 0 0 0 0 0
C C C
1 1 0 0 0 0 0 1 0 0 1 0
B B B
EQ
A
1 0 0 0
0 1 0 0
D
0 0 1 0
C
0 0 0 1
B
K-map for EQ
Karnaugh Maps
° Four variable maps.
CD
00 01 11 10
AB F=ABC +ACD +ABC
00 0 0 0 1
+AB CD +ABC +AB C
01 1 1 0 1
11 1 1 1 1 F=BC +CD + AC+ AD
10 1 0 1 1
A
AB
CD 00 01 11 10
00 0 0 X 0 - Treat X’s like either 1’s or 0’s
- Very useful
01 1 1 X 1
D - OK to leave some X’s uncovered
11 1 1 0 0
C
10 0 X 0 0
B
Karnaugh maps: Don’t cares
° f(A,B,C,D) = m(1,3,5,7,9) + d(6,12,13)
• without don't cares
- f=
A B C D f
A’D + C’D 0 0 0 0 0
0 0 0 1 1
0 0 1 0 0
A 0 0 1 1 1
AB 0 1 0 0 0
CD 00 01 11 10 0 1 0 1 1
00 0 0 X 0 0 1 1 0 X
+
0 +
1 1 1 1
01 1 1 X 1 1 0 0 0 0
D 1 0 0 1 1
11 1 1 0 0 1 0 1 0 0
C 1 0 1 1 0
10 0 X 0 0 1 1 0 0 X
1 1 0 1 X
B 1 1 1 0 0
1 1 1 1 0
Don’t Care Conditions
CD
00 01 11 10
AB
00 0 1 0 0
01 x x x 1 F=ACD+B+AC
11 1 1 1 x
10 x 0 1 1
° Alternative covering.
CD
00 01 11 10
AB
00 0 1 0 0
01 x x x 1 F=ABCD+ABC+BC+AC
11 1 1 1 x
10 x 0 1 1
Karnaugh maps: don’t cares (cont’d)
A'D + C'D
A
by using don't care as a "1"
0 0 X 0
a 2-cube can be formed
1 1 X 1 rather than a 1-cube to cover
D this node
1 1 0 0
C don't cares can be treated as
0 X 0 0 1s or 0s
B depending on which is more
advantageous
Definition of terms for two-level simplification
° Implicant
• Single product term of the ON-set (terms that create a logic 1)
° Prime implicant
• Implicant that can't be combined with another to form an implicant with fewer
literals.
° Objective:
• Grow implicant into prime implicants (minimize literals per term)
• Cover the K-map with as few prime implicants as possible
(minimize number of product terms)
Examples to illustrate terms
A
0 X 1 0 6 prime implicants:
A'B'D, BC', AC, A'C'D, AB, B'CD
1 1 1 0
D
essential
1 0 1 1
C
0 0 1 1 minimum cover: AC + BC' + A'B'D
B
A
5 prime implicants: 0 0 1 0
BD, ABC', ACD, A'BC, A'C'D
1 1 1 0
D
essential 0 1 1 1
C
0 1 0 0
minimum cover: 4 essential implicants
B
PRIME IMPLICANTS
If a function F is represented by
A this Karnaugh Map. Which of the
following terms are implicants of
Example: 1 1 1 F, and which ones are prime
1 1 implicants of F?
D (a) AC’D’
1 (b) BD
C Implicants:
1 1 (c) A’B’C’D’
(a),(c),(d),(e)
(d) AC’
(e) B’C’D’
B Prime Implicants:
(d),(e)
Essential Prime Implicants
A product term is an essential prime implicant if there is a minterm that is
only covered by that prime implicant.
° VOH:- maximum output voltage when the output level is logic “1”
° VOL:- minimum output voltage when the output level is logic “0”
LOGIC DELAY TIMES
° Inverter propagation delay: time delay between input and output signals.
° Typical propagation delays: < 1 ns.
° Estimation of tp: use of square-wave at input side.
LOGIC DELAY TIMES--continued
° Fan-in is the number of inputs of an electronic logic gate which it can drive at
a time. For instance the 'fan-in' for the AND gate shown below is 3. Logic
gates with a large fan-in tend to be slower than those with a small fan-in,
because the complexity of the input circuitry increases the input capacitance
of the device.
° Fan-out is a measure of the ability of a logic gate output, implemented
electronically, to drive a number of inputs of other logic gates of the same
type. In most designs, logic gates are connected together to form more
complex circuits, and it is common for one logic gate output to be connected
to several logic gate inputs.
C-MOS ELECTRONICS
A
GND VDD
Y SiO2
n+ diffusion
p+ diffusion
n+ n+ p+ p+
polysilicon
n well
p substrate
metal1
VDD
A Y
0 1
A Y
1 0
GND
A Y
C-MOS INVERTER
n+ diffusion
p+ diffusion
n+ n+ p+ p+
polysilicon
n well
p substrate
metal1
A B Y
0 0 1
0 1 1 Y
1 0 1 A
1 1 0
B
LOGIC FORMATION USING C-MOS
A B Y
0 0 1 A
0 1 0
1 0 0 B
1 1 0 Y
COMPLEX LOGIC GATES USING C-MOS
Y
A
B
C
COMPLEX LOGIC GATES USING C-MOS
CONCEPT OF DIGITAL
COMPONENTS
DIGITAL COMPONENTS
SEQUENTIAL COMPONENTS
A sequential circuit is a combination of combinational
logic circuit with a memory component. Here the output
at one stage is the function of present state input and
previous outputs.
BINARY ADDERS
° A half adder can add two bits. It has two inputs, generally
labeled A and B, and two outputs, the sum S and carry C
SUM=S
A
HALF ADDER
B CARRY=C
° Sum=S=A (XOR) B
° Carry=C=A (AND) B
HALF ADDER CIRCUIT DIAGRAM
A B C S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
FULL ADDER
° A full adder is capable of adding three bits: two bits and one carry bit. It
has three inputs - A, B, and carry C, such that multiple full adders can be
used to add larger numbers. To remove ambiguity between the input and
output carry lines, the carry in is labelled Ci or Cin while the carry out is
labelled Co or Cout.
Inputs: {A, B, CarryIn} → Outputs: {Sum, CarryOut}
FULL ADDER CIRCUIT DIAGRAM
Input Output
A B Ci Co S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
The expression for the sum and the output carry can be
obtained by drawing the K map.
FULL ADDER USING HALF ADDER
HALF SUBTRACTOR
° The half-subtractor is a combinational circuit which is used to
perform subtraction of two bits. It has two inputs, X (minuend)
and Y (subtrahend) and two outputs D (difference) and B
(borrow).
The truth table for the half subtractor is
given below.
X Y D B
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
A3 a2 a1 a0
× B3 b2 b1 b0
p7 p6 p5 P4 p3 p2 p1 p0
DECODERS
D0
A0
2 to 4 line D1
A1 decoder D2
D3
3 to 8 LINE DECODER
3 to 8
decoder
Contd…..
(implementation of 3-8 decoder using logic gates)
ENCODER
There are two ambiguities associated with the design of a simple encoder:
1. Only one input can be active at any given time. If two inputs are
active simultaneously, the output
produces an undefined combination
for example,
If D3 and D6 are 1 simultaneously, the output of the encoder will be
111.To avoid this we go for priority encoder
2. An output with all 0's can be generated when all the
inputs are 0's,or when D0 is equal to 1.
PRIORITY ENCODER
LOGIC DIAGRAM
MULTIPLEXER
I0
I1 MUX
I2 4-1 Y
I3
S1 S0
DEMULTIPLEXER
Q0
Q1
A
Q2
Q3
S1 S0
Overall operation of
MULTIPLEXER AND DEMULTIPLEXER
MAGNITUDE COMPARATOR
BLOCK DIAGRAM
SYNCHRONOUS SEQUENTIAL LOGIC
Latches are bistable device and level sensitive. These are the basic
building blocks of flip-flops.
SR Latch
When using static gates as building blocks, the most
fundamental latch is the simple SR latch, where S and R
stand for set and reset. It can be constructed from a pair
of cross-coupled NOR or NAND logic gates. The stored
bit is present on the output marked Q
Block diagram of SR Latch
SR LATCH USING NOR AND NAND GATES
SR LATCH WITH CONTROL INPUT
D C Q Q’
D Q 0 0 1
1 1 0
C Q’ X 0 Q0 Q0’
CLOCKED D FLIP-FLOP
Some of the flip flops have asynchronous inputs that are used to
force the flip flop to a particular state independent of the clock.
000
111
001
Fig. State diagram of
110 010 mod-8 counter
101 011
100
RIPPLE (ASYNCHRONOUS COUNTER)
° The state diagram and state table of a 3-bit binary counter are
Contd…
Up = 1; the circuit
counts up.
•Down = 1, Up = 0;
the circuit counts
down.
•Up = 0, Down = 0;
the circuit doesn’t
change state.
•Up = 1, Down = 1,
the circuit counts up.
COUNTER WITH UNUSED STATES
° It is a circular shift register with only one flip-flop being set at any
particular time, all others are cleared. The single bit is shifted from one
flip-flop to the next to produce the sequence of timing signals. A 4-bit
shift register connected as a ring counter is shown below:
Contd…
° Timing diagram
JOHNSON COUNTER
° EXAMPLE