Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

Digital Logic Design II (EE 411)

Department of Electrical Engineering


Taibah University
Ibrahim Altarjami

September 4, 2022

1 / 33
Overview : Information Representation in Digital Circuits

• In the logic circuits, the information is represented by combinations of 0 and 1.


• For example, the logic values which are used to represent the voltage levels in electric
circuit can be as fallow:
• The value 0 is representing the ground or 0 V.
• The value 1 is representing the voltage level of the electric circuit power supply (1 V to 5 V).
Decimal Numbers
• In the familiar decimal system, a decimal system is a number consists of digits that have
10 possible values (from 0 to 9), where each digit represents a multiple of a power of 10.

Examples
The number 547.85 can be written as
5 ×102 + 4 × 101 + 7 × 100 + 8 × 10−1 + 5 × 10−2

2 / 33
Decimal Numbers
• a decimal integer is expressed by an (n+m)-tuple comprising n+m decimal digits as
shown below.
Positional Number Representation
D = dn−1 dn−2 · · · d1 d0 .d−1 d−2 · · · d1−m d−m , represents the value
V (D) = dn−1 × 10n−1 + dn−2 × 10n−2 + · · · + d1 × 101 + d0 × 100 + d−1 × 10−1 + d−2 ×
10−2 + · · · + d1−m × 101−m + d−m × 10−m

Examples
The number 547.85 can be written as
5 ×102 + 4 × 101 + 7 × 100 + 8 × 10−1 + 5 × 10−2 , n=3 and m=2.

• Because the digits have 10 possible values and each digit is weighted as a power of 10,
then the decimal numbers are base-10 numbers.

3 / 33
Binary Numbers
• Since digital circuits represent information using only the values 0 and 1, it is not
practical to have digits that can assume ten values. In logic circuits it is more appropriate
to use the binary, or base-2, system, because it has only the digits 0 and 1.
Positional Number Representation
D = dn−1 dn−2 · · · d1 d0 .d−1 d−2 · · · d1−m d−m , represents the value
V (D) = dn−1 × 2n−1 + dn−2 × 2n−2 + · · · + d1 × 21 + d0 × 20 + d−1 × 2−1 + d−2 × 2−2 +
· · · + d1−m × 21−m + d−m × 2−m

Examples
The binary number 1101 can be written as
1 ×23 + 1 × 22 + 0 × 21 + 1 × 20 = 13.
• For n digits, there are 2n possible numbers in the binary system.

4 / 33
Number Base Conversions

Examples
From any base-r number to decimal (base-10) :
(1100.11)2
(985.35)8
(857)7
(B65F )16

Examples
From decimal (base-10) any base-r number :
(575)10
(985.35)10
(857)10

5 / 33
Number Base Conversions

6 / 33
Number Base Conversions

7 / 33
Introduction to Logic Circuits (variables and functions)
• In binary logic circuits there are only two values, 0 and 1. The general form of a logic
circuit is a switching network.
• The simplest binary element is a switch that has two states. If the switch is controlled by
x, we say the switch is open if x = 0 and closed if x = 1.

8 / 33
Introduction to Logic Circuits (variables and functions)

• Assume the switch controls a light


bulb as shown in the left figure, The
output is defined as the state of the
light L :
• If the light is on, then L = 1.
• If the light is off, then L = 0.
• The state of L, as function of x is
L(x) is a logic function , x is an input
variable.

9 / 33
Variables and Functions (OR gate)

• Consider the possibility of two switches controlling the state of the light.
• Using a parallel connection, the light will be on only if either or both switches are closed.
• L(x1, x2)= x1+ x2.
• L=1 if x1 OR x2 is 1 (or both).
• The circuit below implements a logical OR function (+).

10 / 33
Variables and Functions (AND gate)

• Using a series connection, the light will be on only if both switches are closed.
• L(x1, x2)= x1 * x2.
• L=1 iff x1 AND x2 is 1.
• The circuit below implements a logical AND function (*).

11 / 33
Variables and Functions (NOT gate)

• Using parallel connection with the light.


• L(x1)= x, L(x) is the inverse (or complement) of x.
• L=1 if x=0 and L=0 if x=1.
• The circuit below implements a logical NOT function.

12 / 33
Truth Tables
• Truth Table is a table that fully describes a logic function where the output value is based
on the input combinations.
• Truth table for AND and OR functions of two variables are presented below :

Exercises :
Write the truth table for NOT, NAND, NOR, XOR, and XNOR.
13 / 33
Boolean Algebra

• Boolean algebra is based on a set of rules derived from a small number of basic
assumptions (axioms) [left list].
• From the axioms are derived some rules for dealing with single variables which are the
single-variable theorems [right list].

14 / 33
Duality
• Axioms and single-variable theorems are expressed in pairs that reflects the importance of
duality.
• Given any logic expression, its dual is formed by replacing all + with * , and vice versa
and replacing all 0s with 1s and vice versa.

15 / 33
Duality
• The dual of any true statement is also true.

16 / 33
Proof (Duality)

17 / 33
Proof (Duality)

