* Welcome to Computer Science E-1!
* Lecture 1: Hardware
* September 20, 2006
* Lecturer: David Malan
wedge Each of you has in your hands a floppy disk tonight. Unfortunately, we're going to destroy these disks tonight. Go ahead and take your favorite colored disk and pop off the black cover that is on the bottom of the disk. Watch your eyes! We are about to see how a floppy disk works. (This is not how you should normally use this!).
wedge You should notice a black circular disk on the inside of the disk. How does it feel?
* soft
* floppy!
* plastic
* Insert two of your thumbs (or fingers) and pop open the entire case. Now what you are holding is the floppy disk.
wedge These do not hold that much information. How much can you store?
* 1.44 megabytes
wedge What does 1.44 megabytes mean?
* roughly 1.44 million bytes
* mega- denotes millions
wedge what is a byte?
* 8 bits in a byte
wedge what is a bit?
* "0" or a "1"
* computers only understand 0 and 1: "binary"
* we understand 0-9: "decimal"
* anything you see on a computer or do on a computer boils down to 0s and 1s.
* if you save your résumé on a floppy disk it is stored in a pattern of 0s and 1s.
* somehow, these 0s and 1s represent letters, bold, italics, everything we're familiar with on a computer
wedge But - where are these 0s and 1s on the floppy disk?
* encoded magnetically onto the disk
* there are almost 10 million magnetic particles (bits) on the disk that represented the résumé on the disk
wedge remember Wooly Willy?
* made up of magnetic particles that you can manipulate with a small magnet
* You may remember that magnets have a "North" pole and a "South" pole, so we can represent a 0 or a 1 by assigning the number to one of these poles
wedge How do computers go about counting?
wedge If you have 1 bit, how many values can you represent with one magnetic particle?
* Two: 0 or 1
wedge How can we represent larger numbers than 0 and 1?
* Liken to an abacus - allows us to do various kinds of mathematics by sliding beads
wedge Imagine several columns where bead can be 'up' or 'down'
* Farthest right column: up means a '1', down means a '0'
* Second to the right: up means a '2', down means a '0'
* Third to the right: up means '4', down means '0'
* Remember elementary school arithmetic. If we have a "1" in a "100s" column, and a "2" in a "10s" column, and "3" in a "1s" column, we have 100+20+3, and a total number of 123.
* Similarly, if we have a "1" in the "8s" column, a "1" in the "4s" column, a 1 in the "2s" column, and a 0 in the "1" column, we'll get 8+4+2+0 = 14. So, 1110 in binary equals 14 in decimal.
wedge Using tiny transistors, computers can effectively represent 0s and 1s.
* We can represent a bit with a light bulb: if the light is on, its a 1, if its off, a 0.
* Similarly a device in a computer called a transistor can be 'on' and represent a 1, 'off' and represent a 0.
* Let O represent an unlit light bulb. Let X represent a lit light bulb.
* Columns: 128 64 32 16 8 4 2 1
* O O O O O O O O = 0
* O O O O O O O X = 1
* O O O O O O X O = 2
* O O O O O O X X = 3
* O O O O O X O O = 4
* So how would a computer represent the number 4 in a byte? (Remember a byte is 8 bits): 00000100
wedge What happens when I hit the number 2 on a calculator?
* 2 appears and stays on the screen. This implies somehow that the caculcator is remembering what I have typed in.
wedge Inside of a calculator are tiny chunks of memory called "registers"
* registers we will reconsider on a higher level as RAM
* Assume we have 5 registers.
* each register is a collection of 8 transistors (from above, can represent a 0 or 1). If you change the register, what is stored changes.
* Register 1: 00000010 (the number 2 in binary)
* Register 2: + (you told the calculator to add)
* Register 3: 00000111 (number 7 in binary)
* Register 4: = (equals sign)
wedge What will the calculator remember in the 5th register?
* 00001001 (number 9 in binary)
wedge What does this represent?
* 0 0 0 0 1 0 0 1
* 0 0 0 0 0 0 0 0
* 0 0 0 0 0 0 1 0
* 0 0 0 0 0 0 0 1
* 0 0 0 0 0 0 0 0
* 90210
wedge "Aren't there permutations of numbers that we cannot represent with a bit?"
* 128+64+32+16+8+4+2+1 = 255
wedge We can represent a total of 256 values
* So why can we only represent 255?
* Smallest number we can represent is a 0, and this is the 256th value
wedge Some acronyms and prefixes
* a bit - "b" - 0 or 1
* a byte - "B" - 8 bits, (8b)
* a kilobyte - prefix 'K': "KB", 1,024 B
* a megabyte - prefix 'M': "MB", 1,048,576 B
* a gigabyte - prefix 'G': "GB", 1,073,741,824 B
* a terabyte - prefix 'T': "TB", 1,099,511,627,776 B
wedge To store the alphabet, we represent "A" by 65, "B" by 66, "C" by 67, etc.
* Don't forget the computer is really storing these numbers in binary, so its not stored as '65' but by the binary representation: 01000001
wedge Given this and the fact that we can only represent 256 values in a byte, we can only represent 256 characters with a byte.
wedge So if you were an engineer, how would you be able to represent more than 256 characters (other languages, for example)
* Use more than 1 byte.
* This is the way "Unicode" works (can represent characters from other languages)
wedge A "Byte" of Volunteers
* Byte 2 and 64 raised hands - represent the letter "B"
* Next round: 79. Represents "O"
* Final round: "W"
wedge What is this course ultimately all about? (Logistics)
* For credit: attend & watch all lectures. 9 problem sets, 2 exams, final project (website).
* For fun/Not for credit: welcome and encouraged to submit all of the above
* Practical component: sections and workshops
* During lectures, we will cover a huge breadth of topics. Hardware, software, the internet, multimedia, security, website development, programming, dotcoms, ...
* First E-1 Movie Night: "Pirates of Silicon Valley" in Lecture 3.
* Second E-1 Movie Night during dotcoms lecture.
* Lectures are video taped to 'attend' the course from your computer.
* Audio and video formats of the course are available as a podcast on iTunes
wedge Books!
* No books are required
* We do have a list of recommended texts.
* This course tends to have two types of students: savvy computer users who want to fill in blanks, or new users who are trying to get their feet wet. We have a set of books for each of these sets.
* See the syllabus for the complete list.
* Available at Grossman Library, the Coop, or online.
wedge Sections
* 2 hour optional classes in addition to lecture
* Led by course's TFs
* Sections begin Wed, Sep 27th
* Most sections will not be videotaped since they are mostly hands-on
* First section: Dissecting a PC: we will tear computers apart and put them back together
* See syllabus for complete list.
wedge Workshops
* Saturday afternoons after section
* Optional, led by TFs
* Often tangential material to lecture, hopefully being a bit more fun or more technical
* Many will be filmed in video or at least audio
wedge Problem Sets
* not meant to 'test' understanding, or 'test' how much you were paying attention in lecture
* Rather, meant to reinforce ideas
wedge Final Project
* website at your own domain name
wedge Web site
wedge invaluable website since everything we make available is posted on the website
* Lectures/videos/audio
* old exams
* handouts
* contact information for staff
* Videos of the Week
* access your grades
* Staff's Picks - opportunity for extra credit by watching a movie
wedge Email all of us at cscie1@fas.harvard.edu
* Please also email us individually if you wish
wedge "Not Dumb Question" box
* an opportunity semi-anonymously to crumple up a piece of paper with a burning question that you may wish to ask during lecture
* Also ask via www.notdumbquestions.com and we will answer your question on the website
wedge CPUs
* Everyone that has a computer has a CPU inside of it
wedge What is a CPU?
* "Central Processing Unit"
* the "brain" of a computer
* the piece of hardware that does the computer's thinking
wedge what unit is a computer's speed measured in?
* measured in gigahertz, megahertz
* hertz - "things"/operations per second
* mega-/giga- prefixes for millions/billions
* So if you have a 2 gigahertz processor it will do 2 billion "somethings" (add two numbers together, display something on the screen, etc)
* Its a bit of an oversimplification but the idea is the same
* Intel or AMD in Windows PCs, Intel or PowerPC in a Mac
* CPUs are placed into a slot on a motherboard
wedge Motherboard
* CPU plugs into this
* central artery system for the information (all information routed through the motherboard)
wedge What is on a motherboard?
* ports - connections for a CPU, battery, fan, hard/floppy drives
* slots - for RAM, expansion cards (PCI, PCIe, AGP types)
wedge Memory
* two types: temporary and permanent
* Temporary storage provided by RAM
* Permanent storage ('storage space') by hard drive
wedge Exercise
* Unplug everything on your computer without memorizing its space
* Try fitting all the connectors back
* Video: On button
* Video: Floppy disk
* Video: Floppy disk (more detail)
wedge Turn on a PC
* What you see before the Windows logo is a bit more esoteric information
* As an addendum to the exercise, try keeping the keyboard unplugged when you turn on the computer. You should see
* Power On Self Test (POST) - reports to you in some arcane language what its doing. It makes sure that all the basics are in place before allowing the computer to boot up
* This is loading from ROM.
wedge Types of memory:
* RAM - random access memory
* ROM - read only memory. tends to store the computer's BIOS - Basic Input Output System. As the name implies, it cannot be changed. This stores the basic information from the computer. Even if you have no hard drive in the computer, it does have a BIOS.
wedge Exercise 2
* Try going in to your computer's BIOS settings screen and exploring the options.
* You can often find out what button to hit to go into the screen when the computer doesn't start up.
* If you can't find the button, try hitting F1, Esc, F10, F12, or Delete.
wedge Tie-In