Sei sulla pagina 1di 89

SWITCHING THEORY AND LOGIC

DESIGN

GNIT ECE 1
 UNIT – I Number System and Boolean
algebra And Switching Functions: Review of
number systems, Complements of Numbers,
Codes- Binary Codes, Binary Coded Decimal
Code and its Properties, Unit Distance Codes,
Error Detecting and Correcting Codes.
Boolean Algebra: Basic Theorems and
Properties, Switching Functions, Canonical
and Standard Form, Algebraic Simplification
of Digital Logic Gates, Properties of XOR
Gates, Universal Gates, Multilevel NAND/NOR
realizations.
GNIT ECE 2
 1.1 Review of number systems
 1.2 Complements of Numbers
 1.3 Codes- Binary Codes
 1.4 Binary Coded Decimal Code and its Properties
 1.5 Unit Distance Codes
 1.6 Error Detecting and Correcting Codes
 1.7 Boolean Algebra: Basic Theorems and Properties
 1.8 Switching Functions
 1.9 Canonical and Standard Form
 1.10 Algebraic Simplification of Digital Logic Gates
 1.11 Properties of XOR Gates
 1.12 Universal Gates
 1.13 Multilevel NAND/NOR realizations

GNIT ECE 3
 Base (also called radix) = 10
 10 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
 Digit Position
 Integer & fraction
 Digit Weight d2*B2+d1*B1+d0*B0+d-1*B-1+d-2*B-2
 Weight = (Base) Position
 Magnitude
 Sum of “Digit x Weight”
 Formal Notation

GNIT ECE 4
 Base =2
 2 digits { 0, 1 }, called binary digits or “bits”
 Weights
4 2 1 1/2 1/4
Position
 Weight = (Base) 1 0 1 0 1
 Magnitude 2 1 0 -1 -2

 Sum of “Bit x Weight” 1


2 *2 2
+0 *2 1
+1 *2 0
+0 *2 -1
+1 *2 -

 Formal Notation
=(5.25)10
 Groups of bits 4 bits = Nibble
(101.01)2
8 bits = Byte
1011

11000101
GNIT ECE 5
Evaluate
Magnitude
Octal
(Base 8)

Evaluate
Magnitude
Decimal Binary
(Base 10) (Base 2)

Hexadecimal
(Base 16)
Evaluate
Magnitude
GNIT ECE 6
 Divide the number by the ‘Base’ (=2)
 Take the remainder (either 0 or 1) as a coefficient
 Take the quotient and repeat the division

Example: (13)10
Quotient Remainder Coefficient
13/ 2 = 6 1 a0 = 1
6 /2= 3 0 a1 = 0
3 /2= 1 1 a2 = 1
1 /2= 0 1 a3 = 1
Answer: (13)10 = (a3 a2 a1 a0)2 = (1101)2

MSB LSB
GNIT ECE 7
 Multiplythe number by the ‘Base’ (=2)
 Take the integer (either 0 or 1) as a coefficient
 Take the resultant fraction and repeat the division

Example: (0.625)10
Integer Fraction Coefficient
0.625 * 2 = 1 . 25 a-1 = 1
0.25 * 2 = 0 . 5 a-2 = 0
0.5 *2= 1 . 0 a-3 = 1
Answer: (0.625)10 = (0.a-1 a-2 a-3)2 = (0.101)2

MSB LSB

GNIT ECE 8
Example: (175)10
Quotient Remainder Coefficient
175 / 8 = 21 7 a0 = 7
21 / 8 = 2 5 a1 = 5
2 /8= 0 2 a2 = 2
Answer: (175)10 = (a2 a1 a0)8 = (257)8

Example: (0.3125)10
Integer Fraction Coefficient
0.3125 * 8 = 2 . 5 a-1 = 2
0.5 *8= 4 . 0 a-2 = 4
Answer: (0.3125)10 = (0.a-1 a-2 a-3)8 = (0.24)8

GNIT ECE 9
Octal Binary
8 =23
0 000
 Each group of 3 bits represents
an octal digit 1 001
2 010
Assume Zeros
Example: 3 011

