Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSC 110 - Intro. to Computing Lecture 5: Boolean Logic, Gates, & Circuits.

Similar presentations


Presentation on theme: "CSC 110 - Intro. to Computing Lecture 5: Boolean Logic, Gates, & Circuits."— Presentation transcript:

1 CSC 110 - Intro. to Computing Lecture 5: Boolean Logic, Gates, & Circuits

2 Announcements Quiz at end of class on Thursday  Covers converting numbers between bases and addition in other bases Homework answers available on web  Homework #2 will be next week CSC tutors are now available  Hours posted outside Wehle 206 & 208

3 Homework Review Results were (generally) very good  Most mistakes came from miscopying numbers or addition mistakes  Very few mistakes were due to errors in algorithm Brief review includes most common error(s)

4 Homework Problem #7 Convert 14D 16 into octal  Don’t know how to convert hex to octal directly  (Harder) Solution: Convert to decimal first 14D 16 =

5 Convert 14D 16 to Octal (Harder) Solution: Convert to decimal first 14D 16 = 13 * 16 0 = 13 * 1 = 13 4 * 16 1 = 4 * 16 = 64 1 * 16 2 = 1 * 256 = + 256 333 10

6 Convert 14D 16 to Octal (Harder) Solution: Convert to decimal first 14D 16 = 333 10 = 515 8

7 Convert 515 8 to Hexadecimal (Easier) Method: Convert to binary first 515 8 =

8 Convert 515 8 to Hexadecimal (Easier) Method: Convert to binary first 515 8 = 101 001 101 2 Convert 5 Convert 1

9 Convert 515 8 to Hexadecimal (Easier) Method: Convert to binary first 515 8 = 2 = 16 1101 2 = 1 * 2 0 = 1 * 1 = 1 0 * 2 1 = 0 * 2 = 0 1 * 2 2 = 1 * 4 = 4 1 * 2 3 = 1 * 8 = + 8 13 10 1010 0 110 1

10 Convert 515 8 to Hexadecimal (Easier) Method: Convert to binary first 515 8 = 2 = 16 1101 2 = 1 * 2 0 = 1 * 1 = 1 0 * 2 1 = 0 * 2 = 0 1 * 2 2 = 1 * 4 = 4 1 * 2 3 = 1 * 8 = + 8 13 10 = D 16 1010 0 110 1 D

11 Convert 515 8 to Hexadecimal (Easier) Method: Convert to binary first 515 8 = 2 = 16 0100 2 = 0 * 2 0 = 0 * 1 = 0 0 * 2 1 = 0 * 2 = 0 1 * 2 2 = 1 * 4 = 4 0 * 2 3 = 0 * 8 = + 0 4 10 = 4 16 1010 0 110 1 4D

12 Convert 515 8 to Hexadecimal (Easier) Method: Convert to binary first 515 8 = 2 = 16 1 2 = 1 * 2 0 = 1 * 1 = 1 1 10 = 1 16 1010 0 110 1 14D

13 George Boole Mathematician from English middle-class  Lived from 1815 – 1864  Started work at age 16 as a teaching assistant Held two assistantships to support family Later opened his own school Reached pinnacle when appointed a Professor  Published Mathematical Analysis of Logic in 1847

14 Mathematical Analysis of Logic Boole’s book proposed new logical system  World consisted of only two values Derived other numbers from combinations of these  Devised addition, subtraction, and multiplication rules  Basis for several areas of academic research  World thought work was of little importance Not until 1963 did someone find a use for it…

15 Boolean System of Logic Also called “Boolean algebra” Initial world consists of two values  Think of them as “true” and “false” Also defines several basic Boolean operations  You have been using some of these for years, however  Work exactly as you have been using them

16 Truth Table Normal way we present Boolean functions Each table include all possible inputs…  Made easier since we only have true & false …and shows each possible result Not as complicated as it sounds  Actually, not very complicated at all!

17 Boolean Negation: NOT NOT is simplest operation  Returns the negation of the input True when a is false; false when a is true  Written as false true

