[SOLVED] CS algorithm Boolean Algebra and Circuits

$25

File Name: CS_algorithm_Boolean_Algebra_and_Circuits.zip
File Size: 386.22 KB

5/5 - (1 vote)

Boolean Algebra and Circuits

COMP273 McGill
a Truth Tables
a BooleanFunctions
a Logic Gates
a CombinatorialCircuits a AppendixC
Overview

Truth Table

COMP273 McGill
Boolean Operations a Considerbinaryvariables,A,B
Possible values are 0 (FALSE) and 1 (TRUE)
ABC
a Differentpossibleinputswithnoperands=2n 2 binary operands: 22 = 4 different possible inputs 4 binary operands: 24 = 16 different possible inputs
A
AB
0 1

COMP273 McGill
Boolean Operations a Considerbinaryvariables,A,B
Possible values are 0 (FALSE) and 1 (TRUE)
ABC
a Differentpossibleinputswithnoperands=2n 2 binary operands: 22 = 4 different possible inputs 4 binary operands: 24 = 16 different possible inputs
I2 I2 I2 I2 I2 I2 I2 I2 I2 I2 I2 I2 I2 I2 2I I2 I2 I2 I2 I2 I2 I2 I2 I2
AAB
000 101 10 11

COMP273 McGill
Boolean Operations
a ABooleanFunctionisanalgebraicexpressionconsistingof binary variables and the logic operation symbols
a Any Boolean function can be written in terms of AND, OR, and NOT
a Truth table defines all possible outcomes
AB|A+B 0000 0101 1001 1111

COMP273 McGill
Note on Notation
OR(A,B) AND(A,B) NOT(A) A+B |
A|B A&B ~A
A || B A && B !A AvB A^B A
AB [ When do we use which?

COMP273 McGill
Boolean Algebra
a Rulescapturelogicalreasoning
a Allowformanipulationofexpressions

||[=||[=||[ [  | ~ | [ =  | [
COMP273 McGill
Boolean Algebra
Are two boolean functions equivalent?ent? Prove it, or find values to show that they are not!

Boolean Expression

COMP273 McGill
Derive Boolean Expression
a Consider a logic function with three inputs, A, B, and C, and three outputs, D, E, and F.
D is true if at least one input is true
E is true if exactly two inputs are true F is true only if all three inputs are true
a Find the Boolean expression for D, E, and F.

COMP273 McGill
I2 I2 I2 I2 I2 I2 I2 I2 I2 I2 I2 I2 I2 I2 2I I2 I2 I2 I2 I2 I2 I2 I2 I2
Derive Boolean Expression
Find the truth table! D is true if at least one input is true ABCD

COMP273 McGill
Derive Boolean Expression
Find the truth table! E is true if exactly two inputs are true
ABCDE
I2 I2 I2 0 I2 I2 I2 1 I2 I2 I2 1 I2 I2 I2 1 I2 I2 I2 1 I2 I2 I2 1 I2 I2 I2 1 I2 I2 I2 1

COMP273 McGill
Derive Boolean Expression
Find the truth table! F is true only if all three inputs are true
ABCDEF
I2 I2 I2 0 0 I2 I2 I2 1 0 I2 I2 I2 1 0 I2 I2 I2 1 1 I2 I2 I2 1 0 I2 I2 I2 1 1 I2 I2 I2 1 1 I2 I2 I2 1 0

COMP273 McGill
Derive Boolean Expression
What are the Boolean expressions for outputs D, E, and F?

COMP273 McGill
Derive Boolean Expression
D is true if at least one input is true D=

COMP273 McGill
Derive Boolean Expression
F is true only if all three inputs are true F=

COMP273 McGill
Derive Boolean Expression
E is true if exactly two inputs are true E=

COMP273 McGill
Sum of Products, Product of Sums
a Canonical form for any logic function
Only two levels of gates, one AND, the other OR Possible inversion on the final output.
A ~ |  | [ = ~ |  | [ = ~ |  | [ Sum-of-Product  A ~[=[= | ~[=[= | ~[=[= Product-of-sum
a Why? Permits an easy/direct/naive implementation of any Boolean function in hardware

Circuits

COMP273 McGill
NAND: Not And NOR:NotOR
XOR: Exclusive OR
A B NAND NOR XOR 00110 01101 10101 11000
Common Binary Operations
a Three other very common operations:
a Using AND, OR, NOT, how would you write expressions for each of these functions?

COMP273 McGill
Combinational Circuits
a A combinatorial circuit is a circuit that implements a Boolean function
a aoZ]a]o(}azA~[=

COMP273 McGill
a Canput>2inputs onanANDorandORgate
a Allowed because of the associative law
Multiple Inputs
a Commutative law of Boolean algebra: the ordering of the wires into a AND and OR gates doesnt matter
a Example:3inputANDgate(thesefunctionsaresymmetric)

COMP273 McGill
Questions
a HowmanydifferenttwoinputBooleanfunctionsexist?
How many of these functions are symmetric? ~]XXU oZ }aa }( oZ ]vaoe }ev[o uooa
a HowmanydifferentthreeinputBooleanfunctionsexist?

Dont Care!

COMP273 McGill
}v[o a
a Situations where we do not care about the value of an output Because another output is true
e.g., If A is true, then A + B is true. We dont need to check B
Because a subset of the input combinations determines the outputs e.g., if A is false, then A and B is false. We dont need to check B

COMP273 McGill
}v[o a a Can be easier to specify the truth table
a Writethetruthtable,markingX(}a^}v[oa_
Inputs S, A, B
OutputC 0000
SABC
If S is true, output is A If S is false, output is B
0x00 0011 0x11 0100 0x00 0111 0x11 1000 100 1010 100 1101 111 1111 111
0x00 0x11 100 111
SABC SABC

COMP273 McGill
If A or C is true, then output D is true, whatever the value of B. If A or B is true, then output E is true, whatever the value of C.
}v[o a
Output F ]e oa ]( oo }v }( oZ ]vaoe ]e oaU o  }v[o a }o oZ o of F, whenever D and E are both true.

COMP273 McGill
Circuit Minimization
a Theproblemofobtainingthesmallestlogiccircuit(Boolean formula) that represents a given Boolean function or truth table.
a The problem is believed to be hard, but there are effective heuristics (Karnaugh maps, the QuinetMcCluskey algorithm).
a }voZe}a}(oZ]e}aeY
See Randy H. Katz, Contemporary Logic Design

COMP273 McGill
a TruthTables
a BooleanFunctions
a Logic Gates
a Combinatorial Circuits
Review and more information
a The best thing about a Boolean function is that even if you are wrong, you are only off by a bit
a This class covers topics in textbook Appendix C of 4th edition
Appendix B of 5th edition

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS algorithm Boolean Algebra and Circuits
$25