Computer Science Fundamentals: Exposure, Hardware, Software, History, and Networking

Learning the Exposure Way

  • The "Nothing is Obvious" Concept:

    • A young boy raised in the Amazon jungle has lived without modern conveniences, never visiting a city, watching television, or reading a book.

    • Upon traveling to Colorado during winter, the Amazonian boy stands in a yard and watches falling snow with bewilderment and astonishment, as he does not understand what is falling from the sky.

    • A local boy from Colorado observes this reaction with confusion, failing to understand why the visitor acts strangely when it is "obviously" snowing.

  • Cultural Perceptions of "Obvious":

    • In the United States, pouring cold milk on corn flakes is considered obvious, whereas in Europe, pouring warm milk on cereal is standard practice.

    • In Europe, serving tea warm or hot is considered obvious; European observers are baffled when Texans put ice in tea.

The Exposure Equation

  • The Fundamental Equation:

    • Bewilderment+Exposure=Obvious\text{Bewilderment} + \text{Exposure} = \text{Obvious}

  • Exposure in Extracurricular Activities:

    • Drill team performances

    • Half-time band shows

    • Football team blocking

    • Basketball free throws

    • Baseball batting

  • The Curious Exposure Discrepancy:

    • Students recognize that achieving a strong showing in a brief athletic or artistic performance requires continuous practice.

    • Many of these same students barely read or practice a topic once for an academic subject.

    • Preparation for a known, short performance receives thorough practice, while preparation for life receives minimal effort.

Getting Started in Computer Science

  • Course Assumptions:

    • Assumes this is the student's first formal course in computer science.

    • Assumes zero prior knowledge of computer programming; existing programming knowledge is not a prerequisite.

Fundamental Capabilities of Computers

  • Three Key Advantages of Computers Over Humans:

    • Speed: Computers perform operations much faster than human beings.

    • Accuracy: Computers operate with far greater precision and lower error rates.

    • Memory Retention: Computers do not forget stored information.

Messages and Morse Code

  • Morse Code Principles:

    • Information encoding historically used discrete signal states (such as dots/dashes or binary states) to encode letters (AA through ZZ) and numeric digits (00 through 99).