18 Boolean Operation: OR OR takes two values as inputs  Written as  Returns true when either value is true True when either a OR b are true; false otherwise false true false true

19 Boolean Operation: AND AND also takes two inputs  Written as  Returns true when both values are true True when a AND b are true; false otherwise false true false true

20 Boolean Operation: XOR First slightly unfamiliar idea: XOR  XOR computes “exclusive or”  Written as  True when a or b, but not both, is true false true false true

21 Boolean Operation: NAND NAND computes NEGATIVE AND  Written as Combines notation for AND & NOT  Returns true when either input is not true True if a OR b are false; false otherwise false true false true

22 Boolean Operation: NOR Last operation is NEGATIVE OR  Written as The negation (NOT) of an OR operation  Returns true when both inputs are not true True if a AND b are false; false otherwise false true false true

23 George Boole: 1World: 0 Turns out Boolean algebra is VITAL  Basis for nearly all computer hardware work “Last useful thing by anyone claimed by computer scientists” – a former colleague (hardware engineer)

24 Boolean Logic in Computers Computers work best with concrete terms  For more on truth, see religious studies or philosophy Use “1” rather than true & “0” for false 00 01 10 11

25 Extended Boole’s Algebra Algebra includes ability to combine inputs and operations functions  f(x, y, z) = x 2 + y + z 3 + 5  f(2, 4, 1)= 2 2 + 4 + 1 3 + 5 = 4 + 4 + 1 + 5 = 14 This is true for Boole’s algebra, too  Computers do more than negate bits  We still use truth tables for this work

26 Circuits Combines results of multiple operations List result of each operation in truth table  Compute each new operation step-by-step Consider combining two NOT operations  Written 0 1

27 Even More Complex Circuits Compute  Negate a, then compute result AND b 00 01 10 11

28 Really Complex Circuits Determine truth table for 00 01 10 11

29 More Complex Circuits Consider 000 001 010 011 100 101 110 111

30 Creating Truth Tables Start truth table by listing all possible inputs  For 1 input, 2 possible values exist  For 2 inputs, 4 possible combinations  For 3 inputs, 8 combinations  For 4 inputs, 16 combinations  For 5 inputs, 32 combinations  For 10 inputs, 1024 combinations  For n inputs, 2 n combinations

31 Creating Truth Tables There is a secret to making the inputs  1 st input – Alternate one 0 and one 1  2 nd input – Repeat two 0s then two 1s  3 rd input – Repeat four 0s then four 1s  4 th input – Repeat eight 0s then eight 1s Start with row of all 0s Stop when you reach a row with all 1s

32 Creating Truth Table Keep going until we reach row with only 1s 000 001 010 011 100 101 110 111 00 01 10 11 0 1

33 Gate Piece of hardware which combines electrical signal input(s) to generate an output signal  Computer signals range from 0 – 5 volts 0 – 2 volts is “low” --- in “0” state 2 – 5 volts is “high” and in “1” state 6 gates commonly used today:  NOT, OR, AND, XOR, NAND, NOR

34 Logic Diagrams Gate-centric way of writing Boolean operations  Similar to equations from before, but not as math-centric Highlights the electronic nature of gates  Shows values coming into and out of each gate as a wire  Label the wires for circuit inputs

35 Logic Diagrams a a b a b

36 a b a b a b

37 Drawing Logic Diagrams Often use results from one gate as input into another gate  E.g., use result from in Show this by connecting wire from first gate’s output to second gate’s input b c a

38 a b c Drawing Logic Diagrams Sometimes we have one value used as input for more than 1 gate  Show this by drawing a “splitter”  E.g.

39 For next lecture Study for the quiz on number systems on Thursday Finish reading section 4 Be ready to discuss  Algebraic Properties of Boolean Logic


Download ppt "CSC 110 - Intro. to Computing Lecture 5: Boolean Logic, Gates, & Circuits."

Similar presentations


Ads by Google