( 1 0 1 1 0 . 0 1 )2 4 100
5 101
6 110
( 2 6 . 2 )8 7 111

Works both ways (Binary to Octal & Octal to Binary)


GNIT ECE 10
 16 = 24 Hex Binary
0 0000
 Each group of 4 bits represents a 1 0001
hexadecimal digit 2
3
0010
0011
4 0100
Assume Zeros 5 0101
Example: 6 0110
7 0111
( 1 0 1 1 0 . 0 1 )2 8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
(1 6 . 4 )16 E 1110
F 1111

Works both ways (Binary to Hex & Hex to Binary)


GNIT ECE 11
 Convert to Binary as an intermediate step
Example:
( 2 6 . 2
)8
Assume Zeros Assume Zeros

( 0 1 0 1 1 0 . 0 1 0 )2

(1 6 . 4 )16

Works both ways (Octal to Hex & Hex to Octal)


GNIT ECE 12
 Base =8
 8 digits { 0, 1, 2, 3, 4, 5, 6, 7 } 64 8 1 1/8 1/64
 Weights
Position
5 1 2 7 4
 Weight = (Base)
2 1 0 -1 -2
 Magnitude
5 *82+1 *81+2 *80+7 *8-1+4 *8-2
 Sum of “Digit x Weight”
=(330.9375)10
 Formal Notation
(512.74)8

GNIT ECE 13
 Base = 16
 16 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F }
256 16 1 1/16 1/256
 Weights
 Weight = (Base) Position 1 E 5 7 A
2 1 0 -1 -2
 Magnitude
1 *162+14 *161+5 *160+7 *16-1+10 *16-2
 Sum of “Digit x Weight”
 Formal Notation =(485.4765625)10

(1E5.7A)16

GNIT ECE 14
n 2n n 2n
0 20=1 8 28=256
1 21=2 9 29=512
Kilo
2 22=4 10 210=1024
3 23=8 11 211=2048
4 24=16 12 212=4096
Mega
5 25=32 20 220=1M
Giga
6 26=64 30 230=1G
Tera
7 27=128 40 240=1T
GNIT ECE 15
 Decimal Addition

1 1 Carry
5 5
+ 5 5

1 1 0
= Ten ≥ Base
 Subtract a Base

GNIT ECE 16
 Column Addition

1 1 1 1 1 1
1 1 1 1 0 1 = 61
+ 1 0 1 1 1 = 23

1 0 1 0 1 0 0 = 84

≥ (2)10

GNIT ECE 17
 Borrow a “Base” when needed
1 2 = (10)2
0 2 2 0 0 2
1 0 0 1 1 0 1 = 77
− 1 0 1 1 1 = 23

0 1 1 0 1 1 0 = 54

GNIT ECE 18
 Bit by bit
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

GNIT ECE 19
Decimal Binary Octal Hex
00 0000 00 0
01 0001 01 1
02 0010 02 2
03 0011 03 3
04 0100 04 4
05 0101 05 5
06 0110 06 6
07 0111 07 7
08 1000 10 8
09 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
GNIT ECE 20
 There are two types of complements for each base-r system: the radix
complement and diminished radix complement.
 Diminished Radix Complement - (r-1)’s Complement
 Given a number N in base r having n digits, the (r–1)’s
complement of N is defined as:
(rn –1) – N
 Example for 6-digit decimal numbers:
 9’s complement is (rn – 1)–N = (106–1)–N = 999999–N
 9’s complement of 546700 is 999999–546700 = 453299
 Example for 7-digit binary numbers:
 1’s complement is (rn – 1) – N = (27–1)–N = 1111111–N
 1’s complement of 1011000 is 1111111–1011000 = 0100111
 Observation:
 Subtraction from (rn – 1) will never require a borrow
 Diminished radix complement can be computed digit-by-digit
 For binary: 1 – 0 = 1 and 1 – 1 = 0

GNIT ECE 21
 1’s Complement (Diminished Radix Complement)
 All ‘0’s become ‘1’s
 All ‘1’s become ‘0’s
