Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Class 12: Computing Machines

David Evans
February 19, 2016

Class 12: Computing Machines

cs1120: Introduction to Computing
Explorations in Language, Logic, and Machine
University of Virginia, Spring 2016

http://xplorecs.org/class12

Class 12:
Apple vs. the FBI
Computing with Electrons
Building Logic

David Evans

February 19, 2016
Tweet

More Decks by David Evans

Other Decks in Programming

Transcript

  1. cs1120 Spring 2016 David Evans University of Virginia Class 12:

    Computing Machines Introduction to Computing: Explorations in Language, Logic, and Machines
  2. Why can’t FBI just do this themselves? CPU Firmware This

    program update_firmware(signed_program): if check_signature(apple_key, signed_program): firmware = signed_program
  3. Miles and Cents “The people on the road, inquire with

    curiosity what exact distance I have found from such a place to such a place; I answer, so many miles, so many cents. I find they universally and at once form a perfect idea of the relation of the cent to the miles as a unit.”
  4. Universal Digital Computer Machine that can perform all* possible digital

    computations. * Except for practical limits on space, energy, time, etc. ∼150 computers
  5. Lightening Course in Electricity Electron Mass: ∼ 9.12×10−28 grams Charge:

    ∼ −1.6×10−19 Coulomb ∼ 1500 C ∼ 1022 Electrons Matter is made of atoms that contain protons (+) and electrons (-)
  6. Voltage, Current, Resistance Voltage – amount of electrical charge (Volts)

    Potential difference ∼ water pressure / height Current – flow of electrical charge (Amps) ∼ water flow Resistance – how much a medium opposes current ∼ friction Current (I) = Voltage (V) / Resistance (r) Power (Watts) = Current (amps) × Voltage (Volts)
  7. Current (I) = Voltage (V) / Resistance (r) Power (Watts)

    = Current (amps) × Voltage (Volts) P = IV I = V/r V = Ir P = I(Ir) = I2r
  8. Adder Circuit 2V = V1 + V2 2.3 + 3.5

    ∼ 5.6 Equations are precise, but the real world is noisy!
  9. Claude Shannon 1916-2001 Worked on the Differential Analyzer at MIT

    “bit” Master’s Thesis (MIT, 1937): A Symbolic Analysis of Relay and Switching Circuits
  10. Representing Numbers Use wires carrying electricity: voltage represents the value.

    Can represent any value using 0s and 1s Digital abstraction: < 2V = 0, > 3V = 1
  11. Represents a 1 Represents a 0 Digital Abstraction 0 V

    5 V 2 V 3 V This is wasteful - infinitely many values used to represent only two! But useful: tolerate noise and get exact results with confidence.
  12. Computing the Outputs Magic? 1 0 1 0 1 1

    A1 A0 R1 R0 B1 B0 R0 = R1 =
  13. Computing the Outputs Magic? 1 0 1 0 1 1

    A1 A0 R1 R0 B1 B0 R0 = xor(A0 ,B0 ) R1 = or(or(and(A0 , B0 ), A1 , B1 )
  14. What’s the Magic? #35 control source output If the control

    is “on”, the source flows to the output. Otherwise, the output is “off”. A transistor is a device used to amplify or switch electronic signals (like a faucet).
  15. Making Transistors Today • A transistor is made of a

    solid piece of semiconductor material. • A semiconductor is a material that has electrical conductivity that varies dynamically between that of a conductor (on) or an insulator (off). • Silicon is a semiconductor.
  16. Transistors in your Smartphone 38 Qualcomm Snapdragon 801 2 Billion

    transistors Cost: $18 (> 1 Million per cent)
  17. Logic from Transistors With transistors it is possible to make

    two switches: control source output S C O 1 1 1 1 0 0 0 1 0 0 0 0 normal control What operation is this?
  18. Logic from Transistors With transistors it is possible to make

    two switches: control source output control source output S C O 1 1 1 1 0 0 0 1 0 0 0 0 S C O 1 1 0 1 0 1 0 1 0 0 0 0 normal control inverted control
  19. The Notty Transistor What if we wire the source of

    an inverted control switch to a battery that is always on? battery (always 1) control source output S C O 1 1 0 1 0 1 0 1 0 0 0 0
  20. Boolean Logic Gates Can we implement interesting functions using these?

    control source output S C O 1 1 1 1 0 0 0 1 0 0 0 0 normal control: and control 1 output S C O 1 1 0 1 0 1 inverter: not
  21. control source output S C O 1 1 1 1

    0 0 0 1 0 0 0 0 normal control: and control 1 output S C O 1 1 0 1 0 1 inverter: not or(x, y) =
  22. Boolean Logic Gates or(x, y) = not(and(not(x), not(y))) xor(x, y)

    = and(or(x, y), not(and(x, y))) Did Jefferson know this?
  23. Universal Logic and and not are enough for any Boolean

    function! Enough for a universal computer?
  24. Charge UVA Students Get going on Project 3 Yuchi has

    office hours now Jason Mars talk: 3:30pm today Rice 130 Crossroads Students Connelly Barnes and Ning Yu