18 / 33
Extra Exercises

Examples
Proof the fallowing logic equations :
(X + A)(X + A)(A + C )(A + D)X = AX
Example 2.1 in the book:
(x1 + x3 ) ∗ (x1 + x3 ) = x1 ∗ x3 + x1 ∗ x3
Example 2.2 in the book:
x1 ∗ x3 + x2 ∗ x3 + x1 ∗ x3 + x2 ∗ x3 = x1 ∗ x2 + x1 ∗ x2 + x1 ∗ x2

19 / 33
Proof

20 / 33
Proof

21 / 33
Truth Tables

22 / 33
Venn diagrams
• Venn diagram: graphical illustration of various operations and relations in an algebra of
sets.

23 / 33
Notation and terminology
• Because of the similarity with arithmetic addition and multiplication operations, the OR
and AND operations are often called the logical sum and product operations.
• The expression ABC + ABD + AC E is a sum of three product terms
• The expression (A + B + C )(A + B + D)(A + C + E ) is a product of three sum terms
• When a function is written as a sum of minterms, the form is called a standard sum-of
products. For a given row of the truth table, the minterm is formed by including xi if xi =
1 and by including xi if xi = 0.
• When a function is written as a sum of maxterms, the form is called a standard product
of sum. For a given row of the truth table, the minterm is formed by including xi if xi = 0
and by including xi if xi = 1.
• In the absence of parentheses, operations in a logical expression are performed in the
order NOT, AND, and then OR.

24 / 33
Maxterms vs. Minterms
• Maxterms is the complement of minterms, as shown in the below tables.
• Maxterms : f (x, y , z) = Π (Mi , ..., Mj )
• Minterms : f (x, y , z) = (mi , ..., mj )
P

Row number x y z Minterm Row number x y z Maxterm


0 0 0 0 m0 = xy z 0 0 0 0 M0 = x + y + z
1 0 0 1 m1 = xy z 1 0 0 1 M1 = x + y + z
2 0 1 0 m2 = xy z 2 0 1 0 M2 = x + y + z
3 0 1 1 m3 = xyz 3 0 1 1 M3 = x + y + z
4 1 0 0 m4 = xy z 4 1 0 0 M4 = x + y + z
5 1 0 1 m5 = xy z 5 1 0 1 M5 = x + y + z
6 1 1 0 m6 = xy z 6 1 1 0 M6 = x + y + z
7 1 1 1 m7 = xyz 7 1 1 1 M7 = x + y + z

25 / 33
Logic Circuit Design

Examples
Assume we want to design a logic circuit with three inputs A, B, and C. The circuit output
should be 1 only when A=1 and either B or C (or both) is 1.

• A=1, B=0, C=1 , ABC


• A=1, B=1, C=0 , ABC
• A=1, B=1, C=1 , ABC
The function could be written as
• f(A,B,C)=ABC + ABC + ABC .
• Maxterms (Product of Sum) : f (A, B, C ) = Π (M0 , M1 , M2 , M3 , M4 )
• Minterms (Sum of Product): f (x, y , z) = (m5 , m6 , m7 )
P

26 / 33
Logic Circuit Design

Examples
Assume a room has three doors and a switch by each door controls a single light in the room.
• Assume the light is off if all switches are open
• Closing any switch turns the light on. Closing another switch will have to turn the light
off.
• Light is on if any one switch is closed and off if two (or no) switches are closed.
• Light is on if all three switches are closed

27 / 33
Exercises

Exercises
• Write the minimal function of the following terms:
• f (x, y , z) = Π (M1 , M2 , M3 , M4 )
• f (x, y , z) = (m0 , m1 , m2 , m3 ).
P
• f (x, y , z) = (m0 , m1 , m5 , m6 , m7 )
P

• Express the following function in a Minterms (SOP):


• x +y ∗z
• x ∗y +x ∗z

28 / 33
NAND and NOR Logic Networks
• AND, OR, and NOT gates used in the synthesis of logic circuits.
• There are other basic logic functions such as NAND and NOR function. These functions
are attractive because they are implemented with simpler electronic circuits than the AND
and OR functions.

29 / 33
NAND and NOR Logic Networks
• Taking the function f (x1 , x2 , x3 , x4 , x5 ) = x1 ∗ x2 + x3 ∗ x4 ∗ x5 as an example to convert it
to NAND and NOR gates only.

30 / 33
Multiplexer circuit
• In computer systems it is often necessary to choose data from exactly one of the input
signals.
Examples
Design a circuit that has an output (f) that is exactly the same as one of two data inputs (x,y)
based on the value of a control input (s).
• If s=0 then f=x , If s=1 then f=y.
• The function f is really a function of three variables (s,x,y).

31 / 33
Timing Diagram
• Shows the logic values of signals in a circuit over the time period.
• Below is an example of how to read the timing diagram.

32 / 33
Assignment 1

Assignment questions
Book Problems (Chapter 2) : 2.1, 2.2, 2.3, 2.6, 2.10, 2.22, 2.24, 2.29, 2.31, and 2.41.

33 / 33

You might also like