LOGIC DESIGN Lecture Note
LOGIC DESIGN Lecture Note
A Digital system is an interconnection of digital modules and it is a system that manipulates discrete
elements of information that is represented internally in the binary form.
Now a day’s digital systems are used in wide variety of industrial and consumer products such as
automated industrial machinery, pocket calculators, microprocessors, digital computers, digital watches,
TV games and signal processing and so on.
Characteristics of Digital systems
Digital systems manipulate discrete elements of information.
Discrete elements are nothing but the digits such as 10 decimal digits or 26 letters of
alphabets and so on.
Digital systems use physical quantities called signals to represent discrete elements.
In digital systems, the signals have two discrete values and are therefore said to be binary.
A signal in digital system represents one binary digit called a bit. The bit has a value either 0 or
1.
Analog systems vs Digital systems
Analog system process information that varies continuously i.e; they process time varying
signals that can take on any values across a continuous range of voltage, current or any physical
parameter.
Digital systems use digital circuits that can process digital signals which can take either 0 or 1
for binary system.
Advantages of Digital system over Analog system
Ease of programmability
The digital systems can be used for different applications by simply changing the program without
additional changes in hardware.
Reduction in cost of hardware
The cost of hardware gets reduced by use of digital components and this has been possible due to
advances in IC technology. With ICs the number of components that can be placed in a given area of
Silicon are increased which helps in cost reduction.
High speed
Digital processing of data ensures high speed of operation which is possible due to advances in Digital
Signal Processing.
High Reliability
Digital systems are highly reliable one of the reasons for that is use of error correction codes.
Design is easy
The design of digital systems which require use of Boolean algebra and other digital techniques is easier
compared to analog designing.
Result can be reproduced easily
Since the output of digital systems unlike analog systems is independent of temperature, noise, humidity
and other characteristics of components the reproducibility of results is higher in digital systems than in
analog systems.
Disadvantages of Digital Systems
Use more energy than analog circuits to accomplish the same tasks, thus producing more heat
as well.
Digital circuits are often fragile, in that if a single piece of digital data is lost or misinterpreted the
meaning of large blocks of related data can completely change.
Digital computer manipulates discrete elements of information by means of a binary code.
Quantization error during analog signal sampling.
NUMBER SYSTEM
Number system is a basis for counting varies items. Modern computers communicate and operate with
binary numbers which use only the digits 0 &1. Basic number system used by humans is Decimal
number system.
For Ex: Let us consider decimal number 18. This number is represented in binary as 10010.
We observe that binary number system take more digits to represent the decimal number. For large
numbers we have to deal with very large binary strings. So this fact gave rise to three new number
systems.
i. Octal number systems
ii. Hexa Decimal number system
iii. Binary Coded Decimal number(BCD) system. To define any
number system we have to specify
Base of the number system such as 2,8,10 or 16.
The base decides the total number of digits available in that number system.
First digit in the number system is always zero and last digit in the number system is always
base-1.
Binary number system:
The binary number has a radix of 2. As r = 2, only two digits are needed, and these are 0 and 1. In binary
system weight is expressed as power of 2.
The left most bit, which has the greatest weight is called the Most Significant Bit (MSB). And the right
most bit which has the least weight is called Least Significant Bit (LSB).
For Ex: 1001.012 = [ ( 1 ) × 23 ] + [ ( 0 ) × 22 ] + [ ( 0 ) × 21 ] + [ ( 1 ) × 20 ] + [ ( 0 ) × 2-1 ] + [ ( 1
) × 22 ]
1001.012 = [ 1 × 8 ] + [ 0 × 4 ] + [ 0 × 2 ] + [ 1 × 1 ] + [ 0 × 0.5 ] + [ 1 × 0.25 ]
1001.012 = 9.2510
Decimal Number system
The decimal system has ten symbols: 0,1,2,3,4,5,6,7,8,9. In other words, it has a base of 10.
Octal Number System
Digital systems operate only on binary numbers. Since binary numbers are often very long, two
shorthand notations, octal and hexadecimal, are used for representing large binary numbers. Octal
systems use a base or radix of 8. It uses first eight digits of decimal number system. Thus it has digits
from 0 to 7.
Hexa Decimal Number System
The hexadecimal numbering system has a base of 16. There are 16 symbols. The decimal digits 0 to 9
are used as the first ten digits as in the decimal system, followed by the letters A, B, C, D, E and F, which
represent the values 10, 11,12,13,14 and 15 respectively.
v) Decimal to Octal
Conversion Ex: convert
378.9310 to octal
37810 to octal: Successive division:
8 | 378
|
8 |47 --- 2
|
8 |5 --- 7 ↑
|
0 --- 5
=5728
0.9310 to octal :
0.93x8=7.44
0.44x8=3.52 ↓
0.53x8=4.16
0.16x8=1.28
=0.73418
Complements:
In digital computers to simplify the subtraction operation & for logical manipulation complements are
used. There are two types of complements used in each radix system.
i) The radix complement or r’s complement
ii) The diminished radix complement or (r-1)’s complement
Binary codes
Binary codes are codes which are represented in binary system with modification from the original
ones.
Weighted Binary codes
Reflective Code
A code is said to be reflective when code for 9 is complement for the code for 0, and so is for 8 and 1
codes, 7 and 2, 6 and 3, 5 and 4. Codes 2421, 5211, and excess-3 are reflective, whereas the 8421 code is
not.
Sequential Codes
A code is said to be sequential when two subsequent codes, seen as numbers in binary representation,
differ by one. This greatly aids mathematical manipulation of data. The 8421 and Excess-3 codes are
sequential, whereas the 2421 and 5211 codes are not.
Non weighted codes
Non weighted codes are codes that are not positionally weighted. That is, each position within
the binary number is not assigned a fixed value. Ex: Excess-3 code
Excess-3 Code
Excess-3 is a non weighted code used to express decimal numbers. The code derives its name
from the fact that each binary code is the corresponding 8421 code plus 0011(3).
Gray Code
The gray code belongs to a class of codes called minimum change codes, in which only one bit
in the code changes when moving from one code to the next. The Gray code is non-weighted
code, as the position of bit does not contain any weight. The gray code is a reflective digital
code which has the special property that any two subsequent numbers codes differ by only one
bit. This is also called a unit- distance code. In digital Gray code has got a special place.
BCD Addition:
It is individually adding the corresponding digits of the decimal no,s expressed in 4 bit binary
groups starting from the LSD . If there is no carry & the sum term is not an illegal code , no
correction is needed .If there is a carry out of one group to the next group or if the sum term is an
illegal code then 610(0100) is added to the sum term of that group & the resulting carry is added
to the next group.
Ex: Perform decimal additions in 8421 code
(a)25+13
In BCD 25= 0010 0101
In BCD +13 0011
=+0001
38 0011 1000
No carry , no illegal code .This is the corrected sum
BCD Subtraction:
Performed by subtracting the digits of each 4 bit group of the subtrahend the digits from the
corresponding 4- bit group of the minuend in binary starting from the LSD . if there is no borrow
from the next group , then 610(0110)is subtracted from the difference term of this group.
(a)38-15
In BCD 38= 0011 1000
In BCD -15 = -0001 0101
23 0010 0011
No borrow, so correct difference.
.(b) 206.7-147.8
206.7 = 0010 0000 0110 . 0111 in BCD
-147.8 -0001 0100 0111 . 0110 in BCD
=
_ _ _______________ _
58.9 0000 1011 1110 . 1111
borrows are present
-0110 -0110 . -0110 subtract 0110
Parity: The simplest techniques for detecting errors is that of adding an extra bit known as parity
bit to each word being transmitted.Two types of parity: Oddparity, evenparity forodd parity, the
parity bit is set to a ‗0‘ or a ‗1‘ at the transmitter such that the total no. of 1 bit in the word
including the parity bit is an odd no.For even parity, the parity bit is set to a ‗0‘ or a ‗1‘ at the
transmitter such that the parity bit is an even no.
Word format is
P1 P2 D3 P4 D5 D6 D7 P8 D9 D10 D11 D12
Alphanumeric Codes:
These codes are used to encode the characteristics of alphabet in addition to the decimal digits. It
is used for transmitting data between computers & its I/O device such as printers, keyboards &
video display terminals.Popular modern alphanumeric codes are ASCII code & EBCDIC code.
Digital Logic Gates
Boolean functions are expressed in terms of AND, OR, and NOT operations, it is easier to
implement a Boolean function with these type of gates.
Boolean algebra is a system of mathematical logic. It is an algebraic system consisting of the set
of elements (0, 1), two binary operators called OR, AND, and one unary operator NOT. It is the
basic mathematical tool in the analysis and synthesis of switching circuits. It is a way to express
logic functions algebraically.
Boolean algebra, like any other deductive mathematical system, may be defined with aset of
elements, a set of operators, and a number of unproved axioms or postulates. A set of elements is
anycollection of objects having a common property. If S is a set and x and y are certain objects,
then x Î Sdenotes that x is a member of the set S, and y ÏS denotes that y is not an element of S.
A set with adenumerable number of elements is specified by braces: A = {1,2,3,4}, i.e. the
elements of set A are thenumbers 1, 2, 3, and 4. A binary operator defined on a set S of elements
is a rule that assigns to each pair ofelements from S a unique element from S._ Example: In
a*b=c, we say that * is a binary operator if it specifies a rule for finding c from the pair (a,b)and
also if a, b, c Î S.
• x + x’ = x
• x · x’ = 0
• x+y=y+x
• xy = yx
• x+(y+z)=(x+y)+z
• x (yz) = (xy) z
• x ( y + z ) = xy + xz
• x + yz = ( x + y )( x + z)
• ( x + y )’ = x’ y’
• ( xy )’ = x’ + y’
• (x’)’ = x
DeMorgan's Theorem
Associative law
Distributive law
x y z F1
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1 Gate Implementation of F1 = x + y’z
1 0 1 1
1 1 0 1
1 1 1 1
Note:
Q: Let a function F() depend on n variables. How many rows are there in the truth table of F() ? A:
2n rows, since there are 2n possible binary patterns/combinations for the n variables.
Truth Tables
x y z F1 F2 F3
0 0 0 0 1 1
0 0 1 0 0 1
0 1 0 0 0 1
0 1 1 0 1 1
1 0 0 0 1 0
1 0 1 0 1 0
1 1 0 0 0 0
1 1 1 1 0 1
Complement of a Function
The complement of a function is derived by interchanging (• and +), and (1 and
O), and complementing each variable.
Otherwise, interchange 1s to 0s in the truth table column showing F.
The complement of a function IS NOT THE SAME as the dual of a
function. Example
• Find G(x,y,z), the complement of F(x,y,z) = xy’z’
+x’yz Ans: G = F’ = (xy’z’ + x’yz)’
= (xy’z’)’ • (x’yz)’ DeMorgan
= (x’+y+z) • (x+y’+z’) DeMorgan again
Note: The complement of a function can also be derived by finding the function’s dual, and then
complementing all of the literals
MINIMIZATION TECHNIQUES
Two-variable k-map:
A two-variable k-map can have 22=4 possible combinations of the input variables A and B
Each of these combinations, B, A, AB(in the SOP form) is called a minterm. The minterm
may be represented in terms of their decimal designations – m0 for m1 for B,m2 for A and m3 for
AB, assuming that A represents the MSB. The letter m stands for minterm and the subscript
represents the decimal designation of the minterm. The presence or absence of a minterm in the
expression indicates that the output of the logic circuit assumes logic 1 or logic 0 level for that
combination of input variables.
min term as
F= m0+m2+m3=∑m(0,2,3)
A two-variable k-map has 22=4 squares .These squares are called cells. Each square on the k-
map represents a unique minterm. The minterm designation of the squares are placed in any
square, indicates that the corresponding minterm does output expressions. And a 0 or no entry in
any square indicates that the corresponding minterm does not appear in the expression for
output.
Quine-Mccluskey Method:
It also known as Tabular method. It is more systematic method of minimizing expressions of even
larger number of variables. It is suitable for hand computation as well as computation by
machines i.e., programmable. . The procedure is based on repeated application of the combining
theorem.
PA+P =P (P is set of literals) on all adjacent pairs of terms, yields the set of all PI‘s from which
a minimal sum may be selected.
Consider expression
∑m(0,1,4,5)= + C+A +A C
First, second terms & third, fourth terms can be combined
( + )+ (C+ )= +A
Reduced to ( + )=
The same result can be obtained by combining m0& m4 & m1&m5 in first step & resulting terms
in the second step .
Procedure:
Decimal Representation
Don‘t cares
PI chart
EPI
Dominating Rows & Columns
Determination of Minimal expressions in complex cases.
Combinational Logic
For n input variables,there are 2 n possible combinations of binary input variables .For each
possible input Combination ,there is one and only one possible output combination.A
combinational circuit can be described by m Boolean functions one for each output
variables.Usually the input s comes from flip-flops and outputs goto flip-flops.
Design Procedure:
1. The problem is stated
2. The number of available input variables and required output
variables is determined.
3.The input and output variables are assigned lettersymbols.
4. The truth table that defines the required relationship between inputs and outputs is derived.
5. The simplified Boolean function for each output is obtained.
SEQUENTIAL CIRCUITS
The Basic Latch
Basic latch is a feedback connection of two NOR gates or two NAND gates
It can store one bit of information
It can be set to 1 using the S input and reset to 0 using the R input
The Gated Latch
Gated latch is a basic latch that includes input gating and a control signal
The latch retains its existing state when the control input is equal to 0
Its state may be changed when the control signal is equal to 1. In our discussion
we referred to the control input as the clock
The master stage is active during half of the clock cycle, and the slave
stage is active during the other half.
The output value of the flip-flop changes on the edge of the clock that
activates the transfer into the slave stage.
Master-Slave D Flip-Flop
A Positive-Edge-Triggered D Flip-Flop
Master-Slave D Flip-Flop with Clear and Preset
T Flip-Flop
Excitation Tables
Conversions of flip-flops
Sequential Circuit
Design
• An n-bit register is a cascade of n flip-flops and can store an n-bit binary data
• A counter can count occurrences of events and can generate timing intervals for control
purposes
A Simple Shift Register
Parallel-Access Shift Register