Modul Outcome 1 Part 2
-
Upload
noor-zilawati-sabtu -
Category
Documents
-
view
216 -
download
0
Transcript of Modul Outcome 1 Part 2
-
8/7/2019 Modul Outcome 1 Part 2
1/14
Computer
System
(CSC 1033)
Outcome 1:
Evaluate data
representation
and manipulation
within a
computer.
Criteria 1.5
-
8/7/2019 Modul Outcome 1 Part 2
2/14
Computer Systems (CSC 1033)
Outcome 1: Evaluate data representation and manipulation within a computer
Page 2
TABLE OF CONTENTNO. TOPICS PAGE
1. 1.5 Specify different types of logic gates 3
2. 1.6 Apply different ways to perform arithmetical operations of logic gates. 7
Prepared by:
Pn. Noor zilawati Binti Sabtu
Science & Quantitative Department, KPM Beranang
Updated - 17 JAN 2010
-
8/7/2019 Modul Outcome 1 Part 2
3/14
Computer Systems (CSC 1033)
Outcome 1: Evaluate data representation and manipulation within a computer
Page 3
1.5 Specify different types of logic gates.Definition of Gates
Keep in mind that computers work on an electrical flow where a high voltage is considered a 1
and a low voltage is considered a 0. Using these highs and lows, data are represented.
Electronic circuits must be designed to manipulate these positive and negative pulses into
meaningful logic.
Logic gates are the building blocks of digital circuits. Combinations of logic gates form circuits
designed with specific tasks in mind. For example, logic gates are combined to form circuits to
add binary numbers (adders), set and reset bits of memory (flip flops), multiplex multiple
inputs, etc.
Definition of Truth Table
A truth table is a table that describes the behavior of a logic gate. It lists the value of the output
for every possible combination of the inputs and can be used to simplify the number of logic
gates and level of nesting in an electronic circuit. In general the truth table does not lead to an
efficient implementation; a minimization procedure, using Karnaugh maps, the Quine
McCluskey algorithm or an heuristic algorithm is required for reducing the circuit complexity.
-
8/7/2019 Modul Outcome 1 Part 2
4/14
-
8/7/2019 Modul Outcome 1 Part 2
5/14
Computer Systems (CSC 1033)
Outcome 1: Evaluate data representation and manipulation within a computer
Page 5
OR Gate (X , Y = X + Y)
The OR gate has two input lines and one output line. Basically, if either or both of the inputs
are a 1, the resulting output value is a 1. Note in the truth table, the only time the output is 0 is
when both inputs are 0.
OR Gate Truth Table
Input
Output
A B
0 0 0
0 1 1
1 0 1
1 1 1
EXCLUSIVE OR, XOR Gate (X , Y = X + Y)
The X in the XOR gate stands for "exclusive." This means that the output from this gate will be
a 1 ONLY when one or the other of the inputs is a 1. Notice in the truth table that the output is
a 0 if both the inputs are 1 or 0. In other words, this is an either-or gate.
-
8/7/2019 Modul Outcome 1 Part 2
6/14
Computer Systems (CSC 1033)
Outcome 1: Evaluate data representation and manipulation within a computer
Page 6
XOR Gate Truth Table
Input
Output
A B
0 0 0
0 1 1
1 0 1
1 1 0
NOT - AND, NAND Gate (X , Y = [X . Y])
The Logic NAND Gate is a combination of the digital logic AND gate with that of an inverter or
NOT gate connected together in series. The NAND (Not - AND) gate has an output that is
normally at logic level "1" and only goes "LOW" to logic level "0" when ALL of its inputs are at
logic level "1". The Logic NAND Gate is the reverse or "Complementary" form of the AND gatewe have seen previously.
The logic or Boolean expression given for a logic NAND gate is that for Logical Addition, which is
the opposite to the AND gate, and which it performs on the complements of the inputs. The
Boolean expression for a logic NAND gate is denoted by a single dot or full stop symbol, (.) with
a line or Overline, ( ) over the expression to signify the NOT or logical negation of the NAND
gate giving us the Boolean expression of: A.B = Q. Then we can define the operation of a 2-
input logic NAND gate as being: "If either A or B are NOT true, then Q is true"
A B Q = [A.B]
0 0 1
0 1 1
1 0 1
1 1 0
-
8/7/2019 Modul Outcome 1 Part 2
7/14
Computer Systems (CSC 1033)
Outcome 1: Evaluate data representation and manipulation within a computer
Page 7
NOT - OR, NOR Gate (X , Y = [X + Y])
The Logic NOR Gate or Inclusive-NOR gate is a combination of the digital logic OR gate with that of an
inverter or NOT gate connected together in series. The NOR (Not - OR) gate has an output that is
normally at logic level "1" and only goes "LOW" to logic level "0" when ANY of its inputs are at logic level
"1". The Logic NOR Gate is the reverse or "Complementary" form of the OR gate we have seen
previously.
The logic or Boolean expression given for a logic NOR gate is that for Logical Multiplication
which it performs on the complements of the inputs. The Boolean expression for a logic NOR
gate is denoted by a plus sign, (+) with a line or Overline, ( ) over the expression to signify the
NOT or logical negation of the NOR gate giving us the Boolean expression of: A+B = Q. Then wecan define the operation of a 2-input logic NOR gate as being: "If both A and B are NOT true,
then Q is true"
A B Q = [A+B]
0 0 1
0 1 01 0 0
1 1 0
-
8/7/2019 Modul Outcome 1 Part 2
8/14
Computer Systems (CSC 1033)
Outcome 1: Evaluate data representation and manipulation within a computer
Page 8
1.6 Apply different ways to perform arithmetical operations of logic gates.Basic Rules of BOOLEAN ALGEBRA
The basic rules for simplifying and combining logic gates are called Boolean algebra in honour of
George Boole (1815 1864) who was a self-educated English mathematician who developed
many of the key ideas. The following set of exercises will allow you to rediscover the basic rules:
Example 1:
Consider the AND gate where one of the inputs is 1. By using the Truth table, investigate
the possible outputs and hence simplify the expression x 1.
Solution :
From the truth table for AND, we see that if x is 1 then 1 1 = 1, while if x is 0
then 0 1 = 0. This can be summarized in the rule that x 1 = x,
Example 2:
Consider the AND gate where one of the inputs is 0. By using the truth table, investigate thepossible outputs and hence simplify the expression x 0.
Solution:
From the truth table for AND, we see that if x is 1 then 1 0 = 0, while if x is 0 then 0 0 = 0. This
can be summarized in the rule that x 0 = 0
-
8/7/2019 Modul Outcome 1 Part 2
9/14
Computer Systems (CSC 1033)
Outcome 1: Evaluate data representation and manipulation within a computer
Page 9
Rules of BOOLEAN ALGEBRA
(1a) x y = y x
(1b) x + y = y + x
(2a) x (y z) = (x y) z
(2b) x + (y + z) = (x + y) + z
(3a) x (y + z) = (x y) + (x z)
(3b) x + (y z) = (x + y) (x + z)
(4a) x x = x
(4b) x + x = x
(5a) x (x + y) = x
(5b) x + (x y) = x
(6a) x x0 = 0(6b) x + x0 = 1
(7) (x0)0 = x
(8a) (x y)0 = x0 + y0
(8b) (x + y)0 = x0 y0
These rules are a direct translation into the notation of logic gates of the rules derived in the
package Truth Tables and Boolean Algebra. We have seen that they can all be checked by
investigating the corresponding truth tables. Alternatively, some of these rules can be derived
from simpler identities derived in this package.
Example 3:Show how rule (5a) can be derived from the basic identities derived earlier.
Solutionx (x + y) = x x + x y using (3a)
= x + x y ..using (4a)
= x (1 + y) ..using (3a)= x 1 .using Example 1
= x .as required
The examples above have all involved at most two inputs. However, logic gates can be puttogether to join an arbitrary number of inputs. The Boolean algebra rules of the table are
essential to understand when these circuits are equivalent and how they may be simplified.
-
8/7/2019 Modul Outcome 1 Part 2
10/14
Computer Systems (CSC 1033)
Outcome 1: Evaluate data representation and manipulation within a computer
Page 10
Example 4:
Let us consider the circuits which combine three inputs via AND gates. Two different ways of
combining them are
However, rule (2a) states that these gates are equivalent. The order of taking AND gates is not
important. This is sometimes drawn as a three (or more!) input AND gate but really this just
means repeated use of AND gates as shown below.
Implementing Circuits from Boolean Expression
If the operation of a circuit is defined by a Boolean expression, a logic-circuit diagram can he
implemented directly from that expression. Suppose that we wanted to construct a circuit
whose output is y = AC+BC' + A'BC.
This Boolean expression contains three terms (AC, BC', A'BC), which are ORed together. This
tells us that a three-input OR gate is required with inputs that are equal to AC, BC', and A'BC,
respectively.
Each OR-gate input is an AND product term, which means that an AND gate with appropriate
inputs can be used to generate each of these terms. Note the use of INVERTERs to produce the
A' and C' terms required in the expression.
-
8/7/2019 Modul Outcome 1 Part 2
11/14
Computer Systems (CSC 1033)
Outcome 1: Evaluate data representation and manipulation within a computer
Page 11
Evaluating Logic Circuits Output
Once the Boolean expression for a circuit output has been obtained, the output logic level can
be determined for any set of input levels. These are two examples of the evaluating logic circuit
output:
Example 5:
Let A=0, B=1, C=1, D=1; X?
Solution:
X = A'BC (A+D)'
= 0'*1*1* (0+1)'
= 1 *1*1* (1)'
= 1 *1*1* 0
X = 0
Example 6:
Let A=0, B=0, C=1, D=1; X?
Solution:
X = [D+ ((A+B)C)'] * E
= [1 + ((0+0)1 )'] * 1
= 1 + (0*1)'] * 1
= [1+ 0'] *1
= [1+ 1] * 1
X = 1
In general, the following rules must always be followed when evaluating a Boolean expression:
1. First, perform all inversions of single terms; that is, 0 = 1 or 1 = 0.
2. Then perform all operations within parentheses.
3. Perform an AND operation before an OR operation unless parentheses indicate
otherwise.
4. If an expression has a bar over it, perform the operations of the expression first and
then invert the result.
-
8/7/2019 Modul Outcome 1 Part 2
12/14
Computer Systems (CSC 1033)
Outcome 1: Evaluate data representation and manipulation within a computer
Page 12
Describing Logic Circuits Algebraically
Any logic circuit, no matter how complex, may be completely described using the Boolean
operations, because the OR gate, AND gate, and NOT circuit are the basic building blocks of
digital systems. This is an example of the circuit using Boolean expression:
Whenever an INVERTER is present in a logic-circuit diagram, its output expression is simply
equal to the input expression with a prime (') over it.
-
8/7/2019 Modul Outcome 1 Part 2
13/14
Computer Systems (CSC 1033)
Outcome 1: Evaluate data representation and manipulation within a computer
Page 13
DeMorgans Theorem
DeMorgan's theorems are extremely useful in simplifying expressions in which a product or
sum of variables is inverted. The two theorems are:
(16). (x+y)' = x' * yTheorem (16) says that when the OR sum of two variables is inverted, this is the same as
inverting each variable individually and then ANDing these inverted variables.
(17). (x*y)' = x' + yTheorem (17) says that when the AND product of two variables is inverted, this is the same as
inverting each variable individually and then ORing them.
Three Variables DeMorgan's Theorem
(18).. (x+y+z)' = x' * y' * z'
(19)(xyz)' = x' + y' + z'
For: (16)..(x+y)' = x' * y'
-
8/7/2019 Modul Outcome 1 Part 2
14/14
Computer Systems (CSC 1033)
Outcome 1: Evaluate data representation and manipulation within a computer
Page 14
For: (17)..(x*y)' = x' + y'