You are on page 1of 69

Chapter 1

Introduction to Digital Electronics


and Logic Gates
2 Digital computer
It is a digital system that performs various computational
tasks.
the information in computer is represented by variables that
takes a limited number of discrete values.
It functions more reliable if only two digits used, because
of physical restriction of components and human logic
tends to be binary (true or false, yes or no statements).
It uses binary numbering system, which has two digits: 1
and 0. it’s called bits.
3 …
The hardware of a computer is usually divided in to three major
parts.

1. CPU(central processing unit) which contains Arithmetic and Logic


Unit, Registers and Control Circuit Unit.
2. RAM (Random Access Memory) used to store instructions & data.
3. I/O (input output devices) which contains electronic circuits which
controls in and out of information (instruction and data).
4 …
Top Level Computer Structure
5 Binary Digits
In digital circuits, two different voltage levels are used to
represent the two bits.
Generally, 1 is represented by the higher voltage, which we will
refer to as a HIGH, and a 0 is represented by the lower voltage
level, which we will refer to as a LOW.
Groups of bits (combinations of 1’s and 0’s) called codes,
They are used to represent numbers, letters, symbols, instructions,
and anything else required in a given application.
6 Logic Levels
 The voltages used to represent 1 and 0 are called logic
levels.
 The variable VH(max) represents the maximum HIGH
voltage value, and VH(min) represents the minimum
HIGH voltage value.
 The maximum LOW voltage value is represented by
VL(max), and the minimum LOW voltage value is
represented by VL(min)'
 The voltage values between VL(max) and VH(min) are
unacceptable for proper operation.
7 Number Systems and Codes
A number system is a set of symbols used to express quantities as
the base.
Used for counting, determining order, comparing amounts,
performing calculations, and representing value.
The most frequently used numbering systems are:
 Decimal
 Binary
 Octal
Hexadecimal
BCD
8 …

The numeric system we use daily is the decimal system.


But this system is not convenient for machines since the
information is handled codified in the shape of on or off bits.
This way of codifying takes us to the necessity of knowing the
positional calculation which will allow us to express a number in
any base where we need it.
A base of a number system or radix defines the range of values
that a digit may have.
9 …
In the binary system or base 2, there can be only two values for
each digit of a number, either "0" or "1".
In the octal system or base 8, there can be eight choices for each
digit of a number: "0", "1", "2", "3", "4", "5", "6", "7".
In the decimal system or base 10, there are ten different values
for each digit of a number: "0", "1", "2", "3", "4", "5", "6", "7",
"8", "9".
In the hexadecimal system, we allow 16 values for each digit of
a number: "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A",
"B", "C", "D", "E", and "F".
Where “A” stands for 10, “B” for 11 and so on.
10 Decimal Numbers
 The decimal system is composed of 10 numerals or symbols.
 These 10 symbols are 0, 1, 2,3,…9; using these symbols as digits of a
number, we can express any quantity.
 The decimal system, also called the base 10 system because it has 10
digits.
 The position of each digit in a decimal number indicates the
magnitude of the quantity represented and can be assigned a weight.
 The weights for whole numbers are positive powers of ten that
increase from right to left, beginning with 100.
 For fractional numbers, the weights are negative powers of ten that
decrease from left to right beginning with 10-1.

Example:
11
Binary Numbers
 The binary number system has two digits (bits). The two binary digits
(bits) are 1 and 0.
 The position of 1 or 0 in a binary number indicates its weight. The
weights in a binary number are based on powers of two.
 The right-most bit is the LSB (least significant bit) in a binary whole
number and has a weight of 2°= 1.
 The weights increase from right to left by a power of two for each bit.
The left-most bit is the MSB (most significant bit). The left-most bit is
the MSB in a binary fractional number and has a weight of 2-1= 0.5.
 The fractional weights decrease from left to right by a negative power
of two for each bit.

Example:
12
Hexadecimal numbers
 Hexadecimal numbers are used extensively in microprocessor work.
 To begin with, they are much shorter than binary numbers.
 This makes them easy to write and remember. Furthermore, you can
mentally convert them to binary whenever necessary.
 The hexadecimal number system has a base of 16.
 Although any 16 digits may be used, everyone uses 0 to 9 and A to F
In other words, after reaching 9 in the hexadecimal system, it
continues as follows:
A,B,C,D,E,F
 In the hexadecimal system, we allow 16 values for each digit of a number:

"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", and "F".
13

 Hexadecimal digits
14 Conversion among radices
 As an example, let's start with a decimal number 1234 and convert
it to decimal notation.
 To extract the last digit, you move the decimal point left by one