Electronic Memory and Base Systems

  • Electronic Memory States:

    • Computer memory relies on electronic circuits that exist in two states: off (00) or on (11).

    • Example sequence: off on off off on off off off translates to binary sequence 01000001201000001_2.

  • Decimal (Base-10) Number System:

    • Uses 1010 digits (0,1,2,3,4,5,6,7,8,90, 1, 2, 3, 4, 5, 6, 7, 8, 9).

    • Likely developed because human beings have 1010 fingers.

    • Positional values are powers of 1010: 106,105,104,103,102,101,10010^6, 10^5, 10^4, 10^3, 10^2, 10^1, 10^0 (1,000,000;100,000;10,000;1,000;100;10;11,000,000; 100,000; 10,000; 1,000; 100; 10; 1).

    • Example breakdown of 2,345,678102,345,678_{10}:

    • (2×106)=2,000,000(2 \times 10^6) = 2,000,000

    • (3×105)=300,000(3 \times 10^5) = 300,000

    • (4×104)=40,000(4 \times 10^4) = 40,000

    • (5×103)=5,000(5 \times 10^3) = 5,000

    • (6×102)=600(6 \times 10^2) = 600

    • (7×101)=70(7 \times 10^1) = 70

    • (8×100)=8(8 \times 10^0) = 8

  • Binary (Base-2) Number System:

    • Uses 22 digits: 00 (off) and 11 (on).

    • Directly mirrors the flow of electricity in computer hardware.

    • Positional values are powers of 22: 27,26,25,24,23,22,21,202^7, 2^6, 2^5, 2^4, 2^3, 2^2, 2^1, 2^0 (128,64,32,16,8,4,2,1128, 64, 32, 16, 8, 4, 2, 1).

    • Example conversion of 01000001201000001_2 to Base-10:

    • (0×128)+(1×64)+(0×32)+(0×16)+(0×8)+(0×4)+(0×2)+(1×1)=6510(0 \times 128) + (1 \times 64) + (0 \times 32) + (0 \times 16) + (0 \times 8) + (0 \times 4) + (0 \times 2) + (1 \times 1) = 65_{10}

  • Character Mapping Examples:

    • 010000012=6510=Character ’A’01000001_2 = 65_{10} = \text{Character 'A'}

    • 010000102=6610=Character ’B’01000010_2 = 66_{10} = \text{Character 'B'}

    • 010000112=6710=Character ’C’01000011_2 = 67_{10} = \text{Character 'C'}

  • Base-10 to Base-2 Mapping Table (0–30):

    • 010=020_{10} = 0_2

    • 110=121_{10} = 1_2

    • 210=1022_{10} = 10_2

    • 310=1123_{10} = 11_2

    • 410=10024_{10} = 100_2

    • 510=10125_{10} = 101_2

    • 610=11026_{10} = 110_2

    • 710=11127_{10} = 111_2

    • 810=100028_{10} = 1000_2

    • 910=100129_{10} = 1001_2

    • 1010=1010210_{10} = 1010_2

    • 1110=1011211_{10} = 1011_2

    • 1210=1100212_{10} = 1100_2

    • 1310=1101213_{10} = 1101_2

    • 1410=1110214_{10} = 1110_2

    • 1610=10000216_{10} = 10000_2

    • 1710=10001217_{10} = 10001_2

    • 1810=10010218_{10} = 10010_2

    • 1910=10011219_{10} = 10011_2

    • 2010=10100220_{10} = 10100_2

    • 2110=10101221_{10} = 10101_2

    • 2210=10110222_{10} = 10110_2

    • 2310=10111223_{10} = 10111_2

    • 2410=11000224_{10} = 11000_2

    • 2510=11001225_{10} = 11001_2

    • 2610=11010226_{10} = 11010_2

    • 2710=11011227_{10} = 11011_2

    • 2810=11100228_{10} = 11100_2

    • 2910=11101229_{10} = 11101_2

    • 3010=11110230_{10} = 11110_2

  • Bits, Bytes, and Codes:

    • Bit: A binary digit representing either 00 (off) or 11 (on).

    • Nibble: 4bits4\,\text{bits} (12byte\frac{1}{2}\,\text{byte}).

    • Byte: 8bits8\,\text{bits}.

    • Combinations:

    • 1Byte1\,\text{Byte} (8bits8\,\text{bits}) contains 28=2562^8 = 256 distinct numerical combinations.

    • 2Bytes2\,\text{Bytes} (16bits16\,\text{bits}) contain 216=65,5362^{16} = 65,536 distinct numerical combinations.

    • ASCII: Uses 1byte1\,\text{byte} to store one character.

    • Unicode: Uses 2bytes2\,\text{bytes} to store one character.

Memory Measurement and Hardware Components

  • Primary Board and Integrated Circuits:

    • Motherboard: Main board housing primary computer components and attached chips.

    • ROM (Read Only Memory): Chip that stores permanent information for the computer.

    • RAM (Random Access Memory): Chip that stores temporary information; volatile memory.

    • CPU (Central Processing Unit): Chip acting as the "brains" of the computer.

  • Memory Capacity Measurement Units:

    • Technical Definition: 1KB=210=1024bytes1\,\text{KB} = 2^{10} = 1024\,\text{bytes}.

    • Kilobyte (KB): 1thousand bytes=1,000bytes1\,\text{thousand bytes} = 1,000\,\text{bytes} (10310^3).

    • Megabyte (MB): 1million bytes=1,000,000bytes1\,\text{million bytes} = 1,000,000\,\text{bytes} (10610^6).

    • Gigabyte (GB): 1billion bytes=1,000,000,000bytes1\,\text{billion bytes} = 1,000,000,000\,\text{bytes} (10910^9).

    • Terabyte (TB): 1trillion bytes=1,000,000,000,000bytes1\,\text{trillion bytes} = 1,000,000,000,000\,\text{bytes} (101210^{12}).

    • Petabyte (PB): 1thousand terabytes=1,000,000,000,000,000bytes1\,\text{thousand terabytes} = 1,000,000,000,000,000\,\text{bytes} (101510^{15}).

    • Exabyte (EB): 1million terabytes=1,000,000,000,000,000,000bytes1\,\text{million terabytes} = 1,000,000,000,000,000,000\,\text{bytes} (101810^{18}).

    • Zettabyte (ZB): 1billion terabytes=1,000,000,000,000,000,000,000bytes1\,\text{billion terabytes} = 1,000,000,000,000,000,000,000\,\text{bytes} (102110^{21}).

    • Yottabyte (YB): 1trillion terabytes=1,000,000,000,000,000,000,000,000bytes1\,\text{trillion terabytes} = 1,000,000,000,000,000,000,000,000\,\text{bytes} (102410^{24}).

  • Secondary Storage Devices:

    • Because contents in RAM are lost when turning off power, files must be saved to secondary storage devices for long-term retention.

