"Inspiring Innovation in Young Scholars"
Carnegie Mellon University
April 16, 2009
Session 1A: Computer Science
Workshop
Notes
- Introduction
- Part 1: Building
Computers
- Download (and unzip)
TMCM labs
- See xLogicCircuits Lab 1
- Basic Gates: Not, Or, And
- Simple Circuits: 5-Gate XOR
- Your turn: 4-Gate XOR
- Boolean Logic + Truth Tables
- Disjunctive Normal Form (DNF)
- So... Boolean Logic is Computable
- Your turn: 2-of-3 in DNF
- What about Arithmetic?
- Integers in Binary
- Binary Arithmetic As Logic!
- Example: One-Bit Adder ("Half Adder")
- Your turn: One-Bit Subtracter with Signed Output
- Full Adder (three 1-bit numbers in, one 2-bit number out)
- 4-Bit Adder (Daisy-Chained Adders)
- More Advanced Circuits: Memory, Clocks, etc...
- And you have... A Digital Computer!!!
- Part 2: Programming
Computers
- Machine Language + Assembly Language (see xComputer Labs)
- Higher-Level Programming Languages (See xTurtle Labs and xModels
Labs)
- Modern, Professional Programming Language (Java, C++, Python,
Ruby, etc...)
- Java examples
- HelloWorld.java and
IsPerfect.java (see
Wikipedia page on
Perfect Numbers)
-
Getting Started with Java
-
Getting Stated with Graphics
-
Getting Started with Events (requires
JComponentWithEvents.class)
- Part 3: Analyzing
Computers
- Time Complexity (how long will a program run?)
- See xSortLab
- selectionsort versus mergesort?
- Computability
-
Church-Turing Thesis:
- If a problem is computable, then it can be computed on a
Turing Machine
- Corollary: All "Turing-Equivalent" machines /
languages (ie, basically all of them) are equally powerful.
- See xTuringMachineLab
- Halting Problem Warm-up:
- Use
Cantor's Diagonal Argument to prove that |R| > |Z|
(we say the real numbers are not "countable" -- so there are
multiple infinities!)
- Same technique can prove
Cantor's
Theorem (that |power set of Z| > |Z|)
- Related to:
Goedel's Incompleteness Theorem
- The
Halting Problem
- It is impossible to determine if a given program will
halt over any possible input
-
Rice's Theorem + Corollaries: Non-trivial properties
of programs are undecidable
- Conclusion
- Resources
- Contacts
- Questions