Download presentation
Presentation is loading. Please wait.
Published byJudith Simon Modified over 9 years ago
1
CSC 107 – Programming For Science
2
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 Opened own school after many years of work Reached pinnacle of any job -- named a Professor Wrote Mathematical Analysis of Logic in 1847
3
Mathematical Analysis of Logic Boole’s book proposed new logical system World began with 2 values– though more created Devised rules to add, subtract, & multiply Work ignored during Boole’s lifetime System only had 2 values, so what was the point? Basis for most technology in the modern age All it took was a simple little discovery…
4
Gate Combines input(s) to generate output signal Like most electronics, uses “on-off” state Input is "off", if line drops below 2 volts From 2 - 5 volts, an input is considered on Gate is deep fried silicon if line goes above 5 volts, Like Boole’s logic, electronics have 2 values Simple gates combine to make modern circuitry All initially part of Boolean algebra Basis of programming at the lowest, rawest level
5
Truth Table Normal way that Boolean functions presented All combinations of inputs shown in this table This is really easy, inputs must be true or false Output shown for each of the possible inputs Given how it sounds, not at all complicated Very simple rules to follow to construct Does requires you count up to 2
6
NOT Gate Simplest gate: computes opposite of input Output false when input true; Output true when input false; Written in C++ as !a a is gate’s input x is gate’s output ax!a!a true false a x
7
OR Gate Equivalent to addition in Boolean algebra If either input is true is going to be checked True when either a OR b are true; false otherwise Written in C++ as a || b a & b are inputs; x is output abx a || b false true false true a b x
8
AND Gate Equivalent to multiplication in Boolean algebra If both inputs are true is going to be checked True when a AND b are true; false otherwise Written in C++ as a && b a & b are inputs; x is output abxa && b false true false true a b x
9
Gates in Computers Computers more comfortable using numbers Plus, far less to write down in truth tables Use 0 to stand for false; Use 1 rather than true For example of this, consider power symbol Just a combination of 0 & 1 Ultimately, gate’s meaning does not change Use what is easier: C++ switches back and forth
10
Your Turn Get in groups of 3 & work on following activity
11
For Next Lecture Read sections 7.2 – 7.2.1 for Monday How can we differ what our program does? How are bool variables and operations used? Why are if - else statements so important Week #3 weekly assignment due Tuesday Problems available on Angel If problem takes more than 10 minutes, TALK TO ME!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.