Hardware and Software Classifications

  • Hardware:

    • Refers to physical computer equipment, including the system unit and external peripherals that plug into it.

  • Software:

    • Provides executable instructions to a computer.

    • System Software: Operating systems that control computer system functionality. Major examples include Windows, UNIX, Linux, and Mac OS.

    • Application Software: Software that runs user applications. Examples include Word, Excel, PowerPoint, Video Games, and custom user-written software.

Historical Evolution of Computing Hardware

  • First Era: Early Counting Tools:

    • Initial tally methods involved making marks on rocks, carving notches in bones, and tying knots in ropes.

    • Abacus (3000B.C.3000\,\text{B.C.}): Invented in the Middle East; continues to be used widely across Asian countries.

    • Napier's "Bones" (1617A.D.1617\,\text{A.D.}): Created by John Napier; used marked bone strips to simplify complex arithmetic multiplication via addition.

    • Slide Rule (16221622): Created by William Oughtred; enabled complex mathematical calculations for centuries until replaced by scientific calculators in the 1970s.

  • Second Era: Gear-Driven Mechanical Devices:

    • Required manual cranking and used rotating physical gears; subject to mechanical wear and physical breakdown.

    • Pascaline / Numerical Calculating Machine (16421642): Built by Blaise Pascal; first numerical calculating machine; handled addition and subtraction using inner gear mechanisms similar to vehicle tumbler odometers; variations remained in use through the 1970s.

    • Jacquard's Loom (18051805): Invented by Joseph Jacquard; accepted flexible cards punched with data to control cloth weaving patterns; represents an early milestone in programming.

    • Analytical Engine (18331833): Invented by Charles Babbage; read sequential instructions from punched cards; first general-purpose computing machine design.

    • First Programming (18421842): Ada Byron, Countess of Lovelace (assistant to Babbage), designed program instructions for the Analytical Engine, establishing core concepts used in modern programming languages.

  • Third Era: Electro-Mechanical Devices:

    • Utilized electrical power, eliminating manual cranking, but relied on moving physical parts subject to hardware failure.

    • Tabulating Machine (18891889): Invented by Herman Hollerith to compute U.S. Census Bureau statistics; reduced census processing time from 8 years (1880 census) to 1 year (1890 census).

    • Corporate History (1896,1911,19241896, 1911, 1924): Hollerith founded the Tabulating Machine Company in 1896; merged in 1911 to form the Computing Tabulating Recording Company; renamed International Business Machines Corporation (IBM) in 1924.

    • Differential Analyzer (19311931): Built at MIT by Harold Locke Hazen and Vannevar Bush to solve differential equations. A lower-cost Erector Set version was constructed at Manchester University in 1934 by Douglas Hartree and Arthur Porter.

    • Z3 (19411941): Built by Konrad Zuse in Germany during World War II; first functional, programmable, fully automatic digital computer; destroyed in 1943 Allied bombing of Berlin; Zuse is regarded by some as the inventor of the computer.

    • Mark-I (19441944): Electro-mechanical calculator measuring 51 feet long by 8 feet tall; executed automatic long calculations involving numbers up to 23 digits.

    • Grace Hopper's Contributions: Navy Lieutenant who programmed the Mark-I; authorized by U.S. Congress to serve past mandatory retirement age, retiring as an Admiral in 1986 at age 79.

    • Mark-II & First Computer Bug (19471947): On September 9, 1942/1947, the Mark-II halted due to a moth caught in a relay switch; removal of the insect produced the first literal computer bug (the moth is preserved at the San Diego Computer Museum); Grace Hopper popularized the term "debugging".

  • Fourth Era: Fully Electronic Computers with Vacuum Tubes (First Generation):

    • Removed moving parts, increasing speed and reliability; vacuum tubes were large, generated significant heat, and burned out frequently.

    • ABC (19401940): Built by John Atanasoff and Clifford Berry at Iowa State University; first electronic digital computer; non-programmable, special-purpose computer designed to solve systems of linear equations.

    • Colossus (19431943): Designed by Tommy Flowers; 10 machines built in England to decrypt secret German WWII communications; early programmable electronic digital computer.

    • ENIAC (19461946): Electronic Numerical Integrator and Computer; created by John Mauchly and J. Presper Eckert; first electronic general-purpose computer; twice the size of Mark-I; contained 17,468 vacuum tubes; programmed by physical rewiring; executed 385 multiplications per second; calculated π\pi in 1949; dubbed "The Giant Brain".

    • EDVAC (19491949): Electronic Discrete Variable Automatic Computer; ENIAC successor; introduced Stored Program architecture holding instructions in electronic memory (approximately 5.5KB5.5\,\text{KB}).

    • UNIVAC I (19511951): Universal Automatic Computer; world's first commercially available computer; gained fame by accurately predicting the outcome of the 1952 U.S. presidential election.

  • Fifth Era: Transistors and Integrated Circuits:

    • Second Generation (Transistors): University of Manchester created the first transistor computer in 1953; transistors were significantly smaller than vacuum tubes and did not burn out.

    • Third Generation (Integrated Circuits - 19581958): Jack Kilby (Texas Instruments, Richardson, TX) developed the first integrated circuit using germanium; Robert Noyce developed an improved silicon-based IC six months later ("Mayor of Silicon Valley"); both are co-inventors.

    • Early Video Games: Tennis for Two (19581958, William Higinbotham, played on Brookhaven National Laboratory oscilloscope); SpaceWar! (19621962, Stephen Russell, MIT, played on an actual computer monitor).

    • IBM System/360 (19641964): Standardized line of compatible mainframes serving both scientific and business communities; established the 8-bit byte industry standard.

    • Apple II (19771977): Introduced by Apple Computer Company; first commercially successful personal computer.

    • VisiCalc (19791979): Created by Dan Bricklin; first widespread commercial spreadsheet software.

    • WordStar (19791979): Released by MicroPro; dominant early word processing program.

    • IBM PC (19811981): Validated personal computers as serious business machines.

    • MS-DOS (19811981): Created by Bill Gates and Microsoft as the operating system for the IBM Personal Computer.

    • Compaq Portable (19821982): First portable computer (28 lbs, suitcase-sized) and first 100% IBM PC-compatible clone.

    • Macintosh (19841984): First commercially successful personal computer featuring mouse and windowing GUI interface (technology initially developed by Xerox).

    • Windows 1.0 (19851985): Operating environment GUI sitting atop MS-DOS.

    • Windows 95 (19951995): Released as a standalone operating system with a Macintosh-like GUI interface.

    • Windows Release History Matrix:

    • Version 1: Windows 1.0–3.1 / Windows NT 3.1

    • Version 2: Windows 95 / Windows NT 3.51

    • Version 3: Windows 98 / Windows NT 4.0

    • Version 4: Windows Millennium / Windows 2000

    • Version 5: Windows XP Home, Windows Home Server / Windows XP Professional, Windows Server 2003 / R2

    • Version 6: Windows Vista / Windows Server 2008

    • Version 7: Windows 7, Windows Home Server 2011 / Windows Server 2008 R2

    • Version 8: Windows 8, 8.1, Windows Phone 8 / Windows Server 2012 / R2

    • Tianhe-2 Supercomputer (20132013): Developed in China; ranked world's fastest computer in June 2013; executes 33,860,000,000,000,00033,860,000,000,000,000 floating point operations per second (88trillion88\,\text{trillion} times faster than ENIAC).

