Logic Design Fundamentals - V1
Logic Design Fundamentals - V1
https://Proxelera.com
Contents
• Digital Logic Design Overview
• Introduction
• Digital Logic System Basic
• Basic Digital Logic Combinational Gates
• Basic Digital Sequential/Memory 1 bit memory
• Demorgan's/Karnaugh Law
• PoS & SoP
• RAM/ROM introduction
• Conclusion
Overview of Digital Logic Design
• Digital Logic Design is the process of creating digital circuits that
perform specific functions
• It involves the use of logic gates. Flip-flops, multiplexers & other
digital components to create a circuit that performs a specific
task/function
• Digital logic design is based on Boolean Algebra, mathematical system
for representing & manipulating logical expressions.
• Digital Logic Designs are used in applications like computer systems,
mobile, communication, remote sensing, bio-medical, etc applications
Introduction to Digital Logic Basics
• Hardware/functional system consists of few system building blocks
• These are called logic gates
• AND, OR, NOT, …
• NAND, NOR, XOR..
• The rules of De-Morgan's theorem are produced from the Boolean expressions for OR, AND, and
NOT using two input variables x and y. The first theorem of De Morgan's says that if we perform
the AND operation of two input variables and then perform the NOT operation of the result, the
result will be the same as the OR operation of the complement of that variable. The second
theorem of De Morgan says that if we perform the OR operation of two input variables and then
perform the NOT operation of the result, the result will be the same as the AND operation of the
complement of that variable.
Input variables Output Condition
A B AND NAND OR NOR
0 0 0 1 0 1
0 1 0 1 1 0
1 0 0 1 1 0
1 1 1 0 1 0
• According to the first theorem, the complement result of the AND
De-Morgan's First Theorem
0 0 0 1 1 1 1
0 1 0 1 1 0 1
1 0 0 1 0 1 1
1 1 1 0 0 0 0
De-Morgan's Second Theorem
• According to the second theorem, the complement result of the OR
operation is equal to the AND operation of the complement of that
variable. Thus, it is the equivalent of the NOR function and is a
negative-AND function proving that (A+B)' = A'.B'
Inputs Output For Each Term
A B A+B (A+B)' A' B' A'.B'
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0
De-Morgan's Theorem Problems
• Let's take some examples in which we take some expressions and apply De Morgan's theorems.
Example : ((A+BC')'+D(E+F')')'
• For applying the De Morgan's theorem on this expression, we have to follow the following expressions:
• 1) In complete expression, first, we find those terms on which we can apply the De Morgan's theorem and treat each term as a single variable
So,
3) Next, we use rule number 9, i.e., (A=(A')') for canceling the double bars.
BC BC BC BC
A 00 01 11 10 A 00 01 11 10 A 00 01 11 10 A 00 01 11 10
0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 1
1 1 0 0 0 1 1 1 0 0 1 1 1 0 0 1 0 0 0 0
BC BC BC BC
A 00 01 11 10 A 00 01 11 10 A 00 01 11 10 A 00 01 11 10
0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1
1 0 0 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1
Four-Variable K-Maps
CD CD CD CD
00 01 11 10 00 01 11 10 00 01 11 10 00 01 11 10
AB AB AB AB
00 1 0 0 0 00 0 0 0 0 00 0 0 0 0 00 0 0 0 0
01 0 0 0 0 01 0 1 0 0 01 0 0 0 0 01 1 0 0 1
11 0 0 0 0 11 0 1 0 0 11 0 1 1 0 11 0 0 0 0
10 1 0 0 0 10 0 0 0 0 10 0 0 0 0 10 0 0 0 0
CD CD CD CD
00 01 11 10 00 01 11 10 00 01 11 10 00 01 11 10
AB AB AB AB
00 0 0 1 1 00 0 0 0 0 00 0 0 1 1 00 1 0 0 1
01 0 0 1 1 01 1 0 0 1 01 0 0 0 0 01 0 0 0 0
11 0 0 0 0 11 1 0 0 1 11 0 0 0 0 11 0 0 0 0
10 0 0 0 0 10 0 0 0 0 10 0 0 1 1 10 1 0 0 1
01 1 1 1 1 01 0 0 1 0 01 0 1 0 1 01 1 0 1 0
11 0 0 0 0 11 0 0 1 0 11 1 0 1 0 11 0 1 0 1
10 0 0 0 0 10 0 0 1 0 10 0 1 0 1 10 1 0 1 0
CD CD CD CD
00 01 11 10 00 01 11 10 00 01 11 10 00 01 11 10
AB AB AB AB
00 0 1 1 0 00 1 0 0 1 00 0 0 0 0 00 1 1 1 1
01 0 1 1 0 01 1 0 0 1 01 1 1 1 1 01 0 0 0 0
11 0 1 1 0 11 1 0 0 1 11 1 1 1 1 11 0 0 0 0
10 0 1 1 0 10 1 0 0 1 10 0 0 0 0 10 1 1 1 1
Inputs Output
A B C X X (3, 5, 6, 7)
0 0 0 0 0
1 0 0 1 0 X
BC
2 0 1 0 0 A 00 01 11 10
3 0 1 1 1 0 0 0 1 0
4 1 0 0 0 1 0 1 1 1
5 1 0 1 1
6 1 1 0 1
7 1 1 1 1 X AC AB BC
A B C
Design of combinational digital circuits (Cont.)
• Example: Design a 4-input (A,B,C,D) digital circuit that will give at its output (X) a logic 1 only if
the binary number formed at the input is between 2 and 9 (including).
Inputs Output
A B C D X X (2,3,4,5,6,7,8,9)
0 0 0 0 0 0
1 0 0 0 1 0 X
2 0 0 1 0 1 CD
3 0 0 1 1 1 AB 00 01 11 10
4 0 1 0 0 1 00 0 0 1 1 Same
5 0 1 0 1 1
01 1 1 1 1
6 0 1 1 0 1
7 0 1 1 1 1 11 0 0 0 0
8 1 0 0 0 1 10 1 1 0 0
9 1 0 0 1 1
10 1 0 1 0 0
11 1 0 1 1 0
12 1 1 0 0 0 X AC AB A B C
13 1 1 0 1 0
14 1 1 1 0 0
15 1 1 1 1 0 A B C D X
Generalized FSM model: Moore and Mealy
• Types of Memory
• Primary memory (RAM and ROM)
• Secondary memory (Hard Drive, CD, etc).
Random Access Memory (RAM)
• It is also called read-write memory or the main • Types of Random Access Memory (RAM)
memory or the primary memory. • 1. Static RAM: SRAM stands for Static Random
• The programs and data that the CPU requires Access Memory. It is a type of semiconductor which is
during the execution of a program are stored in this widely used in computing devices and
memory. microprocessors.
• It is a volatile memory as the data is lost when the • 2. Dynamic RAM: DRAM stands for Dynamic
power is turned off Random Access Memory. It is made of Capacitors and
has smaller data life span than Static RAM
Read-Only Memory (ROM)
Construct a 16:1 Mux with two 8:1 mux and one 2:1 Mux
NOT, AND, OR, XOR gates
Design the following gates using of 2:1 Muxes
Show the AOI implementation of a 2:1 Mux Convert AOI implementation of a 2:1 Mux to 2
input NAND implementation
So, the waveform for NOT gate is not:
CMOS Inverter
• When VI is pulled low (VSS), the NMOS inverter is turned off, while the
PMOS is turned on pulling the output up to VDD
3. 5
3. 0
NM
H
2. 0
1. 5
NM
1. 0 L
0. 5
0 1 2 3 4 5 6 7 8 9 10 11
K
R
t f 2 PHL
t r 2 PLH
Introduction
• Memory Elements
• Pulse-Triggered Latch
S-R Latch
Gated S-R Latch
Gated D Latch
• Edge-Triggered Flip-flops
S-R Flip-flop
D Flip-flop
J-K Flip-flop
T Flip-flop
• Asynchronous Inputs
Introduction
Memory Q
command element stored value
• Characteristic table:
Command Q(t) Q(t+1)
(at time t) Q(t): current state
Set X 1 Q(t+1) or Q+: next state
Reset X 0
Memorise / 0 0
No Change 1 1
Memory Elements
• Memory element with clock. Flip-flops are memory elements that
change state on clock signals.
Memory Q
command element stored value
clock
• Clock is usually a square wave
Positive pulses
For active-HIGH input S-R latch (also known as NOR gate latch),
1. R=HIGH (and S=LOW) a RESET state
S R Q Q'
2. S=HIGH (and R=LOW) a SET state 1 0 1 0 initial
0 0 1 0 (afer S=1, R=0)
3. Both inputs LOW a no change 0 1 0 1
0 0 0 1 (after S=0, R=1)
4. Both inputs HIGH a Q and Q' both LOW (invalid)! 1 1 0 0 invalid!
Gated D Latch
Make R input equal to S' gated D latch.
D latch eliminates the undesirable condition of invalid state in the S-R latch.
EN D Q(t+1)
D
Q D Q 1 0 0 Reset
EN EN 1 1 1 Set
0 X Q(t) No change
Q' Q'
When EN=1, Q(t+1) = D
When EN is HIGH,
D=HIGH latch is SET
D=LOW latch is RESET
1 1 0
CLK Q
: Rising Edge of Clock
Clock signal
S D J
Q Q Q
C C C
Q' Q' K Q'
R
Negative edge-triggered flip-flops
S-R Flip-flop
S-R flip-flop: on the triggering edge of the clock pulse,
S=HIGH (and R=LOW) a SET state
R=HIGH (and S=LOW) a RESET state
both inputs LOW a no change
both inputs HIGH a invalid
Characteristic table of positive edge-triggered S-R flip-flop:
S R CLK Q(t+1) Comments
0 0 X Q(t) No change
0 1 0 Reset X = irrelevant (“don’t care”)
1 0 1 Set = clock transition LOW to HIGH
1 1 ? Invalid
S-R Flip-flop
It comprises 3 parts:
a basic NAND latch
a pulse-steering circuit
a pulse transition detector (or edge detector) circuit
The pulse transition detector detects a rising (or falling) edge and
produces a very short-duration spike.
S-R Flip-flop
• The pulse transition detector.
S
Q
Pulse
CLK transition
detector
Q'
R
CLK' CLK'
CLK CLK CLK*
CLK*
CLK CLK
CLK' CLK'
CLK* CLK*
CLK
1 0 1 Set 1 1 Q(t)' Toggle
1 1 Toggle
K Q
: Rising Edge of Clock
J/K Flip-Flop: Example Timing
Clock Edges
T Flip-flop
• T flip-flop: single-input version of the J-K flip flop, formed by tying
both inputs together
T T J
Q Q
Pulse C
transition CLK
CLK K
detector Q'
Q'
Characteristic table
Q T Q(t+1)
0 0 0
T CLK Q(t+1) Comments
0 1 1
0 Q(t) No change 1 0 1
1 Q(t)' Toggle 1 1 0
D CLK Q Q
D Q
0 0 1
1 1 0
CLK Q
tS tH
Setup Time Hold Time
Positive 1
Edge
Clock 0
• Setup Time (tS): The time interval before the active transition of the clock signal during
which the data input (D, J, or K) must be maintained.
• Hold Time (tH): The time interval after the active transition of the clock signal during
which the data input (D, J, or K) must be maintained.
Asynchronous Inputs
• Asynchronous inputs (Preset & Clear) are used to override the clock/data inputs
and force the outputs to a predefined state.
Q 1 & Q 0 PR
D Q
• The Clear (CLR) input forces the output to:
Q 0 & Q 1 CLK Q
PR CLR CLK D CLR
PRESET CLEAR CLOCK DATA
1 1 0 0 1
1 1 1 1 0
0 1 X X 1 0 Asynchronous Preset
1 0 X X 0 1 Asynchronous Clear
0 0 X X 1 1 ILLEGAL CONDITION
D Flip-Flop: PR & CLR Timing
Transparent D-Latch
EN D Q Q
D Q
0 X Q0 Q0
1 0 0 1
EN Q
1 1 1 0
Transparent D-Latch: Example Timing
Flip-Flop Vs. Latch
• The primary difference between a D flip-flop and D latch is the
EN/CLOCK input.
• The flip-flop’s CLOCK input is edge sensitive, meaning the flip-flop’s
output changes on the edge (rising or falling) of the CLOCK input.
• The latch’s EN input is level sensitive, meaning the latch’s output
changes on the level (high or low) of the EN input.