12/16

advertisement
COS 109 Wednesday December 16
• Housekeeping
– Final exam – January 18 (Monday) at 7:30PM
In class, 3 hour exam
– A review session will be held on January 14 (time and location TBA)
• Today’s class
– An overall review of COS 109
– Revisiting a few ideas
– A look towards the future
Survey (part 2)
•
Have you heard of
•
Have you held
–
–
–
–
–
–
–
–
–
–
Random access memory
Moore’s Law
NP completeness
Javascript
Net neutrality
Spambots
The Cloud
The internet
TCP/IP
Malware/ransomware
–
–
–
–
–
A transistor
An integrated circuit
A disk drive
Memory
A CPU
Survey (part 2)
•
Have you heard of
•
Have you held
–
–
–
–
–
–
–
–
–
–
Random access memory
Moore’s Law
NP completeness
Javascript
Net neutrality
Spambots
The Cloud
The internet
TCP/IP
Malware/ransomware
–
–
–
–
–
A transistor
An integrated circuit
A disk drive
Memory
A CPU
Topics considered in the class
• Hardware
– Going digital – music, pictures, sounds, text, ascii, Unicode
– Major pieces of a computer and what they do – CPU, RAM, disk,
peripherals, bus to connect them
– Analog vs digital, bits and bytes, binary, hexadecimal
Converting among representations; how many bits/bytes to represent ….
– Fetch/execute cycle in the CPU, relation between CPU and RAM, von
Neumann machine
– Assembly language and the Toy simulator
Basic instructions (load/store, arithmetic, branching)
– History of computing devices from Babbage to von Neumann to the
present
– Basic logic gates, truth tables, XOR, NOR and NAND
– Transistors as the most basic building blocks for making chips
– Moore’s Law
Growth of transistor counts in CPUs, caches, …
Topics (cont.)
• Software
– State machines, Turing machines
– Algorithms – logarithmic time, linear time, quadratic time, …
– Algorithms for sorting and searching, exponential algorithms vs
polynomial time algorithms, NP-complete problems
– Programming languages – basic constructs, high level languages, evolution
over time,
– compiling into assembler and machine code, portability
– Operating systems – controlling the operation of the machine, memory
management, device drivers, kernel
– Historical development – Unix/Linux, MacOS, Windows, Fetch/execute
cycle
– File systems -- facilitated by operating system, manages blocks on disk,
manages hierarchy of names, file allocation table
– Network file systems – mounting the H: drive, the Cloud, Google Drive, …
– Applications – layers of software, APIs for interacting with the
operating system
Topics (part 3)
• Programming
– Components of a programming language – constants and variables, strings,
integers and floating point numbers, branching and looping, functions
– Syntax and semantics
– Javascript – components of the language, libraries and built-in functions,
– Growing to larger software systems
– Data formats
– Open source software
• Networks and the Internet
– Telephone systems
– Local area networks, wide area networks – Ethernet, MAC addresses
– The Internet – architecture, names and addresses, routing, TCP/IP,
higher level protocols
– Internet governance -- top level domains, DNS, ICAAN, root servers,
peering points, net neutrality, IPv4 transitioning to IPv6
– The Web – URL, HTTP, HTML, browser, cookies, cgi scripts
– Growth over time
Topics (part 4)
• Security and Privacy
–
–
–
–
–
–
–
–
–
–
–
Steganography
“advanced cookies” – web bugs, flash cookies, super cookies,
Canvas fingerprinting
Javascript tracking
Public records
Spam, worms, viruses, phishing, pharming, ransomware
Denial of service, DDoS, botnets
Onion routing,
Cryptography, substitution ciphers, cracking the Enigma
Secret key cryptography – DES and AES, key distribution issues
Public key cryptography – public keys and private keys, built on a problem
hard to solve, easy to verify a solution
Topics (part 5)
• Loose ends
– Wireless – sound waves, frequencies (how they are used/purchased),
transmitters and receptors, AM/FM/digital encoding, Wifi (802.11
standards), cell phones (cells and cell towers, how it works)
– Compression – squeeze out redundancy, work at word or character or
pixel level, Zipf’s Law, JPEG and MPEG standards
– Big data and machine learning – data growing rapidly, applications of big
data, techniques (how Google search works, machine learning, the Netflix
challenge)
– Social networks – where they came from, widespread usage, open
government
Clearing up a few points
•
•
•
•
Decimal, binary, hex, logarithms
Rule of 72/Moore’s Law growth/logarithms
State machines
Networks
Decimal, binary, hex
• How many items can we represent in n bits?
– This amounts to 2n .
– 21 is 2, 22 is 4, …. 210 is 1024 (which we often approximate as 1000)
•
I have N items to represent, how many bits are required to do so
– This is the reverse problem; we want to find the smallest n so that 2n >= N
– If N <= 4, n is 2, if N <= 8, n is 3, if N is near 1000, n is 10
– If N is e.g. 250 million, we say 20 bits for a million and 8 more bits for 250
• How many bytes to represent something that takes N bits
– We divide N by 8 but then round up to the next integer
– Partial bytes don’t make sense
• Converting binary to hexadecimal and vice versa
– 1 > 0001, 2 > 0010, 3 > 0011, … 9 > 1001, A > 1010, B > 1011, …
• Estimation (210 is about 103), how do we find x such that 2x is N
– See above
Decimal, binary, hex (cont.)
• T shirt for 2016
–
–
–
–
–
–
–
–
–
–
–
–
–
–
2016/2 = 1008 r0
1008/2 = 504 r0
504/2 = 252 r0
252/2 = 126 r0
126/2 = 63 r0
63/2 = 31 r1
31/2 = 15 r1
15/2 = 7 r1
7/2
= 3 r1
3/2
= 1 r1
r1
11111100000
So requires 11 bits
What is the first year that requires 12 bits?
Rule of 72/Moore’s law growth/logarithms
• Rule of 72
– This grows at k% per year, (estimate) how many years until it doubles
Divide 72 by k and that gives an estimate of the years to double
6% doubles in 12 years, 4% in 18 years, 12% in 6 years …
– If this grows by k% for N years, how big will it have grown in N years
Figure out period for doubling p = 72/k, write N as p*d + r; so 2d(1+k)r
• Moore’s Law growth
– Things double every 18 months,
In N*18 months, there are N doublings
• Logarithms
– The logarithm of N (we always think base 2) is the value of n such that
2n is about N
log (4) = 2, log(8) = 3, … log (1000) ~ 10, log (1,000,000) ~ 20, …
State machines
• Need
– States
Start state, various states that record where you are
– Rules for transitions
If in state S and you read symbol b, you move to state T and write symbol c
• Remember, state machines have no memory
– A transition cannot say
If this is the case, do this
Otherwise, do that
State machine example
• Deal 3 cards (value 0 or 1) and ask if all 3 are the same
– States {start, first was 1, first was 0, 2 1’s, 2 0’s, success, failure}
start
1
1
1
0
2 1’s 1
0
0
0
1
0
YES
0
2 0’s
1
NO
Networks
• Pieces of the network
– Your device has a MAC address
– Your device connects to a LAN (local area network) that may be in this
room
LAN might check your MAC address to see if it is willing to accept you
LAN might assign you a local IP address
– Your LAN feeds into a WAN (wide area network) that covers a larger
area (e.g. the Princeton campus)
WAN takes results of LAN and provides an IP address that will connect with
the Internet
– WAN connects to your ISP (e.g. Verizon, ATT, … ) which connects you to
the internet using the IP address assigned
Website of the day
• http://waitbutwhy.com/2013/08/putting-time-in-perspective.html
A look to 2050 (from others)
• Refrigerators will be seamlessly integrated with online
supermarkets, so a new tub of peanut butter will be on its way to
your door before you even finish the last one
• Advances in holographic and nanotechnology will make
teleconferencing much more realistic: Rather than jumping on a
Skype call, you might meet with a virtual hologram of your boss in
your living room. As such, telecommuting will become far more
common
• Advances in brain research allow the complete understanding
and recording of dreams. They can then be reviewed and quickly
analyzed. In addition, a computer can give proper stimulus during the
night so your brain will steer away from a nightmare toward a more
pleasant dream
• Hillary Clinton’s grandchild will be about the right age to run for
president
My projection to the future
• Hardware
– Moore’s Law will keep working in some ways and not in others
Processors won’t get much faster but you’ll have more CPU cores
Amount of RAM will grow
Disks will all be solid state and capacities will grow
main storage will be in the Cloud
– Devices
Desktop machines are almost gone
Laptops will become less prevalent
Focus will be on smaller devices – tablets, phones, phablets
There will be convenient screens that you ``plug into’’
– Sensors
Will be everywhere gathering data, large and small
Every device will be connected to the internet
Wearable computing will thrive (eg Google glass)
– 3d printing will be common place
– Virtual Reality may or may not happen
– By and large, hardware will become boring (or commonplace)
Projection (continued)
• Software
– The process of creating software will get easier
– Writing code will become less necessary but everyone will learn to do so
at some level
– All devices will have an aspect of programming to them
– Algorithms will be developed that do things humans cannot do
We will have to trust these algorithms though we may not understand them
• Networking
–
–
–
–
Everything will be connected
Everything will be known about you
You will expect to always be connected
Facts, books, libraries, … will be at your fingertips
Projection in the larger world
• The broader world
–
–
–
–
Commerce will all be done electronically
Payments will be made electronically
Transportation will be driverless
The work force
Robots will perform many tasks
More education will be required to participate in the work force
– Robots may be able to experience emotion
– Education will have to change
A major expansion of how education changed when calculators became available
The broader world (continued)
– Government will change
It will be possible for people to know all the decisions that are being made by
their government
It will be possible to survey the population on any issue
So representation will have a different meaning
– Medical
We will each have a personal genome
Geonomes will be understood and so treatment methods will change
Medical records will be shareable so that consultation with experts will be
easier
Many surgeries will be done robotically
People will live longer
Some current diseases will be eliminated
will new diseases arise?
If brain mapping succeeds, it is conceivable that human brains will live forever
– Military
Cyber security will become a significant issue
Final website of the day
• http://www.findtheinvisiblecow.com/
Download