Boolean Algebra and Digital Circuits Guide
Boolean Algebra and Digital Circuits Guide
Boolean Algebra
Introduction,
Binary Numbers,
Number base conversion
Octal & Hexa Decimal Numbers,
Complements,
Basic definitions,
Axiomatic Definition of Boolean Algebra,
Basic Theorems and Properties of Boolean
Algebra, Boolean Functions,
Canonical and Standard Forms,
Other Logic Operations,
Digital Logic Gates (Text 2: 1.2, 1.3, 1.4, 1.5,2.1,
2.2, 2.3, 2.4, 2.5, 2.6, 2.7)
Combinational logic:
Introduction,
Design procedure,
Adders- Half adder,
EASWARA
Full adder (Text 2:4.1,4.2, 4.3)
M
1
Basic Electronics (BBEE103/203)
Digital electronics is a branch of electronics which deals with digital circuits and digital systems that they
operate in only two possible states. These states described with only two binary values (0, 1) which are
used to represent any data type including numbers, symbols, alphabetic, etc. In digital electronics every
digital device uses the signals are formed with only two voltage values (ideally, 0V and 5V).
Boolean algebra is the branch of algebra that differs from elementary algebra in the following ways:
EASWARA
because voltage across it is equal to 0 V and if the device is in on-state means logic 1 is used, because its
full voltage is equal to 5V.
2
Basic Electronics (BBEE103/203)
A number is a mathematical value used for counting, measuring objects and for performing arithmetic
operations like addition, subtraction, multiplication and division. Set of numbers (values) or digits used to
represent different quantities is known as number system. The value of any digit in a number can be
determined by the digit, the position and the base or radix of the number system.
For example, a decimal number (1947.0815)10 can be expanded using its positional weights as below
Numbers have various categories like natural numbers, whole numbers, rational and irrational numbers,
prime and composite numbers and so on.
The natural numbers are 1, 2, 3, 4, 5, etc. There are infinitely many natural numbers. The whole numbers are
the natural numbers together with 0. That is numbers 0, 1, 2, 3, .... are called as whole numbers. The
integers are the set of real numbers consisting of the natural numbers, their additive, inverses and zero.
{..., -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5...}
Some important number systems are as follows.
EASWARA
general communication. It can be used to represent both the integer as well as floating point values. The
decimal point is used to separate the integer part and the fractionpart of the given real number.
The details of these number systems are given in the table 4.1.
3
Basic Electronics (BBEE103/203)
Table-4.1
Number
Base Digits / symbols Example: with power notation
System
Decimal 10 0,1,2,3,4,5,6,7,8,9 (338.6)10 3x102+3x101+8x100. 6x10-1
Octal 8 0,1,2,3,4,5,6,7 (336.2)8 3x82+3x81+6x80. 2x8-1
Binary 2 0,1 (110.10)2 1x22+1x21+0x20. 1x2-1+0x2-2
Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F (4AB.2)16 4x162+10x161+11x160. 2x16-1
EASWARA
M
Decimal integer part Decimal fractional part
1. Divide decimal integer number by the base 1. Multiply decimal fraction number by the base of
of number system to be converted. the number system to be converted.
2. Save remainder (read remainders from bottom 2. Save the whole number (integer) of the result
to top). (read remainders from top to bottom).
3. Repeat steps 1 and 2 until the quotient 3. Repeat steps 1 and 2 for the fractional part of step
becomes zero. 2 until to the desired precision.
Example-1: Decimal to Binary base ⟹ (25.625)10 ⟹ ( ? )2 ⟹ ( 11001 . 101)2
Integer part value is 25 Fractional part value is 0.625
25 ÷ 2 ⟹12 (R→ 1) 0.625 x 2 ⟹ 1.25 ⟹ 1
12 ÷ 2 ⟹ 6 (R→ 0) (25)10 ⟹ (11001)2 0.25 x 2 ⟹ 0.5 ⟹0 (0.625)10 = (0.101)2
6 ÷ 2 ⟹ 3 (R→ 0) 0.5 x 2 ⟹ 1.0 ⟹1
3 ÷ 2 ⟹ 1 (R→ 1) (save remainder (R) backward) (save whole number forward)
1÷2⟹0 (quotient becomes zero)
4
Basic Electronics (BBEE103/203)
EASWARA
Procedure:
M
1. Obtain the power sequence (positional weights) of the number system to be determined.
2. Place the number in position : integers – left of the radix point ⟹ ( + ve powers)
fraction – right of the radix point ⟹ ( - ve powers)
3. Multiply the number with positional weights and add, to get decimal number.
power 23 22 21 20 . 2-1 2-2 83 82 81 80 . 8-1 8-2 163 162 161 160 . 16-1 16-2
weight 8 4 2 1 0.5 0.25 512 64 8 1 0.125 0.0156 4096 256 16 1 0.0625 0.0039
number 1 0 1 1 . 0 1 1 0 7 3 . 3 2 0 10 2 11 . 1 13
(8 + 0 + 2 + 1 + 0 + 0. 25) (512 + 0 + 56 + 3 + 0.375 + 0.031) (0 + 2560 + 32 + 11 + 0.0625 + 0.052)
numeric
value = (11. 25)10 = (571. 406)10 = (2603.11252)10
5
Basic Electronics (BBEE103/203)
)
1
6
)
2
Replace each octal digit by its 3-bit BCO Replace each hexadecimal
equivalent (see table 4.2) both for integer digit by its 4-bit BCO
and fractional part. equivalent (see table 4.2) both
for integer
and fractional part.
Example-7: Exampl
e:8
(A2B.1D)16 ⟹ (?)2 ⟹ (
1 0 7 3 . 3 2
EASWARA
(1073.32)8 ⟹ (?)2 ⟹ ( 001000111011.011010 )2
[given octal A
001000111011.011010 )2
2 B . 1 D
number] [given hexadecimal]
001 000 111 011 . 011 010
M
[from BCO] 1010 0010 1011 . 0001 1101
[from BCH]
Table 4.2. Binary Coded Decimal (BCD), Binary Coded Octal (BCO) and Binary Coded
Hexadecimal (BCH)
Hexa
Deci Oct Binary Coded
Binary Coded Binary Coded deci
mal al Hexa-
mal
Nu
numb numb
Decimal (BCD) Octal (BCO) mb decimal (BCH)
ers ers
ers
0 00 0 0 0 0 0 0 0 00 0 0
1 00 0 1 1 0 0 1 1 00 0 1
2 00 1 0 2 0 1 0 2 00 1 0
3 00 1 1 3 0 1 1 3 00 1 1
4 01 0 0 4 1 0 0 4 01 0 0
5 01 0 1 5 1 0 1 5 01 0 1
6 01 1 0 6 1 1 0 6 01 1 0
7 01 1 1 7 1 1 1 7 01 1 1
8 10 0 0 10 0 0 1 0 0 0 8 10 0 0
9 10 0 1 11 0 0 1 0 0 1 9 10 0 1
10 0 0 0 1 00 0 0 12 0 0 1 0 1 0 A 10 1 0
11 0 0 0 1 00 0 1 13 0 0 1 0 1 1 B 10 1 1
12 0 0 0 1 00 1 0 14 0 0 1 1 0 0 C 11 0 0
6
Basic Electronics (BBEE103/203)
13 0 0 0 1 00 1 1 15 0 0 1 1 0 1 D 11 0 1
14 0 0 0 1 01 0 0 16 0 0 1 1 1 0 E 11 1 0
15 0 0 0 1 01 0 1 17 0 0 1 1 1 1 F 11 1 1
16 0 0 0 1 01 1 0 20 0 1 0 0 0 0 10 0 0 0 10000
1’s complement means, replacing binary 0’s by binary 1’s and vice versa, as illustrated below.
Example: 1 0 1 1 0 1 0 0 0 1 Given binary bits
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ Replace opposite bit
0 1 0
EASWARA
0 1 0 1 1 1 0 1’s complement binary number
There are two possible cases while subtracting using 1’s and 2’s complement system as similar to the
elementary arithmetic operation, to represent the magnitude of the result.
1.
2.
M
Subtracting smaller number from larger number and
Subtracting larger number from smaller number
Subtracting smaller number from larger number Subtracting larger number from smaller number
1. Take 1’s complement of smaller number 1. Take 1’s complement of larger number
(subtrahend) (subtrahend)
2. Add 1’s complemented value to the larger 2. Add 1’s complemented value to
number (minuend) the smallernumber (minuend)
3. Add end-around carry to LSB, if any. LSB 3. Answer is in 1’s complement, hence,
is applied to the fractional part also. re-complement the result.
4 Sum obtained is the answer. 4 Attach negative sign to the answer.
7
Basic Electronics (BBEE103/203)
M
Example 15: Subtracting smaller number from larger number: (111001.10)2 - (011011.01)2
The 9's complement is used to find the subtraction of the decimal numbers. The 9's complement of a
number is obtained by subtracting each digit of the number by 9.
For example, given a decimal number (1423)10, then its 9's complement number is
9999
-1423
8
Basic Electronics (BBEE103/203)
8 5 7 6 (9’s complement)
The 10's complement is also used to find the subtraction of the decimal numbers. The 10's complement of a
number is obtained by subtracting each digit by 9 and then adding 1 to the result as shown below.
For example, given a decimal number (1423)10, then its 9's complement number is
9999
-1423
8576
+ 1
8 5 7 7 (10’s complement)
For example,
9’s complement subtraction: (752.3 – 325.5)10 = 10’s complement subtraction: (752.3 – 325.5)10 = 426.8
426.8 752.3 → → → → 752.3
752.3 → → 752.3 999.9 – 325.5 = + 674.4 674.5 (10’s complement)
999.9 – 325.5 = + 674.4 +1 1,426.8 neglecting the carry
1,426.7
426.8 426.8
+1
4.4 BOOLEAN ALGEBRA
Boolean algebra is a mathematical system for the manipulation of variables that can be used to analyze and
simplify the digital circuits whose outcome would be either 0 or1, since it uses only binary numbers (0,1). A
binary operator that will operates on two operands and manipulates them to return a result. Therefore, a
binary operator is a rule for combining two elements to produce another element.
Axiom: A EASWARA
set is a collection of objects with a common property. If S is a set and x is a member of the set S,
then x ∈ S. Let A = {1, 2, 3, 4} denotes the set A, whose elements are 1, 2, 3, 4.
M
Axioms are assumption that is valid without proof. So that axioms are the sets of logical expressions that
can accept as true and upon which a set of useful theorems can build. An axiom is nothing more than the
definition of three basic logic operations (AND, OR, and NOT). A number of rules can be derived from
basic logical AND, OR and NOT relations called as basic Boolean postulates.
Examples of axioms
Closure: A set S is closed with respect to a binary operator •, if and only if, for all x, y ∈ S, (x • y) ∈ S
Z+ = {1, 2, 3, …} is closed to addition, all positive numbers are in Z+
Associative law: A binary operator • defined on a set S is associative, iff, for all x, y, z ∈ S
(x • y) • z = x • (y • z)
Identity Element: A set S has an identity element e , iff, for every x ∈ S
For example, x + 0 = 0 + x = x
e • x = x • e = x (for example, x + 0 = 0 + x = x)
Commutative law: A binary operator • is commutative, iff, for all x, y ∈ S
x•y=y•x
Inverse Element: A set S has an inverse, iff, for every x ∈ S, there exists an element y ∈ S such that
x•y=e
Distributive law: If • and * are two binary operators on a set S, * is said to be distributive over • if, for all x,
y, z ∈ S
x • (y * z) = (x * y) • (x * z)
Axiomatic definition of Boolean algebra
9
Basic Electronics (BBEE103/203)
Boolean algebra is a set of elements B with two binary operators (+) and (∙), which satisfies the following
six axioms or postulates:
Axiom 1 (Closure):
(a) B is closed with respect to the operator (+);
(b) B is also closed with respect to the operator ( ∙ )
Axiom 2 (Identity):
(a) B has an identity element with respect to (+), designated by 0;
for example: x + 0 = 0 + x = x
(b) B has an identity element with respect ( ∙ ) , designated by 1;
for example: x∙1 =1∙ x = x
Axiom 3 (Commutative):
(a) B is commutative with respect to (+);
For example, x + y = y + x
(b) B is commutative with respect to ( ∙ )
For example, x ∙ y = y ∙ x
Axiom 4 (Distributive):
(a) The operator ∙ is distributive over (+);
x · (y + z) = (x · y) + (x · z)
(b) The operator + is distributive over ( ∙ )
EASWARA
x + (y · z) = (x + y)(x + z)
Axiom 5 (Complement Element):
For every x ∈ B, there exists an element x′ ∈ B such that
(a) x + x′ = 1 and
(b) x ∙ x′ = 0 M
The second element x′, is called the complement of x
Axiom 6 (Cardinality):
There are at least two elements x, y ∈ B such that x ≠ y
4.4.1 Two-valued Boolean algebra Properties (Laws)
Two-valued Boolean algebra (duality) satisfies Huntington axioms.
Duality: Every Boolean law has two forms: AND form and OR form as shown in the following table 4.3.
These are obtained by changing every AND (·) to OR (+), every OR (+) to AND (·) and all 1’s to 0’s and
vice- versa. This is known as duality.
Example: If X + 1 = 1 then X ∙ 0 = 0 by the duality principle.
Table-4.3
AND Relation (∙) OR Relation (+)
x · y = f1 x + y = f2
0·0=0 0+0=0
1·0=0 1+0=1
0·1=0 0+1=1
1·1=1 1+1=1
1·1·1=1 1+1+1=1
10
Basic Electronics (BBEE103/203)
Let binary value (0, 1) ∈ set B. From table-4.3, when AND operation is applied to x and y binary variables,
the output variable f1 produce the result of either 0 or 1. This operation is said to have closure. Similarly,
when OR operation is applied to x and y binary variables, the output variable f2 produce the result of either
0 or 1, then this operation is said to have closure. Because, the result of f1 or f2 is binary (0, 1) ∈ set B.
Axiom 2 (Identity Element):
The identity elements are 0 for the operator + and 1 for the operator (∙). From the table-4.3
we see that:
0+0=0
0 + 1 = 1 for the OR operator (+) the element 0 does not change the value, hence 0 is an identity of OR
1+0=1
1 ∙ 1 = 1 for the AND operator (·) the element 1 does not change the value, hence 1 is an identity of
AND
Axiom 3 (Commutative Property):
Binary operator ( ∙ ) and (+) are commutative on set B. That means, the commutative laws follow from the
symmetry of the AND/OR operators as shown in the table-4.4.
Table 4.4
AND form (x · y = y · x) OR form (x + y = y + x)
xy
x·y= y·x= x+y= y+x=
00 0·0=0 0·0=0 0+0=0 0+0=0
01
10
0·1=0
1·0=0 EASWARA
1·0=0
0·1=0
0+1=1
1+0=1
1+0=1
0+1=1
11 1·1=1 1·1=1 1+1=1 1+1=1
M
From the table-4.4, left hand and right hand terms of both AND form and OR form are verified.
From the table-4.5, left hand and right hand terms of both AND form and OR form are verified.
Axiom 5 (Complement):
Binary 0 and 1 are complements of each other, since 0 + 0′ = 0 + 1 = 1 and 1 + 1′ = 1 + 0 = 1; furthermore,
0 ∙ 0′ = 0 ∙ 1 = 0 and 1 ∙ 1′ = 1 ∙ 0 = 0.
11
Basic Electronics (BBEE103/203)
Axiom 6 (Cardinality):
The cardinality axiom is satisfied, since this two-valued Boolean algebra has two distinct elements, 1 and
0, and 1 ≠ 0.
4.4.2 DEMORGAN’S THEOREMS
Theorem-1 Theorem-2
The compliment of the product of variables is equal The compliment of the sum of variables is equal to
to the sum of the compliment of each variable. the product of the compliment of each variable.
(x · y)' = x'+ y' (x + y)' = x'· y'
Proof: Proof:
x y x·y (x· y)' x' y' x'+y' x y x+y (x+y)' x' y' x'· y'
0 0 0 1 1 1 1 0 0 0 1 1 1 1
0 1 0 1 1 0 1 0 1 1 0 1 0 0
1 0 0 1 0 1 1 1 0 1 0 0 1 0
1 1 1 0 0 0 0 1 1 1 0 0 0 0
AND+NOT = NAND
EASWARA BUBBLED OR
(x · y)' = x'+ y'
Boolean Function: It is a logical outcome (result) represented by a single variable in the left hand side of a
Boolean expression. For a given combination of values of the variables, the Boolean function can be either
1 or 0. It can be transformed from an algebraic expression into a logic diagram composed of different gates.
Boolean Expression: A Boolean expression consists of Boolean constants (1 and 0), logical operation
symbols (· and +) and binary variables. Each Boolean expression represents a Boolean function.
12
Basic Electronics (BBEE103/203)
There are many Boolean laws and theorems that can be used to simplify Boolean expressions so as to
optimize calculations as well as improve the working and simplifying digital circuits. The operator
precedence for evaluating Boolean expression:
1. Parentheses
2. NOT
3. AND
4. OR
13
Basic Electronics (BBEE103/203)
= A +AC+AB + BC = A + B.C
= A +AB +AC+BC = A(1 +B) +AC+BC
= A + AC + BC Example: 8 F = A + A′B.
= A(1 + C) + BC Given, F = A+ A′B
= A + BC = (A + A′) (A + B)
=A+B
Example: 4 F= A′B′C + A′BC + AB′
Example: 9
Given, F = A′B′C + A′BC + AB′
F= AB + A(B + C) + B(B + C)
= A′C (B′+B) + AB′
= AB + AB + AC + BB + BC
= A′C + AB′
= AB + AB + AC + B + BC
Example: 5 F = AB + (AC)′ + AB′C(AB + C). = AB + AC + B + BC
Given, F = AB + (AC)′ + AB′C(AB + C) = AB + AC + B
= AB + A′ + C′+ AB′[Link] + AB′C.C = B+AC
= AB + A′ + C′ + 0 + AB′C (B.B′ = 0 and C.C = C)
= ABC + ABC′ + A′ + C′ + AB′C (AB = AB(C + C′)= ABC + ABC′)
= AC(B + B′) + C′(AB + 1) + A′
= AC + C′+A′ (B + B′ = 1 and AB + 1 = 1)
= AC + (AC)′ = 1
4.6 CANONICAL AND STANDARD FORMS
Variables are the different symbols in a Boolean expression. They may take on the binary value 0 or 1.
EASWARA
Each occurrence of a variable or its complement is called a literal.
Example: F = x + y · x + y'
In the above Boolean function F, two variable (x and y) and four literals can be found. A term is formed by
M
literals. Say for the above expression x, yx and y’are the three terms.
Sum of Products (SOP)
A sum-of-products (SOP) expression contains the sum of different terms, with each term being either a
single literal or a product of more than one literal. It can be obtained directly from the truth table by
considering each terms produce a logic 1 at the output. Sum of products expression is also known as a min-
term expression. Boolean min-terms, max-terms and its designation is shown in table-4.6.
Table-4.6
min-terms max-terms
xyz
terms designation terms designation
000 x' y' z' m0 x + y+ z M0
001 x' y' z m1 x + y+ z' M1
010 x' y z' m2 x + y'+ z M2
011 x' y z m3 x + y'+ z' M3
100 x y' z' m4 x' + y+ z M4
101 x y' z m5 x' + y+ z' M5
110 x y z' m6 x' + y'+ z M6
111 xyz m7 x' + y'+ z' M7
Example: F = x' y' z + x y' z'+ x y z', is an SOP expression containing three min-terms (m1, m3, m6).
Products of Sum (POS)
14
Basic Electronics (BBEE103/203)
A product of sums (POS) expression contains the product of different terms, with each term being either a
single literal or a sum of more than one literal. It can be obtained directly from the truth table by
considering each terms produce a logic 0 at the output. Product of sum expression is also known as a max-
term expression.
Example: F = (x + y'+ z)(x' + y+ z')(x' +y' +z'), is a POS expression containing 3 maxterms (M2, M5, M7)
Standard form
For example, F(A,B,C) = A’B’C’ + A B’C’ + A B C, is a Boolean function of three variables expressed in
canonical form. This function after simplification reduces to F = B’C’+ A B C and loses its canonical form so
that it retains in standard form. That means, when a Boolean function is expressed as the sum of all the
min-terms from the rows of a truth table, for which the output is 1, it is referred to as the canonical SOP.
On the other hand, when a Boolean function is expressed as the product of all the max-terms from the
rows of a truth table, for which the output is 0, it is referred to as the canonical POS.
The examples, like Y = AB + BC + AC
or Y = (A + B + C) (A + B′ + C) (A + B + C′) are the standard forms.
However, Boolean functions are also sometimes expressed in non-standard forms like
F = (AB + CD) (A′B′ + C′D′),
which is neither a sum of products form nor a product of sums form. However, the same expression can be
converted to a standard form with help of various Boolean properties, as:
F = (AB + CD) (A′B′ + C′D′) = A′B′CD + ABC′D′ F is now in SOP standard form.
Canonical sum of min-terms
EASWARA
For example, if the canonical SOP form of a three-variable logic function F has the min-terms A′BC,
AB′C, and ABC′ (extracted directly from the output of truth table having logic 1) this can be expressed
F (A, B, C) = (3, 5, 6)
= m 3 + m5 + m 6
M
as the sum of the decimal codes corresponding to these min-terms as:
Example: 11– Express the Boolean canonical function F = A + B'C as standard sum of min-terms.
Solution – step1: Total number of variables: 3
Step2: Missing literals: BC in first term and A in the second term
Step3: To fill B in the first term: A = A(B + B') = AB + AB' since, B + B' = 1
To fill C in the first term, A = AB(C + C') + AB'(C + C') since, C + C' = 1
= ABC + ABC'+ AB'C + AB'C' …..… (1)
The second term B'C is missing variable A; hence,
B'C = B'C (A + A') since, A + A' = 1
= AB'C + A'B'C …… (2)
Combining equations (1) and (2), we have
F = A + B'C = ABC + ABC' + AB'C + AB'C' + AB'C + A'B'C ……..(3)
In equation (3), AB'C appears twice and we know that (x + x = x).
15
Basic Electronics (BBEE103/203)
Solution- In the above three-variable POS function, C is missing from the first term, A is
missing from the second term, and B is missing from the third term. Therefore, CC′, AA′
and BB′ is to be added with the respective terms, is as shown below.
EASWARA
= (A + B′ + 0) (B + C + 0) (A + C′ + 0)
= (A + B′ + CC′) (B + C + AA′) (A + C′ + BB′)
since, AA’= BB’= CC’= 0
F (A,B,C) = Π (0, 1, 2, 3, 4)
= M0 · M1 · M2 · M3 · M4
16
Basic Electronics (BBEE103/203)
Example:15- Convert the SOP function F (A, B, C) = ∑ (0, 2, 3, 5, 7) into POS function.
EASWARA
Solution- F (A, B, C) = ∑ (0, 2, 3, 5, 7) = A’ B’ C’ + A B’ C’ + A B’ C + ABC’ + ABC
17
Basic Electronics (BBEE103/203)
100 = AB’C’
110 = AB C’
111 = AB C
Writing down the new equation in the form of SOP form,
F(A, B, C) = Σ (0, 1, 4, 6, 7)
= A’B’C’ + A’B’C + AB’C’ + ABC’ + ABC
= m0 + m1 + m4 + m6 + m7
Logic gate is a basic building block of digital circuit designed to produce the basic logic functions, AND,
OR, NOT. Logic gates are primarily implemented using diodes or transistors acting as electronic switches,
having one or more than one input and only one output. In a circuit, logic gates will make decisions based
on a combination of digital signals coming from its inputs. Inputs of any gate are driven by voltage levels
0V and 5V representing logic 0 and logic 1, respectively. Logic systems consist of gates and flip-flops.
Flip-flops are memory devices capable of storing logic values (0 or 1).
A logic gate can be thought of like a two mode switch, wherein one position the output is off – logic 0, and
in another, it is on – logic 1. Logic gates are commonly used in integrated circuits.
Buffers
EASWARA
Buffers do not affect the logical state of a digital signal. A
logic 1 input results in a logic 1 output whereas a logic 0
input results in a logic 0 output. Buffers are used to
Inverters M
provide extra current drive at the output.
OR gates
OR gates will produce a logic 0 if both inputs are LOW,
Otherwise output is logic 1.
The Boolean expression for the output, F = x + y
NAND gates
18
Basic Electronics (BBEE103/203)
NOR gates
NOR (NOT-OR) gates will produce a logic 1 output, only
if all inputs are at logic 0. Otherwise, it produces a logic 0
output. The Boolean expression for the output,
F = (x + y)'
Exclusive OR Gates
EX-OR gates will produce output logic 1, if both inputs are
different. Otherwise, output is logic 0, if both inputs are
same. The Boolean expression for the output
F = x’· y +x · y’
EASWARA
EX-NOR gates will produce output logic 1, if both inputs
are same. Otherwise, output is logic 0, if both inputs are
different.
The Boolean expression for the output
F = x’· y’ +x · y
M
4.8 IMPLEMENTATION OF BOOLEAN FUNCTION WITH LOGIC GATES
Any Boolean function can be implemented by using basic logic gates by properly interconnecting them.
The simplest way to convert a given Boolean expression into a logical circuit is to start from the output of
the Boolean expression and reach towards the input.
Example:17- Implement a logic circuit for the Boolean function F= (BC)’ + A + (A+C)’
Solution: Step-1: Given Boolean function
F is the summation of three terms (BC)’,
A and (A+C)’, thus a 3-input OR gate
need to be used as shown in the fig.4.2.
Fig.4.2
Step-2: Note down (BC)’ and (A + C)’
are complemented terms, hence two
NOT gates are used by inverting the
input BC and (A + C), as shown in the Fig.4.3
fig.4.3.
Step-3: BC will be output of 2-input AND gate, (A + C) will be output of 2-input OR gate and A
will be a direct input as shown in the fig.4.4.
19
Basic Electronics (BBEE103/203)
Fig.4.4
Example:18- Implement a logic circuit for the Boolean function F= ABC +A(B’+C’)
EASWARA Fig.4.5
Data
M
refers to the symbols that represent people, events, things and ideas. Data can be a text, a name, a
number, the colors in a photograph, or the notes in a musical composition. Data Representation refers to the
form in which data is stored, processed and transmitted using digital devices. Devices such as smart phones
and computers store data in binary bit formats that can be handled by digital circuitry.
The decimal number system is used in general communication. Computers use binary number system (base
2); they can store and process the data in terms of 0s and 1s only. Binary numbers particularly large group
of bits are not very convenient to handle. To make numbers easier to handle, we often convert binary
numbers to hexadecimal (base 16).
Nibble: group of four bits (or single hexadecimal character) Ex: 1001, 1101, etc…
Byte: group of eight bits (Represented by 2 hexadecimal characters). Ex: 11101011, 01101100, etc…
Word: A group of 16 bits can be represented by four hex characters, 32 bits (a double word by eight hex
characters, and so on).
Table 4.6: Data types
Unsigned word 16 0 to 65,535 0000 0000 0000 0000 - 1111 1111 1111 1111
Signed word 16 - 32,768 to +32,767 1000 0000 0000 0000 - 0111 1111 1111 1111
20
Basic Electronics (BBEE103/203)
Data types: A byte of data can be stored at each address within the total memory space of microprocessor
systems. Different data types are listed in table 4.6.
Hence one byte can be stored (216 = 65,536) at each of the 65,536 memory locations within microprocessor
systems having a 16-bit address bus. Individual bits within a byte are numbered from 0 (least significant bit
- LSB) to 7 (most significant bit - MSB). In the case of 16-bit words, the bits are numbered from 0-LSB to
15-MSB. The value of a byte expressed in binary can be easily converted to hex by arranging the bits in
groups of four.
Negative (or signed) numbers can be represented using 2’s complement notation where the leading (MSB)
bit indicates the sign of the number (1 = negative, 0 = positive).
For example, the signed 8-bit number “10000001” represents the decimal number “1”.
Data storage: When expressing the amount of data storage provided by a memory device, usually use
Kilobytes (Kbyte = KB). It is important to note that a Kilobyte of memory is actually 1,024 bytes (not
1,000 bytes). The reason for choosing is that 1,024 happen to be the nearest power of 2 (note that 2 10 =
1,024).
Computer memory is of two basic types – Primary memory (RAM and ROM) and Secondary memory
(hard drive, CD, etc). The capacity of ROM is usually specified in terms of an address range and the data
stored at each address.
For example, 1 K X 8 bits (capacity 1 KB = 210 = 1024), 1MB = 220
2 K X 8 bits (capacity 2 KB = 211 = 2048),
EASWARA
4 K X 8 bits (capacity 4 KB = 212 = 4096) and so on.
Difference between RAM and ROM is given in the below table-4.7.
1GB = 230
Table-4.7
Sl.
No.
Utility
M
RAM ROM
21
Basic Electronics (BBEE103/203)
A combinational circuit is the digital logic circuit in which the output depends on the combination of inputs
at that point of time. The digital logic gate is the building block of combinational circuits. The function
implemented by combinational circuit is depending upon the type of Boolean function. On the other hand,
sequential logic circuits consist of both logic gates and memory elements such as flip-flops. The
combinational circuit having n input variables, logic circuit and m output variables as shown in the fig.4.6.
Logic gates receive external n input signals and process to produce the required m outputs. For n inputs
there are 2n possible combinations of binary input values. For each possible input combination, there is one
and only one possible output combination. Each output function is expressed in terms of the n input variables.
By using a standard range of logic levels (i.e. voltage levels used to represent the logic 1 and logic 0 states)
logic circuits can be combined in order to solve complex logic functions.
EASWARA
Analysis and design of any type of combinational circuit depends on the output defined by the logic state
(0 or 1) and it is further depends only on the present input binary states. The following are the basic steps
to design a combinational circuit.
1.
2.
M
Understand the problem statement (realize how the output of the circuit depend on the inputs)
For the number of available input variables and required output variables is determined.
3. Assign letter symbols to the inputs and the outputs. (say, A, B, C inputs and S and C as outputs)
4. Get the relationship between input and output from the truth table.
5. Simplify the Boolean expression to minimize the number of logic gates.
6. Draw the logic diagram using gates.
4.10.2 ADDERS
The most basic operation in digital computer and other types of processors is binary addition. Binary
addition is used to calculate addresses, addition, multiplication, bit-shifting operations and table indices in
the ALU.
Adders are classified into two types:
(1) Half Adder and (2) Full Adder
HALF ADDER
The half adder circuit is a digital circuit capable of adding only two binary bits at a time and produces carry
and sum. This process follows the binary addition rules.
Design procedure:
1) Problem statement: Half adder circuit adds two binary inputs and produces two outputs by following
the binary addition rules.
22
Basic Electronics (BBEE103/203)
EASWARA
4) Extracting Boolean min-terms and max-terms for the output variables:
Min-terms (SOP) Max-terms (POS)
Sum, S = A’B+AB’ Sum, S = (A+B)(A’+B’)
Carry, C = AB
M Carry, C = (A+B)(A+B’)(A’+B)
5) Logic circuit: For the Boolean min-terms, an half adder circuit can be implemented using
i) one XOR gate (for sum) and one AND gate (for carry) as shown in the fig.4.7(a).
ii) two NOT gates, two AND gates and one OR for Sum; one AND for Carry as shown in the
fig.4.7(b).
Fig.4.7 (a) Implementation of half adder using EXOR & AND gates (b) Basic gates
For the Boolean max-terms, the half adder circuit is implemented after simplification of carry term (C).
C = (A+B)(A+B’)(A’+B) transferring POS to SOP we write,
C = A’B’+A’B+AB’
=A’(B’+B)+AB’ B’+B=1
23
Basic Electronics (BBEE103/203)
Limitation of half adder: Half Adder circuit cannot receive a carry input bit.
Full Adder
EASWARA
The full-adder circuit is a digital circuit capable of adding three bit binary numbers. This circuit consists of
three inputs and two outputs (2 bits: x and y and one bit previous carry z). It adds these three input bits (x, y
and z) at a time and produce a carry (C) and sum (S) by following the binary addition rules. It can be
M
constructed using two half adders that consists of 2 ANDs, 2 XORs, and one OR gate as shown in the fig
4.9.
24
Basic Electronics (BBEE103/203)
=
EASWARA
M
Fig.4.9 Circuit diagram of Full Adder using two half adders
Implementation of full adder circuit using basic logic gates (NOT, AND and OR) is shown in the fig.4.10.
25
Basic Electronics (BBEE103/203)
EASWARA
Fig.4.10 Implementation of full adder circuit using basic gates
M
SOLVED EXAMPLES
NUMBER SYSTEMS
1. Convert the following numbers with the indicated bases to decimal: (a) (4310)5 b) (198)12 (c) (735)8 (d) (5251)6
3 2 1 0
Solution: (a) (4310)5 = 4 x5 + 3 x 5 + 1 x 5 + 0 x 5 = (580)10
2 1 0
(b) (198)12 = 1 x 12 + 9 x 12 + 8 x 12 = (260)10
2 1 0
(c) (735)8 = 7 x 8 + 3 x 8 + 5 x 8 = (477)10
2 1 0
(d) (525)6 = 5 x 6 + 2 x 6 + 5 x 6 = (197)10
3. Express the following numbers in decimal: (a) (10110.0101)2 b) (l6.5)16 (c) (26.24)8 d) (FAFA.B)16 (e)
(1010.1010)2
26
Basic Electronics (BBEE103/203)
3 2 1 0
(d) (FAFA.B)16 = 15x16 + 10x16 + 15x16 + 10x16 + 11/16 = (64,250.6875)10
4. Perform subtraction on the given unsigned decimal number using the 10's complement and 9’s complement.
Verify your answers by straight subtraction. (a) 6,428 – 3,409 (b) 125 – 1,800 c) 2,043 – 6,152 (d) 1,631
– 745
Solution: (a) 3409 → 03409 → (99999-03409) = 96590 (9’s complement) 96590+1 = 96591 (10’s
complement)
(b) 1800 → 01800 → (99999-01800) = 98199 (9’s complement) 98199+1 = 98200 (10’s
complement)
EASWARA
125 – 1800 = 00125 + 98200 = 98325 (negative)
M
(c) 6152 → 06152 → 93847 (9’s complement) 93847+1= 93848 (10’s complement)
2043 – 6152 = 02043 + 93848 = 95891 (Negative) Magnitude: 4109 Result: 2043 – 6152 = -4109
(d) 745 → 00745 → 99254 (9’s complement) 99254+1= 99255 (10’s complement)
1631 -745 = 01631 + 99255 = 0886 (Positive) Result: 1631 – 745 = 886
BOOLEAN ALGEBRA
5. Prove the following theorems: i) x + x = x, ii) x · x = x iii) x + 1 = 1 iv) x + xy = x
x + x = (x + x)·1 x·x=xx+0
= (x + x) (x + x’) = x x + x x’
= x +0 =x
=x
iii): x + 1 = 1 iv): x + xy = x
x+1=1 (x + 1) x + xy = x · 1 + xy
= (x + x) (x + 1) = x(1 + y)
= x+x’·1 = x(y + 1)
27
Basic Electronics (BBEE103/203)
= x + x’ =x·1
=1 =x
= AB + C'
b)
EASWARA
7. Reduce the following Boolean expressions to the required number of literals.
a) (x'y' + z)' + z + xy + wz to three literals
A'B(D' + C'D) + B(A + A'CD) to one literal
c) (A' + C)(A' + C')(A + B + C'D) to four literals
d) M
ABCD + A'BD + ABC'D to two literals
Solution: (a) (x'y'+z)’+ z + xy + wz to three literals (b) A'B(D' + C'D) + B(A + A'CD) to one literal
= (x'y')'z' + z + xy + wz = B(A'D' + A'C'D + A + A'CD)
= [ (x + y) z' + z] + xy + wz
= B(A'D' + A + A'D(C + C')
= (z + z')(z + x + y) + xy + wz
= B(A + A'(D' + D))
= z + wz + x + xy + y
= B(A + A')
= z(1 + w) + x(1 + y) + y
=B
=x+y+z
(d) ABCD + A'BD + ABC'D to two literals
(c) (A' + C)(A' + C')(A + B + C'D) to four literals
= ABCD + A'BD + ABC'D
= (A' + CC')(A + B + C'D)
= ABD(C+C’) + A'BD
= A'(A + B + C'D)
= BD(A+A’)
= AA' + A'B + A'C'D
= BD
= A'(B + C'D)
28
Basic Electronics (BBEE103/203)
(e) (x + y' + z')(x' + z') =xx' + xz' + x'y' + y'z' + x'z' + z'z' = z' + y'(x' + z') = z' + x'y'
9. Find the complement of the following Boolean functions and reduce them to the minimum number of literals.
(a) xy’+x’y (b) A’B+CD)E’+E (c) (x’+y+z’)(x+y’)(x+z)
xy’+x’y F' = [(A'B + CD)E' + E]' F' = [(x' + y + z')(x + y')(x + z)]'
F' = (xy' + x'y)' = [(A'B + CD) E' + E]' = (x' + y + z')' + (x + y')' + (x + z)'
= (xy')'(x'y)' = [(A'B + CD)'· E] · E' = F' = xy'z + x'y + x'z'
= (x' + y)(x + y') = [(A'B)'·(CD)'+E] E'
10. Convert each of the following expression into SOP & POS: (a) (AB + C)(B + C'D) (b) x' + x(x + y')(y + z')
F = xy(z+z’) + xy’(z+z’) +(x+x’) y'z simplifying and arranging the SOP terms
F = x’y’z + xy’z’ + xy’z + xyz’ + xyz
xyz F min-terms
000 0
001 1 x’y’z
010 0
011 0
100 1 xy’z’
101 1 xy’z
110 1 xyz’
111 1 xyz
12. Draw the logic diagram corresponding to the following Boolean expressions without simplifying them:
(a) Y= A+B+B’(A+C’) (b) Y = (A’+B’) (C+D’)
Solution: (a) Y= A+B+B’(A+C’) (b) Y = (A’+B’) (C+D’)
29
Basic Electronics (BBEE103/203)
EASWARA
M
REVIEW QUESTIONS
NUMBER SYSTEM
1. Convert the following: i) (101101)2 to base 10 ii) (0.375)10 into binary number iii) (1101)16 to base
2 and base 10 (1010110101)2 to base 16
2. Write the equivalent decimal numbers by representing the following signed 8-bit and unsigned 8-bit
binary numbers: i) (10001101)2 ii) (01010101)2 iii) (10110101)2 iv) (10101100)2.
3. Distinguish between RAM and ROM memory systems.
4. Write a note on different data types mentioning the bit size and range of values supported.
5. What is a logic gate? Explain the following logic gates: i) NAND ii) NOR and iii) EXOR
30
Basic Electronics (BBEE103/203)
6. Construct an exclusive-OR gate using only (AND, OR and NOT) basic gates.
7. Design a logic circuit using basic logic gates with three inputs ABC and output Y that goes logic 1 only
in two cases: i) A = 1, and B = 0 and C = 1 and ii) A = 0, and B = 1 and C = 0.
8. Construct a logic circuit that will produce a logic 1 output whenever two or more of its inputs are at
logic 1.
9. Realize basic logic gates from NOR and NAND gates.
DATA TYPE DATA REPRESENTATION
10. Perform subtraction on the given unsigned decimal number using the 2's and 1’s complement. Verify
the answers by straight subtraction: a) 11010 - 1101 (b) 11010 - 1000 c) 1001- 10011 d) 10000 – 110
ADDERS
11. Design an half adder circuit and implement the circuit using basic logic gates.
12. Explain full adder circuit and construct its logic circuit using two half adders and one OR gate.
BOOLEAN ALGEBRA
EASWARA
(a) ABC+ A'B'C + A'BC + ABC' + A'B'C' to five literals
(b) BC + AC' + AB + BCD to four literals
(c) [(CD)' + A' + A + CD + AB to three literals
M
(d) (A + C + D)(A + C + D')(A + C' + D)(A + B') to four literals
15. Find the complement of the following Boolean functions and reduce to a minimum number of literals.
(a) (BC' + A'D)(AB' + CD') (b) B'D+ A'BC' + ACD + A'BC (c) [(AB) A][(AB) B] (d) AB'+ C'D'
16. Express the following functions in a sum of min-terms and a product of max-terms.
(a) F(A, B, C, D) = D(A' + B) + B'D (b) F(w, x, y, z) = y'z + wxy' + wxz' + w'x'z
(c) F(A, B, C, D) = (A + B' + C)(A + B)(A + C' + D') (A' + B + C + D')(B+ C' + D')
(d) F(A, B, C) = (A' + B)(B' + C) (e) F(x, y, z) = 1 (f) F(x, y, z) = (xy + z)(y + xz)
17. Convert the following to the other canonical form.
(a) F(x, y, z) = ∑(1, 3, 7) (b) F(A, B, C, D) = ∑(0, 2, 6, 11, 13, 14) (c) F(x, y, z) = π(0, 3, 6, 7)
(d) F(A, B, C, D) = π(0, 1, 2, 3, 4, 6, 12)
31