digit, which means that you divide the given number by its base 10.
1234/10 = 123 + 4/10
 The remainder of 4 is the last digit.
 To extract the next last digit, you again move the decimal point left
by one digit and see what drops out.
123/10 = 12 + 3/10
 The remainder of 3 is the next last digit.
 Repeat this process until there is nothing left.
15 …
In summary, you do the following:

LSB

MSB

It is called successive division technique.


16 Decimal to Binary notation.
Let's express a decimal number 1341 in binary notation.

 Always ordered from MSB to LSB


17 …
Let's express the same decimal number 1341 in octal
notation.
18 …
Now let's express the hexadecimal equivalent of the decimal
number 3315.3 in hexadecimal notation.
Binary to Decimal Conversion
19
 The decimal value of any binary number can be found by adding
the weights of all bits that are 1 and discarding the weights of all
bits that are 0.
 Convert the binary whole number 1101101 to decimal.

 Convert the fractional binary number 0.1011 to decimal.


20 Hexadecimal-to-Binary Conversion
To convert a hexadecimal number to a binary number, convert
each hexadecimal digit to its 4-bit equivalent using the code
given in Table.
example, let’s C5E2 converts like this:
21 Binary-to-Hexadecimal Conversion
To convert in the opposite direction, from binary to
hexadecimal, again use the code from Table.
examples. Binary 1000 1100 converts as follows:
22 Digital Logic Gates
 The logic gate are the fundamental building blocks from which all
other logic circuits and digital systems are constructed.
 Digital (logic) circuits operate in the binary mode where each input
and output voltage is either a 0 or a 1
 This characteristic of logic circuits allows us to use Boolean
algebra as a tool for the analysis and design of digital systems.
 Boolean algebra is a relatively simple mathematical tool that
allows us to describe the relationship between a logic circuit’s
output(s) and its Inputs as an algebraic equation (a Boolean
expression).
 A Boolean variable is a quantity that may, be equal to either 0 or 1.
23 …
 Thus, Boolean 0 and 1 do not present actual numbers but instead
represent the state of a voltage variable, or what is called its logic
level.
 Truth Table:-A truth table lists all possible combinations of input
binary variables and the corresponding outputs of a logic system.
 The number of possible input combinations will equal to 2n for an
n-input truth table.
 There are three basic logic gates, namely the OR gate, the AND
gate and the NOT (complement) gate.
 Other logic gates that are derived from these basic gates are the
NAND gate, the NOR gate, the XOR gate and the XNOR gate.
24 …
1. The Inverter (NOT Gate)
 A NOT gate is a one-input, one-output logic circuit whose output is always the
complement of the input.
 The inverter changes one logic level to the opposite level. In terms of bits, it
changes a 1 to a 0 and a 0 to a 1.
2. The OR Gate
 An OR gate is a logic circuit with two or more inputs and one output.
 The OR gate operates in such a way that its output is HIGH (logic’ 1) if either input
A or B or both are at a logic 1 level, otherwise the output will be LOW
3. The AND Gate
 An AND gate is a logic circuit having two or more inputs and one output.
 The AND gate is a circuit that operates in such a way that its output is HIGH only
when all its inputs are HIGH. For all other cases the AND gate output is LOW.
25 …
 Summery of graphical symbol, allegorical function and truth table :
26 …
4. The NAND Gate
 The NAND gate is a popular logic element because it can be used as a universal gate: that
is, NAND gates can be used in combination to perform the AND, OR, and inverter
operations.
 The term NAND is a contraction of NOT-AND and implies an AND function with a
complemented (inverted) output.
 A NAND gate produces a LOW output only when all the inputs are HIGH. When any of
the inputs is LOW, the output will be HIGH.
5. The NOR Gate
 The NOR gate, like the NAND gate, is a useful logic element because it can also be used
as a universal gate;
 The term NOR is a contraction of NOT-OR and implies an OR function with an inverted
(complemented) output.
 A NOR gate produces a LOW output when any of its inputs is HIGH.
 Only when all of its inputs are LOW is the output HIGH.
27 …
 Summery of graphical symbol, allegorical function and truth table :
28 …
6. XOR Gate
 The output of an exclusive-OR gate is HIGH only when the two inputs
are at opposite logic levels.
7. XNOR Gate
 When the two input logic levels are opposite, the output of the
exclusive-NOR gate is LOW and when the two input logic levels are
similar the output of the exclusive-NOR gate is HIGH
 The bubble on the output of the XNOR symbol indicates that its