Fundamental Concepts of Programming

  • Core Definitions:

    • Program: A sequence of instructions directing a computer to perform a desired task.

    • Programmer: A person who writes software instructions for a computer.

History and Levels of Programming Languages

  • Machine Code (1st Generation):

    • Programming directly in binary (11s and 00s); involved raw physical wiring or switch manipulation; tedious and error-prone.

  • Assembly Language (2nd Generation):

    • Introduced with EDSAC (19491949) in Britain; used Initial Orders assembler to convert single-letter mnemonic symbols into binary streams.

  • Grace Hopper & Language Translation:

    • Pioneered human-readable programming; wrote the first compiler in 1952 for the A-0 language.

    • Her contributions earned her the nickname "Amazing Grace"; the Cray XE6 Hopper supercomputer and the USS Hopper Navy destroyer are named in her honor.

  • Language Level Categorization:

    • Low-Level Languages: Operate directly at or near machine code (11s and 00s); powerful but difficult (e.g., Machine Language, Assembly Language).

    • Medium-Level Languages: Combine English-like commands with low-level power and hardware access (e.g., C, C++).

    • High-Level Languages: Use English-like words for instructions; easier to learn but less powerful (e.g., BASIC, Pascal, COBOL, FORTRAN, PL/I, Java).

    • Very High-Level Languages: Use visual, point-and-click graphical interface blocks for programming (e.g., Lego Mindstorms NXT).

  • Language Translators:

    • Compiler: Translates entire source program into an executable file before execution.

    • Interpreter: Translates and executes source code one statement at a time during execution.

  • Evolutionary Timeline of High-Level Languages:

    • FORTRAN (19571957): FORmula TRANslation; developed by IBM programmers for scientific, mathematical, and engineering applications; lacked business record-processing functions.

    • LISP (19581958): LISt Processing; designed by John McCarthy at MIT for artificial intelligence research.

    • COBOL (19591959): COmmon Business Oriented Language; created primarily by Grace Hopper for business and military application; standardized by the U.S. Department of Defense.

    • The Hardware Split (1960s1960\text{s}): Computer hardware was split between FORTRAN math mainframes and COBOL business mainframes until IBM System/360 unified hardware in 1964.

    • PL/I (19641964): Programming Language 1; IBM's attempt to combine FORTRAN math features and COBOL record features; proved too complex for widespread adoption.

    • BASIC (19641964): Beginners All-purpose Symbolic Instruction Code; created by Tom Kurtz and John Kemeny at Dartmouth College for non-technical students; packaged with early microcomputers as Altair BASIC / Microsoft BASIC (19761976).

    • Pascal (19691969): Created by Niklaus Wirth specifically to teach structured programming; adopted by the College Board as the AP Computer Science exam language in 19831983.

    • C (19721972): Derived from BCPL (19661966, Martin Richards) and B (19691969, Ken Thompson at Bell Labs); created by Dennis Ritchie; used to rewrite the UNIX operating system kernel in 19731973.

    • C++ (19831983): Created by Bjarne Stroustrup by adding Object-Oriented Programming (OOP) to C; replaced Pascal on the AP Computer Science exam in 19971997.

    • Java (19951995): Released by Sun Microsystems (acquired by Oracle in 2010); features Platform Independence and mandatory OOP; replaced C++ on the AP Computer Science exam in 2003$.\n * **Lego Mindstorms NXT (2006$$)**: Point-and-click graphical blocks for robotics; evolved from Lego's 1998 visual language, NXT in 2006, and NXT 2.1 in 2009.

Computer Networking Foundations

  • SneakerNet:

    • The standalone computer era prior to local networks. Transferring files or printing required saving data to a floppy disk and physically walking to another computer.

  • Peer-to-Peer Networks (LANs):

    • Local Area Networks connecting small groups of computers directly to each other as equals to share local resources.

  • Client-Server Networks:

    • Network architecture where client workstations access shared central server machines dedicated to printing, login authentication, permanent file storage, and network communications.

  • Origins of the Internet:

    • Developed in the 1960s by the U.S. Department of Defense during the Cold War.

    • Designed as a decentralized communication system capable of rerouting data traffic automatically if military strikes damaged target nodes like the Pentagon.

  • Intranets and Internet Service Providers (ISPs):

    • Intranet: Private enterprise network connecting internal LANs to deliver security, speed, and cost savings.

    • Internet: Global public network accessed by paying a monthly fee to an Internet Service Provider (ISP), with pricing based on transmission speed.