Beruflich Dokumente
Kultur Dokumente
Search C251/I201
http://highered.mcgraw-hill.com/sites/0072880082/student_view0/index.html - Index to the Rosen text Web site learning resources. http://highered.mcgraw-hill.com/sites/0072880082/student_view0/chapter11/extra_examples.html - Extra examples with solutions. 11.1 Boolean Functions Definition Boolean algebra defines operations for the set {0, 1} Commonly used Boolean operations.
Not 1 0 0 1 0 0 0 1 1 0 1 1
And 0 0 0 1 0 0 0 1 1 0 1 1
+ Or 0 1 1 1 0 0 0 1 1 0 1 1
Xor 0 1 1 0 0 0 0 1 1 0 1 1
Nor 1 0 0 0 0 0 0 1 1 0 1 1
Nand 1 1 1 0
0 = 1 1 = 0
1 .1 = 1 Examples (1 . 0) + 0 = 0 1 Nand 0 = 1
1 + 1 = 1
(1 . 0) + 1 = 1 1 Nor 0 = 0
1 Xor (0 Xor 0) = 1
(0 Nor 1) Nor 0 = 1
(0 Nor 1) Nor 1 = ?
Boolean Expressions and Boolean Functions Definitions Boolean variable only assumes values from the set {0, 1} Bn = {(x1 , x 2 , ..., x n ) | x i ?{0, 1} for 1 = i = n} is the set of all n-tuples of 0s and 1s Function from Bn to {0, 1} is a Boolean function of degree n. Example B2 = {(0, 0), (0, 1), (1, 0), (1, 1)} B2 to {0, 1} Function from B2 to {0, 1} F(x, y) = x y Table 1 lists where F(x, y) is 1 and 0.
1 1
0 or 1
Each outcome can be assigned a 0 or 1 Example 4 binary variables have 2 4 = 16 possible assignments a b c d Assignment 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 Example Below is every possible of 16 functions of 2 Boolean values. 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1
Identities of Boolean Algebra Notice that many Boolean identities have logical analogues. Example x + y = y + x pv q= qv p Boolean + commutes and so does (logical) v
Example Verification of Boolean identities are similar to truth table proofs. x(y + z) = xy + xz
Duality Definition Dual of a Boolean expression interchanges: sums and products 0s and 1s
(x .1) + (y+z) is (x+0)(yz) Example Construct an identity from the absorption law x(x+y) = x by taking duals. Duals of both sides x(x+y) = x is x+(xy) = x Example Construct an identity from the commutative law x + y = y + x by taking duals. Duals of both sides x + y = y + x is xy = yx
Definition Sum of products for Boolean function is a Boolean expression constructed by: Where each function result is a 1 form product of all variables sum each product
Example Find Boolean expressions that represent F and G of Table 1. F(x,y,z) = xyz G(x,y,z) = xyz + xyz The sum of one product. The sum of two products.
Definition 1 Literal is a Boolean variable or its complement. Minterm of the Boolean variables x 1 , x 2 , ..., x n is a Boolean product y 1 , y 2 , ..., y n where y i=xi or y i=x i
Example Minterm that is 1 for x 1 = 0, x 2 = 0, x 3 = 1, x 4 = 1 x1 x2 x3 x4 = 1 Example x 0 0 0 0 1 1 1 1 y 0 0 1 1 0 0 1 1 z 0 1 0 1 0 1 0 1 F 0 0 0 1 xyz 0 0 1 xyz 0 G 1 x y z 0 0 0 0 0 0 1 xyz H 0 0 0 1 0 0 1 1 G(x, y, z) = x y z + xyz Sum of Products F(x, y, z) = xyz + xyz
Question 11.5 - What is H(x,y,z) as sum of minterms (products)? Question 11.6 - Give the function definition table for: I(x, y, z) = x y z + x y z + x y z
F(x, y, z)
= (x+y)z = xz+yz Distributive Law Identity and Unit property Law Distributive Law Idempotent Law
= xz(y+y) +yz(x+x)
= xyz+x y z + xyz+xyz
= xy z + xyz + xyz
Example Find the sum-of-products for: F(x, y, z) = (x+y)z 1 in table wherever (x+y)z = 1
http://homepages.ius.edu/RWISMAN/C251/html/chapter11.htm[1/30/2013 10:52:36 PM]
x 0 0 0 0 1 1 1 1
y 0 0 1 1 0 0 1 1
z 0 1 0 1 0 1 0 1
x+y 0 0 1 1 1 1 1 1
z 1 0 1 0 1 0 1 0
(x+y)z 0 0 1 0 1 0 1 0
minterms
x y z
x y z
x y z
Functional Completeness Definition Functionally complete (universal) operators are the set of sum, product and complement, can represent every Boolean function. Nand and Nor operations are also functionally complete alone.
Means circuits of And, Or and Not gates can be replaced with Nor or Nand gates exclusively. Example ? Nor 0 0 0 1 1 0 1 1 1 0 0 0 0 0 0 1 1 0 1 1 | Nand 1 1 1 0
x+y = x ? y xy = x | y x = x | x x = x ?x Example
x y = x y = x + y = x ? y )= (x ? x)?(y ? y) x y x y (x ? x) (y ? y) (x ? x) ? (y ? y) 0 0 0 1 1 0 1 1 0 0 0 1 1 1 0 0 1 0 1 0 0 0 0 1
Result is often more operations but can build logic on a chip from a single operation device type, usually more efficient use of chip area.
Question 11.7.2
x y = x y = | Nand 0 0 0 1 1 0 1 1 1 1 1 0
x y x y x | y x | y (x | y) | (x | y) 0 0 0 1 1 0 1 1
11.3 Logic Gates Logic gates implement Boolean operations. All computer logic can be performed using these three logic gates.
x y . And 0 0 0 1 0 0
x y + Or 0 0 0 1 0 1
x 1 0
Not 0 1
1 0 1 1
0 1
1 0 1 1
1 1
0 = 1 1 = 0
1 .1 = 1
1 + 1 = 1
Combinations of Gates The three logic gates can be combined to implement complex logic operations. Examples (a) Function table x 0 0 1 y 0 1 0 x 1 1 0 x+y 0 1 1 (x+y)x 0 1 0 Sum-of-products
x y
Output is always 0.
Question 11.8 a. Add the logic produced at the output of each gate.
Question 11.9 a. Add the logic produced at the output of each gate.
Question 11.10 a. Using the devices below, give (draw) the circuit for: (x+y)(x y) b. Using the devices below, give (draw) the circuit for: (xyz)+(x y)
Example of Circuits Critical processes (e.g. Space Shuttle control) may use majority voting to settle conflicting evidence, two out of three voting in favor win. A circuit that requires at least two to agree (e.g. xy, x and y both 1) the evidence is true: x y z xy xz yz xy+xz+yz
http://homepages.ius.edu/RWISMAN/C251/html/chapter11.htm[1/30/2013 10:52:36 PM]
0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 1
0 0 0 0 0 1 0 1
0 0 0 1 0 0 0 1
0 0 0 1 0 1 1 1
Example A room with 3 doors normally has three light switches, flipping any will change lights from ON to OFF, or OFF to ON. Switches all 0, light is OFF, 0: x y z
Sum-of-Products x y z + x y z + x y z + x y z
http://homepages.ius.edu/RWISMAN/C251/html/chapter11.htm[1/30/2013 10:52:36 PM]
Adders Binary numbers are represented in a positional system similar to decimal numbers. 56310 = 5*102 + 6*101 + 3*100 = 56310 10 2 10 1 10 0 5 6 3
23 22 21 20 1 1 0 1
Adding decimal numbers carries out 10 10, 10010, 100010, etc. from one column to the next. Adding binary numbers carries out 10 2 , 1002 , 10002 , etc. (2, 4, 8, etc.) from one column to the next.
carry
sum
carry
sum
c.
0 1 +1 1
y1 y0
+x1
x0
____ 1 0 0
______
c s1 s0
1 1 +1 0 ____
______
c s1 s0
b. Give the carry minterms, c c. There are 16 (2 4 ) rows for a 2-bit adder. How many rows for a parallel 64-bit adder in your PC?
Example Half-adder (http://simcironline.appspot.com) Adding two bits produces a sum bit and a carry out bit. All possible values of sum and carry out for 1-bit values:
x + y
0 x + 0 y
0 + 1
1 + 0
1 + 1
___ C S a u r m r y
___ 0 0
___ 0 1
___ 0 1
___ 1 0
Half-adder
x + y ___ C S a u r m r y
0 x + 0 y ___
0 x + 1 y ___
1 x + 0 y ___
1 x + 1 y ___
Example Full-adder Adding two bits and a carry-in produces a sum and carry-out bit. All possible values for sum and carry out:
ci x + y ___ ci+1 s
Question 11.13
0 0 + 0 __ 0 0
0 0 + 1 ___ 0 1
0 1 + 0 ___ 0 1
0 1 + 1 ___ 1 0
1 0 + 0 ___ 0 1
1 0 + 1 ___ 1 0
1 1 + 0 ___ 1 0
1 1 + 1 ___ 1 1
a. What is the sum-of-products expression from Table 4 for c i+1? b. What are ci+1 and s values from Table 4?
ci x + y ___ ci+1 s
0 0 + 0 __
0 0 + 1 ___
0 1 + 0 ___
0 1 + 1 ___
1 0 + 0 ___
1 0 + 1 ___
1 1 + 0 ___
1 1 + 1 ___
Question 11.15 Determine from Table 3 the above full-adder results when: x=1 y=1 ci = 1
Example Multiple bit adder Adding two bits and a carry-in (ci) produces a sum and carry-out (ci+1 ) bit. The carry-out of a lower column (right) is the carry-in of the next column (left). All possible values for sum and carry out:
ci x + y ___
0 0 + 0 __
0 0 + 1 ___
0 1 + 0 ___
0 1 + 1 ___
1 0 + 0 ___
1 0 + 1 ___
1 1 + 0 ___
1 1 + 1 ___
ci+1
0 0
0 1
0 1
1 0
0 1
1 0
1 0
1 1
Question 11.16 - For the 1-bit full-adder below, from Table 4, what is:
s = ? c i+1 = ?
1 0
Adding multiple bits using multiple 1-bit full-adders: The first carry-in is 0. Binary Decimal
2's complement Negative values can be represented by defining the left-most bit to be a sign: 0 is positive 1 is negative
2's complement represents a negative number by forming one's complement and adding 1. -00101 11010 + 1 11011 2's complement -5 5-bit binary of -5 1's complement of +5
Question 11.18 a. 5-bit 1's complement of 011012 ? b. 5-bit 2's complement of 011012 ?
2's complement can be converted to a negative binary number by forming one's complement and adding 1. 11011 00100 + 1 -00101 5-bit binary of -5 2's complement -5
1's complement of -5
-3 +5 2
Question 11.19
1011 +0010
-5 +2