output is opposite of the XOR gate.
29 Boolean algebra
One of the primary requirements when dealing with digital
circuits is to find ways to make them as simple as possible.
This constantly requires that complex logical expressions be
reduced to simpler expressions that nevertheless produce the
same results under all possible conditions.
The simpler expression can then be implemented with a
smaller, simpler circuit, which in turn saves the price of the
unnecessary gates, reduces the number of gates needed, and
reduces the power and the amount of space required by
those gates.
30 …
One of the tools used to reduce logical expressions is the
mathematics of logical expressions, known as Boolean
Algebra.
It is an algebra that deals with binary variables and logic
operations.
The variables are designated by letters A, B, x and y.
The basic logic operations are AND, OR and NOT.
The Boolean function can be expressed algebraically with
binary variables, logic operation symbols, parentheses and
equal sign.
31 Boolean Operations & Expressions
 Variable
A symbol that represents a logical quantity
Usually italic uppercase (A, B, C, D)
A single variable can have a 1 or 0 value
 Complement
The inverse of a variable
Indicated by an over bar (Ā)or prime (A’)
If A = 1 , then Ā = 0
 Literal
both variable and its complement in a term.
Ā+ B + C = 3 literals
32 …
Boolean algebra is a logical algebra in which symbols are
used to represent logic levels. Any symbol can be used,
however, letters of the alphabet are generally used.
Since the logic levels are generally associated with the
symbols 1 and 0, whatever letters are used as variables that
can take the values of 1 or 0.
Boolean algebra has only two mathematical operations,
addition and multiplication. These operations are associated
with the OR gate and the AND gate, respectively.
33 Logical Addition:
When the “+” (the logical addition) symbol is placed
between two variables, say X and Y, since both X and Y can
take only the role 0 and 1, we can define the + Symbol by
listing, all possible combinations for X and Y and the
resulting value of X + Y.
The possible input and out put combinations may arranged
as follows:
34 …
This table represents a standard binary addition, except for
the last entry. When both' X and Y represents 1, the value of
X + Y is 1.
The symbol + therefore does not has the “Normal” meaning,
but is a Logical addition symbol. The plus symbol (+) read
as "OR", therefore X +Y is read as X or Y.
This concept may be extended to any number of variables
for example A + B + C +D = E Even if A, B, C and D all
had the values 1, the sum of the values i.e. is 1.
35 Logical Multiplication:
We can define the "." (logical multiplication) symbol or
AND operator by listing all possible combinations for
(input) variables X and Y and the resulting (output) value of
X.Y as,

Three of the basic laws of Boolean algebra are the same as


in ordinary algebra; the commutative law, the associative
law and the distributive law.
36 …
 Note that while either '+' and ‘.’ s can be used freely. The two cannot
be mixed without ambiguity in the absence of further rules.
 For example does A . B + C means (A . B) + C or A . (B+ C)? These
two form different values for A = O, B = 1 and C = 1, because we
have
(A . B) + C = (0.1) + 1 = 1
and A . (B + C) = 0 . (1 + 1) = 0

 which are different. The rule which is used is that ‘.’ is always
performed before '+'. Thus X . Y + Z is (X.Y) + Z.
37 Laws & Rules of Boolean Algebra
Commutative Laws
38 …
Associative Laws
39 …
Distributive Law
40 Basic identities of Boolean algebra
41 Standard forms of Boolean expressions

All Boolean expressions, regardless of their form, can be


converted into either of two standard forms:
The sum-of-products (SOP) form

The product-of-sums (POS) form

Standardization makes the evaluation, simplification, and


implementation of Boolean expressions much more
systematic and easier.
42 The sum of products (SOP) Form
An SOP expression is when two or more product terms are
summed by Boolean addition.

In an SOP form, a single overbar cannot extend over more


than one variable; however, more than one variable in a
term can have an overbar:
43 …
Implementation of an SOP
X=AB+BCD+AC
 AND/OR implementation  NAND/NAND implementation
44 …
Any logic expression can be changed into SOP form by
applying Boolean algebra techniques.
ex:
45 The standard SOP form
A standard SOP expression is one in which all the variables
in the domain appear in each product term in the expression.
Example:

Standard SOP expressions are important in constructing


truth tables.
46 Converting Product Terms to Standard SOP
Step 1:Multiply each nonstandard product term by a term
made up of the sum of a missing variable and its
complement. This results in two product terms.
As you know, you can multiply anything by 1 without changing
its value.
Step 2:Repeat step 1 until all resulting product term
contains all variables in the domain in either complemented
or uncomplemented form. In converting a product term to
standard form, the number of product terms is doubled for
each missing variable.
47 …
Convert the following Boolean expression into standard
SOP form:
48 Binary representation of a standard product term

A standard product term is equal to 1 for only one


combination of variable values.

And this term is 0 for all other combinations of values for


the variables.
49 The product of sums (POS) Form
When two or more sum terms are multiplied, the result
expression is a product-of-sums (POS):
Example:

In a POS form, a single overbar cannot extend over more


than one variable; however, more than one variable in a
term can have an overbar:
50 …
 Implementation of a POS
X=(A+B)(B+C+D)(A+C)
 OR/AND implementation

 A standard POS expression is one in which all the variables in the


domain appear in each sum term in the expression.
51 The standard POS form
A standard POS expression is one in which all the variables
in the domain appear in each sum term in the expression.

Standard SOP expressions are important in constructing


truth tables.
52 Converting a sum term to standard POS
Step 1:Add to each nonstandard product term a term made
up of the product of the missing variable and its
complement. This results in two sum terms.
As you know, you can add 0 to anything without changing its
value.
Step 2:Apply rule 12 A+BC=(A+B)(A+C).
Step 3:Repeat step 1 until all resulting sum terms contain all
variable in the domain in either complemented or un
complemented form.
53 …
Convert the following Boolean expression into standard
POS form:
54 Binary Representation of a standard Sum Term

A standard sum term is equal to 0 for only one combination


of variable values.

And this term is 1 for all other combinations of values for


the variables.
55 Converting standard SOP to standard POS
The Facts:
 The binary values of the product terms in a given standard SOP
expression are not present in the equivalent standard POS expression.
 The binary values that are not represented in the SOP expression are
present in the equivalent POS expression.
 Step 1:Evaluate each product term in the SOP expression. That is,
determine the binary numbers that represent the product terms.
 Step 2:Determine all of the binary numbers not included in the
evaluation in Step 1.
 Step 3:Write the equivalent sum term for each binary number from
Step 2 and express in POS form.
56 …
Convert the SOP expression to an equivalent POS
expression:

The evaluation is as follows:

There are 8 possible combinations. The SOP expression


contains five of these, so the POS must contain the other 3
which are: 001, 100, and 110.
57 Boolean expressions & truth tables
All standard Boolean expression can be easily converted
into truth table format using binary values for each term in
the expression.
Also, standard SOP or POS expression can be determined
from the truth table.
Recall the fact:
An SOP expression is equal to 1 only if at least one of the
product term is equal to 1.
58 …
Constructing a truth table:
Step 1:List all possible combinations of binary values of the
variables in the expression.
Step 2:Convert the SOP expression to standard form if it is
not already.
Step 3:Place a 1 in the output column (X) for each binary
value that makes the standard SO Pexpression a 1 and place
0 for all the remaining binary values.
59 …
Develop a truth table for the
standard SOP expression.
60 Converting POS expressions to truth table format

 Recall the fact:


A POS expression is equal to 0 only if at least one of the product
term is equal to 0.
 Constructing a truth table:
 Step 1:List all possible combinations of binary values of the
variables in the expression.
 Step 2:Convert the POS expression to standard form if it is not
already.
 Step 3:Place a 0 in the output column (X) for each binary value
that makes the standard POS expression a 0 and place 1 for all
the remaining binary values.
61 …
Develop a truth table for
the standard SOP
expression
62 Determining standard expression from a truth table
To determine the standard SOP expression represented by a
truth table.
Instructions:
Step 1:List the binary values of the input variables for
which the output is 1.
Step 2:Convert each binary value to the corresponding
product term by replacing:
each 1 with the corresponding variable, and
each 0 with the corresponding variable complement.
63 …
To determine the standard POS expression represented by a truth table.
Instructions:
Step 1:List the binary values of the input variables for which the
output is 0.
Step 2:Convert each binary value to the corresponding product term
by replacing:
each 1 with the corresponding variable complement, and
each 0 with the corresponding variable.
64 Determining standard expression from a truth table (example)
65 Simplification using Boolean algebra
A simplified Boolean expression uses the fewest gates possible to
implement a given expression.

66

AB+A(B+C)+B(B+C)
(distributive law)
AB+AB+AC+BB+BC
(rule 7; BB=B)
AB+AB+AC+B+BC
(rule 5; AB+AB=AB)
AB+AC+B+BC
(rule 10; B+BC=B)
AB+AC+B
(rule 10; AB+B=B)
B+AC
67 Universality of logic gates
 Any logic expression can be implemented using only NAND gates or
only NOR gates and no other type of gate.
 NAND gates alone in the proper combination, can be used to perform
each of the basic Boolean operations OR, AND, and INVERT.
68 …
Using NOR gate Similarly, it can be shown that NOR gates
can be arranged to implement any of the Boolean operations.
69 Some Common Applications of Logic Gates
 OR Gate: the OR gate is used to detect either temperature or pressure
exceeding a preset threshold value and produce the necessary
command signal for the system.

You might also like