Example (10110000)2
 (01001111)2
If you add a number and its 1’s complement …

10110000
+ 01001111
11111111

GNIT ECE 22
 Radix Complement
The r's complement of an n-digit number N in base r is defined as
rn – N for N ≠ 0 and as 0 for N = 0. Comparing with the (r  1) 's
complement, we note that the r's complement is obtained by adding 1 to
the (r  1) 's complement, since rn – N = [(rn  1) – N] + 1.
 Example: Base-10
The 10's complement of 012398 is 987602
The 10's complement of 246700 is 753300

 Example: Base-2
The 2's complement of 1101100 is 0010100
The 2's complement of 0110111 is 1001001

GNIT ECE 23
 2’s Complement (Radix Complement)
 Take 1’s complement then add 1
OR Toggle all bits to the left of the first ‘1’ from the right
Example:
Number:
1’s Comp.: 10110000 10110000
01001111
+ 1
01010000 01010000

GNIT ECE 24
 Subtraction with Complements
 The subtraction of two n-digit unsigned numbers
M – N in base r can be done as follows:

GNIT ECE 25
 Example 1.5
 Using 10's complement, subtract 72532 – 3250.

 Example 1.6
 Using 10's complement, subtract 3250 – 72532.

There is no end carry.

Therefore, the answer is – (10's complement of 30718) =  69282.


GNIT ECE 26
 Example 1.7
 Given the two binary numbers X = 1010100 and Y
= 1000011, perform the subtraction (a) X – Y ;
and (b) Y  X, by using 2's complement.

There is no end carry.


Therefore, the answer is
Y – X =  (2's complement
of 1101111) =  0010001.

GNIT ECE 27
 Subtraction of unsigned numbers can also be done by means of the (r 
1)'s complement. Remember that the (r  1) 's complement is one less
then the r's complement.
 Example 1.8
 Repeat Example 1.7, but this time using 1's complement.

There is no end carry,


Therefore, the answer is Y –
X =  (1's complement of
1101110) =  0010001.
GNIT ECE 28
 Example:
 Consider decimal 185 and its corresponding value
in BCD and binary:

 BCD addition

GNIT ECE 29
 Example:
 Consider the addition of 184 + 576 = 760 in BCD:

 Decimal Arithmetic: (+375) + (-240) = +135


Hint 6: using 10’s of BCD

GNIT ECE 30
 Other Decimal Codes

GNIT ECE 31
 Gray Code
 The advantage is that only
bit in the code group changes
in going from one number to
the next.
 Error detection.
 Representation of analog data.
000 001
 Low power design.

010 011
100 101

110 111

1-1 and onto!! GNIT ECE 32


 American Standard Code for Information Interchange (ASCII)
Character Code

GNIT ECE 33
 ASCII Character Code

GNIT ECE 34
 Error-Detecting Code
 To detect errors in data communication and
processing, an eighth bit is sometimes added to
the ASCII character to indicate its parity.
 A parity bit is an extra bit included with a
message to make the total number of 1's either
even or odd.
 Example:
 Consider the following two characters and their
even and odd parity:

GNIT ECE 35
 BCD Code
 A number with k decimal digits
will require 4k bits in BCD.
 Decimal 396 is represented in
BCD with 12bits as 0011 1001
0110, with each group of 4 bits
representing one decimal digit.
 A decimal number in BCD is
the same as its equivalent
binary number only when the
number is between 0 and 9.
 The binary combinations 1010
through 1111 are not used and
have no meaning in BCD.

GNIT ECE 36
1.5 Unit Distance Codes
The most common example of a unit distance code (Successive values differ by only one bit). See Table 2-10 page
52.

Binary code Gray code

GNIT ECE 37
Decimal Binary Gray
0 000 000
1 001 001
2 010 011
3 011 010
4 100 110
5 101 111
6 110 101
7 111 100
GNIT ECE 38
 The binary value B = bn…b2 b1 b0 can be
converted to Gray code G = gn…g2 g1 g0.
 With gi = bi+1  bi or G = B  B/2
Examples:
If B =110 then G = 110  011 = 101
If B = 10110111then
G = 10110111
 1011011
= 11101100

GNIT ECE 39
From gi = bi  bi+1 it follows that bi = gi  bi+1
 Example: Let G = 01011111. Then using b8 =
0.
 b7 = g7  b8 = 0 0=0
 b6 = g6  b7 = 1 0=1
 b5 = g5  b6 = 0 1=1
 b4 = g4  b5 = 1 1=0
 b3 = g3  b4 = 1 0=1
 b2 = g2  b3 = 1 1=0
 b1 = g1  b2 = 1 0=1
 b0 = g0  b1 = 1 1=0
 B = 01101010

GNIT ECE 40
 Hamming codes:
Hamming code not only provides the detection of a
bit error, but also identifies which bit is in error so
that it can be corrected. Thus hamming code is
called error detecting and error correcting code. The
code uses a no. of parity bits located at certain
positions in the code group. Hamming code can be
constructed for single error correction.
 Number of parity bits:
No. of parity bits dependent on the number of
information bits. If the no. of information bits is
designed x, the no. of parity bits, P is determined by
the following relationship.
2p > = x+p+1------------------- 1

GNIT ECE 41
 Example: Encode the binary word 1011 into seven bit even parity
hamming code.
 Sol: Step 1: Find the no. of parity bits required. Let P=3, then
Then 2 p= 2 3 = 8 and x+p+1=4+3+1=8
Three parity bits are sufficient
Therefore, Total code bits = 4+3 = 7
 Step 2: Construct a bit location table

Bit designation D7 D6 D5 P4 D3 P2
P1
Bit location 7 6 5 4 3 2
1
Binary location 111 110 101 100 011 010
001
Number
Information bits(Dn) 1 0 1 1
Parity bits(Pn) 0 0
1

GNIT ECE 42
 Step 3: Determine the parity bits
 For P1: Bit locations 3, 5, 7 have three 1’s
and therefore to have an even parity P1 must
be 1.
 For P2: Bit locations 3, 6,systems
Digital 7 have two 1’s and
therefore to have an even parity P2 must be
0.
 For P4: Bit locations 5, 6, 7 have two 1’s and
therefore to have an even parity P4 must be
0.
 Step 4: Enter the parity bits into the table to
form a seven bit hamming code = 1010101.
GNIT ECE 43
 American Standard Code for Information
Interchange (Refer to Table 1.7)
 A popular code used to represent information
sent as character-based data.
 It uses 7-bits to represent:
 94 Graphic printing characters.
 34 Non-printing characters.
 Some non-printing characters are used for text
format (e.g. BS = Backspace, CR = carriage
return).
 Other non-printing characters are used for
record marking and flow control (e.g. STX and
ETX start and end text areas).
GNIT ECE 44
 ASCII has some interesting properties:
 Digits 0 to 9 span Hexadecimal values 3016 to 3916
 Upper case A-Z span 4116 to 5A16
 Lower case a-z span 6116 to 7A16
 Lower to upper case translation (and vice versa)
occurs by flipping bit 6.

GNIT ECE 45
 Truth table  a tabular listing of the values of a
function for all possible combinations of values
on its arguments
 Example: Truth tables for the basic logic
operations:
AND OR NOT
X Y Z = X·Y X Y Z = X+Y X Z=X
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1
GNIT ECE 46
 Invented by George Boole in 1854
 An algebraic structure defined by a set B = {0, 1}, together with two binary operators (+ and ·) and a
unary operator ( )

1. X+0= X 2. Identity element


X .1 =X
3. X+1 =1 4. X .0 =0
5. X+X =X 6. X .X = X Idempotence

7. X+X =1 8. X .X = 0 Complement

9. X=X Involution

10. X+Y = Y+X 11. XY = YX Commutative

12. (X + Y) + Z = X + (Y + Z) 13. (XY) Z = X(Y Z) Associative

14. X(Y + Z) = XY + XZ 15. X + YZ = (X + Y) (X + Z) Distributive

16. X+Y = X .Y 17. X .Y = X+Y DeMorgan ’s

GNIT ECE 47
 Boolean Algebra is defined in general by a set B that can
have more than two values
 A two-valued Boolean algebra is also know as Switching
Algebra. The Boolean set B is restricted to 0 and 1.
Switching circuits can be represented by this algebra.
 The dual of an algebraic expression is obtained by
interchanging + and · and interchanging 0’s and 1’s.
 The identities appear in dual pairs. When there is only one
identity on a line the identity is self-dual, i. e., the dual
expression = the original expression.
 Sometimes, the dot symbol ‘’ (AND operator) is not
written when the meaning is clear

GNIT ECE 48
 Example: F = (A + C) · B + 0
dual F = (A · C + B) · 1 = A · C + B
 Example: G = X · Y + (W + Z)
dual G =
(X+Y) · (W · Z) = (X+Y) · (W+Z)
 Example: H = A · B + A · C + B · C
dual H =

(A+B)
Unless it happens to ·be
(A+C) · (B+C) the dual of
self-dual,
an expression does not equal the expression
itself
 Are any of these functions self-dual? H is self-dual
(A+B)(A+C)(B+C)=(A+BC)(B+C)=AB+AC+BC
GNIT ECE 49
 The order of evaluation is:
1. Parentheses
2. NOT
3. AND
4. OR
 Consequence: Parentheses appear
around OR expressions
 Example: F = A(B + C)(C + D)
GNIT ECE 50
 A+A·B=A (Absorption Theorem)
Proof Steps Justification
A+A·B
=A·1+A·B Identity element: A · 1 = A
= A · ( 1 + B) Distributive
=A·1 1+B=1
=A Identity element

 Our primary reason for doing proofs is to learn:


 Careful and efficient use of the identities and theorems
of Boolean algebra, and
 How to choose the appropriate identity or theorem to
apply to make forward progress, irrespective of the
application.

GNIT ECE 51
 AB + AC + BC = AB + AC (Consensus Theorem)
Proof Steps Justification
= AB + AC + BC
= AB + AC + 1 · BC Identity element
= AB + AC + (A + A) · BC Complement
= AB + AC + ABC + ABC Distributive
= AB + ABC + AC + ACB Commutative
= AB · 1 + ABC + AC · 1 + ACB Identity element
= AB (1+C) + AC (1 + B) Distributive
= AB . 1 + AC . 1 1+X = 1
= AB + AC Identity element
GNIT ECE 52
 Minimization  Minimization (dual)
XY+XY=Y (X+Y)(X+Y) = Y
 Absorption
X+X=X  Absorption (dual)
X · (X + Y) = X
 Simplification
X+XY=X+Y  Simplification (dual)
 DeMorgan’s X · (X + Y) = X · Y
X +Y=X·Y
 DeMorgan’s (dual)
 X·Y=X+Y
GNIT ECE 53
X+Y=X·Y X·Y=X+Y
X Y X·Y X+Y X Y X+Y X · Y X·Y X+Y
0 0 0 0 1 1 1 1 1 1
0 1 0 1 1 0 0 0 1 1
1 0 0 1 0 1 0 0 1 1
1 1 1 1 0 0 0 0 0 0
 Generalized DeMorgan’s Theorem:
X1 + X2 + … + Xn = X1 · X2 · … · Xn
X1 · X2 · … · Xn = X 1 + X2 + … + X n

GNIT ECE 54
Use DeMorgan's Theorem:
1. Interchange AND and OR operators
2. Complement each constant and
literal
Example: Complement G = (a + bc)d
+e
G = (a (b + c) + d) e

GNIT ECE 55
 An application of Boolean algebra
 Simplify to contain the smallest number of
literals (variables that may or may not be
complemented)
= AB + ABCD + A C D + A C D + A B D
= AB + AB(CD) + A C (D + D) + A B D
= AB + A C + A B D = B(A + AD) +AC
= B (A + D) + A C (has only 5 literals)

GNIT ECE 56
A B S C(arry)
0 0 0 0
1 0 1 0
0 1 1 0
1 1 0 1

Notice that the carry results are the same as AND


C=AB
GNIT ECE 57
 Minterms and Maxterms

 Sum-of-Minterm (SOM) Canonical Form

 Product-of-Maxterm (POM) Canonical Form

 Representation of Complements of Functions

 Conversions between Representations

GNIT ECE 58
 Minterms are AND terms with every variable
present in either true or complemented form.
 Given that each binary variable may appear
normal (e.g., x) or complemented (there
x are 2 n

minterms for n variables.


 Example: Two variables (X and Y) produce
2 x 2 = 4 combinations:
(both normal)
XY(X normal, Y complemented)
X Y(X complemented, Y normal)
X Y(both complemented)
 Thus
X Ythere are four minterms of two variables.

GNIT ECE 59
 Maxterms are OR terms with every variable in
true or complemented form.
 Given that each binary variable may appear
normal (e.g., x) or complemented (e.g., x), there
are 2n maxterms for n variables.
 Example: Two variables (X and Y) produce
2 x 2 = 4 combinations:
X+Y(both normal)
X+Y(x normal, y complemented)
X+Y (x complement , y normal)
X+Y(both complement)

GNIT ECE 60
 Two variable minterms and maxterms.
x y Index Minterm Maxterm
0 0 0 m0 = x y M0 = x + y
0 1 1 m1 = x y M1 = x + y
1 0 2 m2 = x y M2 = x + y
1 1 3 m3 = x y M3 = x + y
 The minterm mi should evaluate to 1 for
each combination of x and y.
 Themaxterm is the complement of the
minterm
GNIT ECE 61
x y z Index Minterm Maxterm
0 0 0 0 m0 = x y z M0 = x + y + z
0 0 1 1 m1 = x y z M1 = x + y + z
0 1 0 2 m2 = x y z M2 = x + y + z
0 1 1 3 m3 = x y z M3 = x + y + z
1 0 0 4 m4 = x y z M4 = x + y + z
1 0 1 5 m5 = x y z M5 = x + y + z
1 1 0 6 m6 = x y z M6 = x + y + z
1 1 1 7 m7 = x y z M7 = x + y + z
Maxterm Mi is the complement of minterm mi
Mi = mi and mi = Mi
GNIT ECE 62
x y z F Minterm Maxterm
0 0 0 0 M0 = (x + y + z)
0 0 1 1 m1 = x y z
0 1 0 1 m2 = x y z
0 1 1 1 m3 = x y z
1 0 0 0 M4 = (x + y + z)
1 0 1 1 m5 = x y z
1 1 0 0 M6 = (x + y + z)
1 1 1 1 m7 = x y z

F = m1+m2+m3+m5+m7 = ∑(1, 2, 3, 5, 7) =
xyz+xyz+xyz+xyz+xyz
F = M0 · M4 · M6 = ∏(0, 4, 6) = (x+y+z)(x+y+z)(x+y+z)
GNIT ECE 63
 Standard Sum-of-Products (SOP) form:
equations are written as an OR of AND
terms
 Standard Product-of-Sums (POS) form:
equations are written as an AND of OR
terms
 Examples: A B C + A B C + B
SOP:

 POS:
(A + B) · (A + B + C )· C
 These “mixed” forms are neither SOP nor
POS (A B + C) (A + C)
A B C + A C (A + B)

GNIT ECE 64
Asum of minterms form for n variables can be
written down directly from a truth table.
 Implementation of this form is a two-level network of
gates such that:
 The first level consists of n-input AND gates
 The second level is a single OR gate
 Thisform often can be simplified so that the
corresponding circuit is simpler.

GNIT ECE 65
A Simplification Example:
F( A , B, C ) = S (1,4,5,6,7)
 Writing the minterm expression:
F = A B C + A B C + A B C + ABC + ABC
 Simplifying:
F = A B C + A (B C + B C + B C + B C)
F = A B C + A (B (C + C) + B (C + C))
F = A B C + A (B + B)
F=ABC+A
F=BC+A
 Simplified F contains 3 literals compared to
15
GNIT ECE 66
 In
order for current to flow, both switches
must be closed
 Logic notation AB = C
(Sometimes AB = C)

A B C
0 0 0
0 1 0
1 0 0
1 1 1

GNIT ECE 67
 Current flows if either switch is closed
 Logic notation A + B = C

A B C
0 0 0
0 1 1
1 0 1
1 1 1

GNIT ECE 68
 Commutation
o A+B=B+A
o AB=BA

Same as

Same as

GNIT ECE 69
AB BA

A+B B+A

GNIT ECE 70
 Associative Property
A + (B + C) = (A + B) + C

A  (B  C) = (A  B)  C

GNIT ECE 71
Distributive Property
A + B  C = (A + B)  (A + C)
A+BC
A B C Q
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
GNIT ECE 72
(A + B)  (A + C)

A B C Q
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
GNIT ECE 73
A  B = AB + AB
Accumulating our results: Binary addition is the
result of XOR plus AND
GNIT ECE 74
A Q

0 1
Logic: Q=A
1 0

GNIT ECE 75
 Exclusive OR/ Exclusive NOR
 The eXclusive OR (XOR) function is an important Boolean
function used extensively in logic circuits.
 The XOR function may be;
 implemented directly as an electronic circuit (truly a gate)
or
 implemented by interconnecting other gate types (used
as a convenient representation)
 The eXclusive NOR function is the complement of the
XOR function
 By our definition, XOR and XNOR gates are complex
gates.
Chapter 2
- Part 3
76
 Uses for the XOR and XNORs gate include:
 Adders/subtractors/multipliers
 Counters/incrementers/decrementers
 Parity generators/checkers

 Definitions
 The XOR function is: XY = XY +XY
 The eXclusive NOR (XNOR) function, otherwise
known as equivalence is: XY = XY +XY
 Strictly speaking, XOR and XNOR gates do no
exist for more that two inputs. Instead, they
are replaced by odd and even functions.
Chapter 2
- Part 3
77
 Operator Rules: XOR XNOR
X Y X Y X Y (X  Y)

0 0 0 0 0 1

0 1 1 0 1 0
1 0 1 1 0 0
1 1 0 1 1 1

 The XOR function means:


X OR Y, but NOT BOTH
 XOR is known as equivalence function, why?

Chapter 2
- Part 3
78
 The XOR function can be extended to 3 or more
variables. For more than 2 variables, it is called
an odd function or modulo 2 sum (Mod 2 sum),
not an XOR:
X  Y  Z = X Y Z+ X Y Z + X Y Z + X Y Z
 The complement of the odd function is the even
function.
0 =X
X  identities:
 The XOR X  1 =X
XX =0 XX =1
XY = Y X
(X  Y )  Z = X  (Y  Z ) = X  Y  Z
Chapter 2
- Part 3
79
 XOR symbol:

 XNOR symbol:

 Shaped symbols exist only for two inputs

Chapter 2
- Part 3
80
1.12 Universal Gates

Nand and Nor gates are called Universal gates


as any Boolean function can be realized with the
help of Nand and Nor gates only

GNIT ECE 81
For example, NOT, OR, AND gates can be realized
by only Nand gates.

GNIT ECE
82
GNIT ECE
83
GNIT ECE
84
GNIT ECE
85
GNIT ECE
86
 Add inverters in two-level implementation
into the cost picture
 Attempt to “combine” inverters to reduce
the term count
 Attempt to reduce literal + term count by
factoring expression into POSOP or SOPOS

GNIT ECE 87
F = A B’ + A C’ + B A’ + B C’ 15 inputs and 8 gates*

= A A’ + A B’ + A C’ + B A’ + B B’ + B C’
= A (A’ + B’ + C’) + B (A’ + B’ + C’)
7 inputs and 4 gates
A

B F

* Counting inverters (NOTS) as 1 input and 1 gate

GNIT ECE 88
F = AB + AD’ + BC + CD’ 12 inputs & 5 gates
= A(B + D’) + C(B + D’) 8 inputs & 5 gates

B
F
D

GNIT ECE 89

Potrebbero piacerti anche