Cse III Logic Design 10cs33 Notes PDF
Cse III Logic Design 10cs33 Notes PDF
10CS33
SYLLABUS
PART-A
UNIT 1
7 Hours
Digital Principles, Digital Logic: Definitions for Digital Signals, Digital Waveforms, Digital Logic, 7400 TTL
Series, TTL Parameters The Basic Gates: NOT, OR, AND, Universal Logic Gates: NOR, NAND, Positive and
Negative Logic, Introduction to HDL.
UNIT 2
6 Hours
Combinational Logic Circuits
Sum-of-Products Method, Truth Table to Karnaugh Map, Pairs Quads, and Octets, Karnaugh Simplifications,
Dont-care Conditions, Product-of-sums Method, Product-of-sums simplifications, Simplification by QuineMcClusky Method, Hazards and Hazard Covers, HDL Implementation Models.
UNIT 3
6 Hours
Data-Processing Circuits: Multiplexers, Demultiplexers, 1-of-16 Decoder, Encoders, Exclusive-or Gates,
Parity Generators and Checkers, MagnitudeComparator, Programmable Array Logic, Programmable Logic
Arrays, HDL
Implementation of Data Processing Circuits
UNIT 4
7
Hours
Clocks, Flip-Flops: Clock Waveforms, TTL Clock, Schmitt Trigger, Clocked D FLIP-FLOP, Edge-triggered D
FLIP-FLOP, Edge-triggered JK FLIP-FLOP, FLIP-FLOP Timing, JK Master-slave FLIP-FLOP, Switch Contact
Bounce Circuits, Various Representation of FLIP-FLOPs, Analysis of Sequential Circuits, HDL Implementation
of FLIP-FLOP
PART-B
UNIT 5
6
Hours
Registers: Types of Registers, Serial In - Serial Out, Serial In - Parallel out, Parallel In - Serial Out, Parallel In Parallel Out, Universal Shift Register, Applications of Shift Registers, Register Implementation in HDL
UNIT 6
7
Hours
Counters: Asynchronous Counters, Decoding Gates, Synchronous Counters, Changing the Counter Modulus,
decade Counters, Presettable Counters, Counter Design as a Synthesis problem, A Digital Clock, Counter
Design
using HDL
UNIT 7
7 Hours
Design of Synchronous and Asynchronous Sequential Circuits: Design of Synchronous Sequential Circuit:
Model Selection, State Transition Diagram, State Synthesis Table, Design Equations and Circuit Diagram,
Implementation using Read Only Memory, Algorithmic State Machine, State Reduction Technique.
Asynchronous Sequential Circuit: Analysis of Asynchronous Sequential Circuit, Problems with Asynchronous
Sequential Circuits, Design of Asynchronous Sequential Circuit, FSM Implementation in HDL
UNIT 8
6 Hours
D/A Conversion and A/D Conversion: Variable, Resistor Networks, Binary Ladders, D/A Converters, D/A
Accuracy and Resolution, A/D Converter- Simultaneous Conversion, A/D Converter-Counter Method,
Continuous A/D Conversion, A/D Techniques, Dual-slope A/D Conversion, A/D Accuracy and Resolution
Text Book:
Dept. of CSE, SJBIT
Logic Design
10CS33
1. Donald P Leach, Albert Paul Malvino & Goutam Saha: Digital Principles and Applications, 7th Edition, Tata
McGraw Hill, 2010.
Reference Books:
1. Stephen Brown, Zvonko Vranesic: Fundamentals of Digital Logic Design with VHDL, 2nd Edition, Tata
McGraw Hill, 2005.
2. R D Sudhaker Samuel: Illustrative Approach to Logic Design, Sanguine-Pearson, 2010.
3. Charles H. Roth: Fundamentals of Logic Design, Jr., 5th Edition, Cengage Learning, 2004.
4. Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss: Digital Systems Principles and Applications, 10th
Edition, Pearson Education, 2007.
Logic Design
10CS33
TABLE OF CONTENTS
Unit-1 : Digital Principles, Digital Logic
Page No.
1.3 Digital Logic 7400 TTL Series, TTL Parameters The Basic
11
12
13
14
16
18
20
21
2.5 Product-of-sums
22
23
25
26
27
29
3.2 Demultiplexers
30
31
3.4 Encoders
32
33
34
35
36
38
40
Logic Design
10CS33
41
41
42
43
43
44
44
45
46
47
47
Unit-5 : Registers
5.1 Types of Registers
48
48
48
49
49
50
50
50
Unit-6 : Counters
6.1 Asynchronous Counters
51
51
52
52
53
53
54
Logic Design
10CS33
54
55
55
56
57
58
59
60
64
65
69
70
71
72
72
73
74
74
75
76
Logic Design
10CS33
Comparison chart
Analog
Digital
Technology:
Representation:
Uses:
Signal:
Clocks:
Computer:
Logic Design
10CS33
Rising edge: the transition from a low voltage (level 1 in the diagram) to a high voltage (level
2).
Falling edge: the transition from a high voltage to a low one.
DTL
RTL
TTL
ECL
The various logic families differ in the current driving capabilities,Logic Levels, propagation delays
and a few other other parameters. The Comparison of TTL and CMOS is clearly illustrated in the
following table as an example of differences in the logic families:
Dept. of CSE, SJBIT
Logic Design
10CS33
TTL
CMOS
Faster
Stronger
drive
capability
Simpler to make
Integration Levels:
The devices greatly differ in the density of fabrication ie the levels of integration used.Depending on
the number of transistors/diodes/gates used in the chip they are broadly classified as :
SSI
MSI
LSI
VLSI
ULSI
GSI
Gates/chip
Applications
SSI
1-100
<12
MSI
100-1000
12-99
Registers Filters
LSI
1000-10000
1000
VLSI
10k gates/chip
ULSI
100k gates/chip
64 bit processor
8 MB memory
Image processor
Logic Design
10CS33
GSI
1M gates/chip
64 MB memory
multiprocessor
Speed of Operation:
As signals propagate through the various gates there is a finite time required for the signal change
to occur, eg the time required for the input high of a n inverter to change to logic low at the
output. This implies that there is a limitation on the no of times the output can change or the speed
of operation of the gate. The parameters of importance for the speed of operation are :
tLH- low to high rise time (tr) : it is defined as the time interval for the signal to rise between
10% to 90% of Vdd
tHL- high to low time or fall time (tf): it is defined as the time for signal to fall from 90%Vdd
to 10%Vdd
tmin=thl+tlh
As the loads are connected to gates to realize the necessary logic operations the output signal levels
are affected. This is because there is a current flow between the gates due to which there is power
consumption. Thus the number of circuits(similar gates) that can be connected to the gates gets
limited.
Dept. of CSE, SJBIT
Logic Design
10CS33
Fan-out of a gate is the number of gates driven by that gate i.e the maximum number of gates
(load ) that can exist without impairing the normal operation of the gate.
Fan-in of a gate is the number of inputs that can be connected to it without impairing the
normal operation of the gate.
1.4 Overview of Basic Gates and Universal Logic Gates
A logic gate is an electronic circuit/device which makes the logical decisions. To arrive at this
decisions, the most common logic gates used are OR, AND, NOT, NAND, and NOR gates. The
NAND and NOR gates are called universal gates. The exclusive-OR gate is another logic gate which
can be constructed using AND, OR and NOT gate.
Logic gates have one or more inputs and only one output. The output is active only for certain input
combinations. Logic gates are the building blocks of any digital circuit. Logic gates are also called
switches. With the advent of integrated circuits, switches have been replaced by TTL (Transistor
Transistor Logic) circuits and CMOS circuits. Here I give example circuits on how to construct
simples gates.
AND Gate
The AND gate performs logical multiplication, commonly known as AND function. The AND gate
has two or more inputs and single output. The output of AND gate is HIGH only when all its inputs
are HIGH (i.e. even if one input is LOW, Output will be LOW).
If X and Y are two inputs, then output F can be represented mathematically as F = X.Y, Here dot (.)
denotes the AND operation. Truth table and symbol of the AND gate is shown in the figure below.
X
0
0
1
1
Y
0
1
0
1
F=(X.Y)
0
0
0
1
OR Gate
The OR gate performs logical addition, commonly known as OR function. The OR gate has two or
more inputs and single output. The output of OR gate is HIGH only when any one of its inputs are
HIGH (i.e. even if one input is HIGH, Output will be HIGH).
Logic Design
10CS33
If X and Y are two inputs, then output F can be represented mathematically as F = X+Y. Here plus
sign (+) denotes the OR operation. Truth table and symbol of the OR gate is shown in the figure
below.
YF=(X+Y)
00
11
01
11
0
0
1
1
NOT Gate
The NOT gate performs the basic logical function called inversion or complementation. NOT gate is
also called inverter. The purpose of this gate is to convert one logic level into the opposite logic level.
It has one input and one output. When a HIGH level is applied to an inverter, a LOW level appears on
its output and vice versa.
If X is the input, then output F can be represented mathematically as F = X', Here apostrophe (')
denotes the NOT (inversion) operation. There are a couple of other ways to represent inversion, F=
!X, here ! represents inversion. Truth table and NOT gate symbol is shown in the figure below.
X
0
1
Y=X'
1
0
NAND Gate
NAND gate is a cascade of AND gate and NOT gate, as shown in the figure below. It has two or more
inputs and only one output. The output of NAND gate is HIGH when any one of its input is LOW (i.e.
even if one input is LOW, Output will be HIGH).
Logic Design
X
0
0
1
1
10CS33
Y
0
1
0
1
F=(X.Y)'
1
1
1
0
NOR Gate
NOR gate is a cascade of OR gate and NOT gate, as shown in the figure below. It has two or more
inputs and only one output. The output of NOR gate is HIGH when any all its inputs are LOW (i.e.
even if one input is HIGH, output will be LOW).
X
0
0
1
1
Y
0
1
0
1
F=(X+Y)'
1
0
0
0
XOR Gate
An Exclusive-OR (XOR) gate is gate with two or three or more inputs and one output. The output of a
two-input XOR gate assumes a HIGH state if one and only one input assumes a HIGH state. This is
equivalent to saying that the output is HIGH if either input X or input Y is HIGH exclusively, and
LOW when both are 1 or 0 simultaneously.
If X and Y are two inputs, then output F can be represented mathematically as F = X Y, Here
denotes the XOR operation. X Y and is equivalent to X.Y' + X'.Y. Truth table and symbol of the
XOR gate is shown in the figure below.
Logic Design
X
0
0
1
1
10CS33
Y
0
1
0
1
F=(X Y)
0
1
1
0
XNOR Gate
An Exclusive-NOR (XNOR) gate is gate with two or three or more inputs and one output. The output
of a two-input XNOR gate assumes a HIGH state if all the inputs assumes same state. This is
equivalent to saying that the output is HIGH if both input X and input Y is HIGH exclusively or same
as input X and input Y is LOW exclusively, and LOW when both are not same.
If X and Y are two inputs, then output F can be represented mathematically as F = X Y, Here
denotes the XNOR operation. X Y and is equivalent to X.Y + X'.Y'. Truth table and symbol of
the XNOR gate is shown in the figure below.
X
0
0
1
1
Y
0
1
0
1
F=(X Y)'
1
0
0
1
Axioms
Consider a set S = { 0. 1} Consider two binary operations, + and . , and one unary operation, -- , that act
on these elements. [S, ., +, --, 0, 1] is called a switching algebra that satisfies the following axioms S.
B.
Closure
Dept. of CSE, SJBIT
13
Logic Design
10CS33
If X
S and Y
S then X.Y
If X
S and Y
S then X+Y
C.
S
S
Identity
an identity 0 for + such that X + 0 = X
an identity 1 for . such that X . 1 = X
D.
Commutative Laws
X+Y=Y+X
XY=YX
E.
Distributive Laws
X.(Y + Z ) = X.Y + X.Z
X + Y.Z = (X + Y) . (X + Z)
Idempotent Law
X+X=X
XX=X
DeMorgan's Law
(X + Y)' = X' . Y', These can be proved by the use of truth tables.
Proof of (X + Y)' = X' . Y'
0
0
1
1
X
0
0
1
1
Y
0
1
0
1
Y
0
1
0
1
X+Y
0
1
1
1
X'
1
1
0
0
Y'
1
0
1
0
The two truth tables are identical, and so the two expressions are identical.
(X.Y) = X' + Y', These can be proved by the use of truth tables.
Proof of (X.Y) = X' + Y'
Dept. of CSE, SJBIT
14
(X+Y)'
1
0
0
0
X'.Y'
1
0
0
0
Logic Design
X
0
0
1
1
X
0
0
1
1
10CS33
Y
0
1
0
1
Y
0
1
0
1
X.Y
0
0
0
1
X'
1
1
0
0
Y'
1
0
1
0
(X.Y)'
1
1
1
0
X'+Y'
1
1
1
0
HDL Example
module smpl_circuit(A,B,C,x,y);
input A,B,C;
output x,y;
wire
e;
and
g1(e,A,B);
Dept. of CSE, SJBIT
15
Logic Design
not
or
endmodule
10CS33
g2(y,C);
g3(x,e,y);
PRINCIPLE OF DUALITY
One can transform the given expression by interchanging the operation (+) and () as well as
the identity elements 0 and 1 . Then the expression will be referred as dual of each other.
This is known as the principle of duality.
Logic Design
10CS33
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
m- NOTATION
To simplify the writing of a minterm in canonical formula for a function is performed using
the symbol mi. Where i stands for the row number for which the function evaluates to 1.
The m-notation for 3- variable an function Boolean function
f(x,y,z) = x y z + x y z + x y z is written as
f(x,y,z) = m1+ m3 + m4 or
f(x,y,z) = m(1,3,4)
A three variable m- notation truth variable
Decimal
Minterm
m-notation
xyz
designator of row
Logic Design
10CS33
0 0 0
x y z
m0
0 0 1
x y z
m1
0 1 0
x y z
m2
0 1 1
x y z
m3
1 0 0
x y z
m4
1 0 1
x y z
m5
1 1 0
x y z
m6
1 1 1
x y z
m7
Logic Design
10CS33
0 f(0)
1 f(1)
TWO VARIABLE : Two variable needs a map of 22 = 4 cells
x y
f(x,y)
0 0
f(0,0)
0 1
f(0,1)
1 0
f(1,0)
1 1
f(1,1)
THREE VARIABLE : Three variable needs a map of 23 = 8 cells. The arrangement of cells
are as follows
x y z
f(x,y,z)
0 0 0
f(0,0,0)
0 0 1
f(0,0,1)
0 1 0
f(0,1,0)
0 1 1
f(0,1,1)
1 0 0
f(1,0,0)
1 0 1
f(1,0,1)
1 1 0
f(1,1,0)
1 1 1
f(1,1,1)
FOUR VARIABLE : Four variable needs a map of 24 = 16 cells. The arrangement of cells are
as follows
w x y z f(w,x,y,z)
w x y z
f(w,x,y,z)
0 0 0 0 f(0,0,0,0)
1 0 1 0
f(1,0,1,0)
0 0 0 1 f(0,0,0,1)
1 0 1 1
f(1,0,1,1)
0 0 1 0 f(0,0,1,0)
1 1 0 0
f(1,1,0,0)
0 0 1 1 f(0,0,1,1)
1 1 0 1
f(1,1,0,1)
0 1 0 0 f(0,1,0,0)
1 1 1 0
f(1,1,10)
0 1 0 1 f(0,1,0,1)
1 1 1 1
f(1,1,1,1)
0 1 1 0 f(0,1,1,0)
0 1 1 1 f(0,1,1,1)
1 0 0 0 f(1,0,0,0)
Dept. of CSE, SJBIT
19
Logic Design
10CS33
1 0 0 1 f(1,0,0,1)
Four variable K-map.
0000 0001
0011
0010
0100 0101
0111
1010
1100 1101
1111
1110
1000 1001
1011
1010
Ex. Obtain the minterm canonical formula of the three variable problem given below
f(x, y,z) = x y z+ x y z + x y z + x y z
f(x,y,z) = m(0,2,4,5)
00
01
11
11
Ex. Express the minterm canonical formula of the four variable K-map given below
yz
00
wx
01
11
10
Logic Design
10CS33
0
f(w,x,y,z) = w x y z + w x y z + w x y z + w x y z + w x y z + w x y z
f(w,x,y,z) = m(0, 1, 2, 4, 5,
Ex. Obtain the max term canonical formula
(POS) of the three variable problem stated above
f(x,y,z) = ( x + y +z)( x + y +z)(x + y +z)
(x + y +z)
f(x,y,z) = M(1,3,6,7)
Ex Obtain the max term canonical formula
(POS) of the four variable problem stated above
f(w,x,y,z) = (w + x + y + z) (w + x + y + z) (w + x + y + z)
(w + x + y + z) (w + x + y + z) (w + x + y + z)
(w + x + y + z) (w + x + y + z) (w + x + y + z)
f(w,x,y,z) = M(3,6,7,9,11,12,13,14,15)
2.3 PRODUCT AND SUM TERM REPRESENTATION OF K MAP
1.The importance of K-map lies in the fact that it is possible to determine the implicants
and implicates of a function from the pattern of 0s and 1s appearing in the map. The cell
of a K-map has entry of 1s is refereed as 1-cell and that of 0,s is referred as 0-cell.
2. The construction of an n-variable map is such that any set of 1-cells or 0-cells which
form a 2ax2b rectangular grouping describing a product or sum term with n-a-b variables , where a
and b are non-negative no.s
3. The rectangular grouping of these dimensions referred as Subcubes. The subcubes must
be the power of 2 i.e. 2 a+b equals to 1,2,4,8 etc.
4. For three variable and four variable K-map it must be remembered that the edges are also
adjacent cells or subcubes hence they will be grouped together.
1
Dept. of CSE, SJBIT
21
Logic Design
10CS33
1
1
Logic Design
10CS33
subcubes.
1 1 1 1
1 1 1 1
FOR
COMPLETE
01
11
10
f(x,y,z)= xy+ yz
Logic Design
10CS33
Logic Design
10CS33
minterm
1-0 notation
index
wxyz
0000
wxyz
0010
wxyz
0011
wxyz
0100
wxyz
1000
10
wxyz
1010
12
wxyz
1100
13
wxyz
1101
14
wxyz
1110
wxyz
index
Logic Design
10CS33
0000
0010
0100
1000
0011
10
1010
12
1100
13
1101
14
1110
Index 0
Index 1
Index 2
Index 3
Wxyz
index
0.2
000
0,4
000
0,8
- 000
001
2,3
2,10
4,12
8,10
8,12
10,14
12,13
- 010
- 100
100
100
110
110
11-0
12,14
wxyz
(0, 2, 8, 10)
__ 0 __ 0
(0, 4, 8,12 )
__ __ 0 0(index 0)
(8,10,12,14)
1__ __ 0 (index 1)
F(w,x,y,z)=x z + y z +w z+w x y +w x z
Dept. of CSE, SJBIT
26
Logic Design
10CS33
Logic Design
10CS33
Logic Design
10CS33
3.3 Decoder
A Decoder is a multiple input, multiple output logic circuit. The block diagram of a decoder is as
shown below.
The most commonly used decoder is a n to 2n decoder which ha n inputs and 2n Output lines .
3-to-8 decoder logic diagram
Logic Design
10CS33
In this realization shown above the three inputs are assigned x0,x1,and x2, and the eight outputs are Z0
to Z7.
Function specifc decoders also exist which have less than 2n outputs . examples are 8421 code
decoder also called BCD to decimal decoder. Decoders that drive seven segment displays also exist.
Logic Design
10CS33
DEVICE
AND array
PROM
Fixed
PLA
Programmable
PAL
Programmable
ee
OR array
Programmable
e
Fixed
e
Programmable
Logic Design
10CS33
Example: Let I0I1I3I4 = 00010 (address 2). Then, output 2 of the decoder will be 1, the remaining
outputs will be 0, and ROM output becomes A7A6A5A4A3A2A1A0 = 11000101.
3.5Programmable Logic Arrays (PLAs)
Similar concept as in PROM, except that a PLA does not necessarily generate all possible minterms
(ie. the decoder is not used).More precisely, in PLAs both the AND and OR arrays can be
programmed (in PROM, the AND array is fixed the decoder and only the OR array can be
programmed).
PLA Example
f(a,b,c) = ab + abc
g(a,b,c) = abc + ab + bc
h(a,b,c) = c
PLAs can be more compact implementations than ROMs, since they can benefit from minimizing the
number of products required to implement a function.
Logic Design
W = ABC + CD
X = ABC + ACD + ACD + BCD
Y = ACD + ACD + ABD
10CS33
Logic Design
10CS33
Logic Design
//Dataflow description of 2-to-1-line mux
module mux2x1_df (A,B,select,OUT);
input A,B,select;
output OUT;
assign OUT = select ? A : B;
endmodule
//Behavioral description of 2-to-1-line multiplexer
module mux2x1_bh(A,B,select,OUT);
input A,B,select;
output OUT;
reg OUT;
always @(select or A or B)
if (select == 1) OUT = A;
else OUT = B;
endmodule
//Behavioral description of 4-to-1 line mux
module mux4x1_bh (i0,i1,i2,i3,select,y);
input i0,i1,i2,i3;
input [1:0] select;
output y;
reg y;
always @(i0 or i1 or i2 or i3 or select)
case (select)
2'b00: y = i0;
2'b01: y = i1;
2'b10: y = i2;
2'b11: y = i3;
endcase
endmodule
10CS33
Logic Design
10CS33
Logic Design
10CS33
Adders
Adders are the basic building blocks of all arithmetic circuits; adders add two binary numbers and
give out sum and carry as output. Basically we have two types of adders.
Half Adder.
Full Adder
Half Adder
Adding two single-bit binary values X, Y produces a sum S bit and a carry out C-out bit. This
operation is called half addition and the circuit to realize it is called a half adder.
X
0
0
1
1
S (X,Y) =
Y
0
1
0
1
(1,2)
S = X'Y + XY'
S=X Y
CARRY(X,Y) =
(3)
CARRY = XY
SUM
0
1
1
0
CARRY
0
0
0
1
Logic Design
10CS33
Full Adder
Full adder takes a three-bits input. Adding two single-bit binary values X, Y with a carry input bit Cin produces a sum bit S and a carry out C-out bit.
X
0
0
0
0
1
1
1
1
Y
0
0
1
1
0
0
1
1
SUM (X,Y,Z) =
Z
0
1
0
1
0
1
0
1
(1,2,4,7)
CARRY (X,Y,Z) =
(3,5,6,7)
Kmap-SUM
SUM
0
1
1
0
1
0
0
1
CARRY
0
0
0
1
0
1
1
1
Logic Design
10CS33
Kmap-CARRY
CARRY = XY + XZ + YZ
Circuit-SUM
Circuit-CARRY
3.4 Multipliers
Multiplication is achieved by adding a list of shifted multiplicands according to the digits of the
multiplier. An n-bit X n-bit multiplier can be realized in combinational circuitry by using an array of
n-1 n-bit adders where each adder is shifted by one position. For each adder one input is the shifted
Logic Design
10CS33
multiplicand multiplied by 0 or 1 (using AND gates) depending on the multiplier bit, the other input is
n partial product bits.
Dividers
The binary divisions are performed in a very similar manner to the decimal divisions, as shown in the
below figure examples. Thus, the second number is repeatedly subtracted from the figures of the first
number after being multiplied either with '1' or with '0'. The multiplication bit ('1' or '0') is selected for
each subtraction step in such a manner that the subtraction result is not negative. The division result is
composed from all the successive multiplication bits while the remainder is the result of the last
subtraction step.
This algorithm can be implemented by a series of subtracters composed of modified elementary cells.
Each subtracter calculates the difference between two input numbers, but if the result is negative the
operation is canceled and replaced with a subtraction by zero. Thus, each divider cell has the normal
Dept. of CSE, SJBIT
40
Logic Design
10CS33
inputs of a subtracter unit as in the figure below but a supplementary input ('div_bit') is also present.
This input is connected to the b_req_out signal generated by the most significant cell of the subtracter.
If this signal is '1', the initial subtraction result is negative and it has to be replaced with a subtraction
by zero. Inside each divider cell the div_bit signal controls an equivalent 2:1 multiplexer that selects
between bit 'x' and the bit included in the subtraction result X-Y. The complete division can therefore
by implemented by a matrix of divider cells connected on rows and columns as shown in figure
below. Each row performs one multiplication-and-subtraction cycle where the multiplication bit is
supplied by the NOT logic gate at the end of each row. Therefor the NOT logic gates generate the bits
of the division result.
Since each carry generate function Gi and carry propogate function Pi is itself only a function of the
operand variables, the output carry and the input carry at each stage can be expressed as a function of
the operand variablesand the initial carry Co. parallel adders whose realizations are based on the
above equations are called carry look ahead adders.
Logic Design
10CS33
4.1 Definition :
1. Combinational Logic Circuit :
The circuit in which outputs depends on only present value of inputs. So it is possible to
describe each output as function of inputs by using Boolean expression. No memory element
involved. No clock input. Circuit is implemented by using logic gates. The propagation delay
depends on, delay of logic gates. Examples of combinational logic circuits are : full adder,
subtractor, decoder, codeconverter, multiplexers etc.
inputs
Combinational
Logic Circuit
outputs
2. Sequential Circuits :
Sequential Circuit is the logic circuit in which output depends on present value of inputs at
that instant and past history of circuit i.e. previous output. The past output is stored by using
memory device. The internal data stored in circuit is called as state. The clock is required for
synchronization. The delay depends on propagation delay of circuit and clock frequency. The
examples are flip-flops, registers, counters etc.
inputs
Combinational
Logic Circuit
Memory Device
outputs
Logic Design
Latches :
S-R Latch : Set-reset Flip-Flop
The function table / Truth table gives relation between inputs and outputs.
Application of SR Latch :
A switch debouncer
Debouncing action.
10CS33
Logic Design
10CS33
Logic Design
Due to feedback from output to input AND Gate J=K=1 is toggle condition for JK FF.
Gated D Latch :
D Flip-Flop stores 1 or 0.
R input is complement of S.
10CS33
Logic Design
10CS33
Logic Design
10CS33
Logic Design
S = 0, R = 1, Q = 1 and Q = 0
S = R = 1, No Change of State
10CS33
Logic Design
4.6 HDL implementation of Flip-flops
module D_latch(Q,D,control);
output Q;
input D,control;
reg Q;
always @(control or D)
if(control) Q = D; //Same as: if(control=1)
endmodule
//D flip-flop
module D_FF (Q,D,CLK);
output Q;
input D,CLK;
reg Q;
always @(posedge CLK)
Q = D;
endmodule
10CS33
Logic Design
10CS33
Unit-5 : Registers
An n-bit register is a collection of n D flip-flops with a common clock used to store n related
bits.
5.1 Types of Register:
Serial-in Serial-Out
Parallel-in Serial-Out
Logic Design
10CS33
Logic Design
Bidirectional Shifting.
10CS33
Logic Design
10CS33
Unit-6 : Counters
6.1 Counters
000
111
001
110
010
101
011
100
Logic Design
Count enable = 1.
10CS33
Logic Design
10CS33
Logic Design
10CS33
The counter follows seven different states with application of clock input.
Q D .Q C
The excitation table is written considering the present state and next state of counter.
By using flip-flops and logic gate the implementation of synchronous counter is obtained.
Synchronous Counter
1. Clock input is applied to LSB FF. The output of 1. Clock input is common to all FF.
first FF is connected as clock to next FF.
2. All Flip-Flops are toggle FF.
5. Cost is less.
5. Cost is more.
Logic Design
else if (Count) A = A + 1'b1;
else A = A;
// no change, default condition
endmodule
10CS33
Logic Design
10CS33
Combinational
Logic Circuit
inputs
Outputs
PS
Memory
NS
1
0
t
+ ve edge
Dept. of CSE, SJBIT
58
- ve edge
Logic Design
10CS33
This clock is used for network synchronization
Q+
Logic Design
10CS33
Difference between Mealy Model and Moore Model of Synchronous Sequential Circuit
Mealy Model : In Mealy Model the next state is function of external inputs and present state. The
output is also function of external inputs and present state. The memory state changes with master
clock.
Q+ = f(X,Q)
Z = g(X,Q)
Moore Model : In Moore Model the next state is function of external inputs and present state. But the
output is function of present state. It is not dependent on external inputs. The no. of FFs required to
implement circuit is more compared with Mealy Model,
Q+ = f(X,Q)
D 1 = x Q 2 + Q 1Q 2
D 2 = x Q 1 + Q 1Q 2
Z = xQ 1 + Q 1 Q 2 x
Z = g(Q)
Logic Design
10CS33
Z1 = Q2Q1
and
Z 2 = Q1 + Q2
J1 = y
and
K1 = Q2 x + y
Q+ = D
For JK FF
Q + = J Q + KQ
For T FF Q+ = T Q
By substituting the excitation expressions for a FF into characteristic equation, an algebraic
description of next state of FF is obtained.
The expression for next state in terms of FF inputs are referred as transition equations.
Q1+ = D1
and
Q2+ = D2
Logic Design
10CS33
Q1 = xQ2 +Q1Q2
+
Q2 = xQ1 +Q1Q2
For Moore network
+
Q1 = J1 Q1 + K1Q1
+
Q2 = J 2 Q2 + K 2Q1
By substituting the values of J & K inputs we get next state in terms of FF present state and external
input.
Transition Tables :
Instead of using algebraic equations for next state and outputs of sequential network, it is
more convenient and useful to express the information in tabular form.
The Transition Table or State Transition Table or State Table is the tabular representation of the
transition and output equations. This table consist of Present State, Next State, external inputs and
output variables. If there are n state variables then 2n rows are present in state table.
State machine notations :
Output Variables : All variables that exit from the sequential machine are output variables.
State : State of sequential machine is defined by the content of memory, when memory is
realized by using FFs.
Present State : The status of all state variable i.e. content of FF for given instant of time t is
called as present state.
Output Variables : All variables that exit from the sequential machine are output variables.
Logic Design
10CS33
Application Table of JK FF
Q0
PS
NS
FF input
Q+
Q1
x0
PS
NS
00
Q+
10
11/10
11/01
B
10
01
0
00
1
01
State diagram of SR FF
FF i/p
PS
NS
FF i/p
Q+
D i/p
Logic Design
10CS33
1 D FF
Application1Table of
0
0
1
0
State diagram of D FF
Application Table of FF
0
0
1
1
State diagram of T FF
Q1 = D1
Q2 = D 2
Q1 = xQ2 + Q1Q2 ,
Q2 = xQ1 + Q1Q2 ,
Z = xQ1 + Q1 Q2 x
Dept. of CSE, SJBIT
64
PS
NS
FF i/p
Q+
T i/p
Logic Design
10CS33
PS (Q1Q2)
Output
(Z1Z2)
Inputs (xy)
00
01
10
11
00
00
10
01
11
01
01
01
11
00
11
00
10
10
01
00
00
11
11
11
00
10
00
01
Z1 = Q2Q1 , Z 2 = Q1 + Q2 , J1 = y
K1 = Q2 x + y, J 2 = Q1 x + xyQ1 , K 2 = x y + yQ1 ,
T1 = xQ 2 + Q1Q2 , Q1 = T1 Q1
+
T2 = x + Q1Q2 ,
Q2 = T2 Q 2
Z1 = xQ1 ,
Z 2 = xQ2
State Tables :
Logic Design
10CS33
State table consist of PS, NS and output section. The PS and NS of state tables are obtained by
replacing the binary code for each in the transition table by newly defined symbol. The output section
is identical to output section of transition table.
Symbols for state can be S1, S2, S3,Sn or A, B, C, D, E.
State table for Mealy Machine
PS
NS
x=0
O/p Z
x=1
x=0
x=1
00 A
01 B
10 C
11 D
State Diagram :
It is graphical representation of state tables. Each state of network is represented by labeled node.
Directed branches connect the nodes to indicate transition between states. The directed branches are
labeled according to the values of external input variable that permit transition. The output of
sequential network is also entered in state diagram. In case of Moore Network state diagram, the
values of input for output is not written.
Logic Design
10CS33
Logic Design
10CS33
A 00
B 01
C 10
Z = x y2 + y1 y2 + x y1
J 2 = x, K 2 = x , J 1 = y 2 , K1 = y 2
Dept. of CSE, SJBIT
68
Logic Design
10CS33
By substituting the FF inputs in characteristic equation, the next state of FF is obtained in terms of PS
of FF and external input.
Q + = J Q + KQ
Q1+ = J1 Q1 + K1Q1 = Q2
Q2+ = J 2 Q2 + K 2Q2 = x
The Excitation Table
PS
Excitation input
Q2 Q1
J2 K2
(y2 y1)
Output Z
J1 K1
x=0, 1
x=0, 1
0 0
0 1
0 1
0 1
0 1
0 1
0 1
0 1
1 1
x=0, x=1
J1 = y2 = Q2 , K1 = y2 = Q2
J 2 = x, K 2 = x, Z = x y2 + y2 y1 + x y1
State Table
PS
NS
O/p Z
x=0
Q2
Q1
(y2)
(y1)
x=1
state
Q2+
Q1+
state
Q2+
Q1+
state
X=0
X=1
Q1+ = Q2 = y2
Q2+ = x
Dept. of CSE, SJBIT
69
if x = 0, z = y2 + y1
if x = 1, z = y1
Logic Design
10CS33
0/1
A
A, B, C, D are
0/0
1/1
1/0
Present states.
0/1
1/0
1/1
0/1
C
Logic Design
10CS33
NS
O/p Z
x=0
x=1
Q1
Q2
State
Q1+
Q2+
State
Q1+
Q2+
state
Q1+ = D1
Z = Q1 + Q2
Q2+ = D2
if x = 0, D1 = Q2 & D2 = Q2 Q1
if x = 1, D1 = 0 & D2 = Q1 Q2
Logic Design
10CS33
0
A
1
1
0
A, B, C, D are Present
states.
0
B
1
0
C
y = x A B, J A = B , K A = B
JB = KB = x A
State Table
PS
NS
O/p y
x=0
x=1
QA
QB
state
QA+
QB+
state
QA+
QB+
state
x=0
x=1
S0
S1
S0
S1
S2
S3
S2
S1
S2
S3
S2
S1
Logic Design
10CS33
Q A = QB , QB = [( x QA ) QB ]
State Diagram of Mealy+ Network
if x = 0, QB = [QA QB ]
+
if x = 1, QB = [QA1/1
QB ]
S0
0/0
S0, S1, S2, S3 are Present
1/0
S3
S1
1/0
0/1
0/1
0/0
S2
1/1
states.
Logic Design
10CS33
Technology for fabricating digital systems has become so advanced that they can be
produced at low cost.
The major limitation of a digital system is how accurately it represents the analog signals after
conversion.
A typical system that converts signals from analog to digital and back to analog includes:
A D/A converter that converts digital signals into equivalent analog signals
A transducer that converts electrical signals into real life non-electrical signals
(sound, pressure, and video)
Logic Design
10CS33
A/D Converter
In order to change an analog signal to digital, the input analog signal is sampled at a high rate
of speed.
The amplitude at each of those sampled moments is converted into a number equivalent this
is called quantization.
These numbers are simply the combinations of the 0s and 1s used in computer language this
called encoding.
Logic Design
10CS33
Analog-to-Digital
A simple hypothetical A/D converter circuit with one analog input signal and three digital
output lines with eight possible binary combinations: 000 to 111
Maximum value this quantization process reaches is 7/8 V for a 1 V analog signal;
includes 1/8 V an inherent error
1/8 V (an inherent error) is also equal to the value of the Least Significant Bit (LSB)
= 001.
The value of the most significant bit (MSB) -100- is equal to the voltage of the
full-scale value of 1 V.
The value of the largest digital number 111 is equal to full-scale value minus the
value of the LSB.
Opamps
Dept. of CSE, SJBIT
76
Logic Design
10CS33
Ideal opamps
Infinite BW
Practical opamps
wide BW
Non-inverting
Av=1+Rf/Ri
Inverting
Av=-Rf/Ri
Dept. of CSE, SJBIT
77
Logic Design
Comparators
A small difference between inputs results maximum output voltage (high gain)
Zero-level detection
Non-zero-level detection
10CS33
Logic Design
10CS33
Integrator:
Charges a capacitor for a given amount of time using the analog signal.
It discharges back to zero with a known voltage and the counter provides the
value of the unknown signal.
The known signal is connected to one side of the comparator and the analog
signal to be converted to the other side of the comparator.
A/D Conversion
Successive approximation: Includes a D/A (digital to analog) converter and a comparator. An
internal analog signal is generated by turning on successive bits in the D/A converter.
Counter: Similar to a successive approximation converter except that the internal analog signal is
generated by a counter starting at zero and feeding it to the D/A converter.
Logic Design
10CS33
If the input voltage to an A/D converter is variable, the digital output is likely to be unreliable
and unstable. Therefore, the varying voltage source is connected to the ADC through a
sample and hold circuit.
Basic Operation:
When the switch is open, it holds the sampled voltage by charging the capacitor.
Acquisition time: time to charge the capacitor after the switch is open and settle the
output.
Conversion time: total time needed from the start of a conversion (turning on the
MSB in the SAR) until the end of the conversion (turning on/off Bit0 in the SAR) TAD: conversion time per bit.