Title: CMSC 100 Course Overview
1CMSC 100Course Overview
- Professor Marie desJardinsmariedj_at_cs.umbc.eduThu
rsday, August 28, 2008
2Welcome!
3Overview
- What is Computer Science?
- Course Logistics
- First Assignments
- UPC Example
4What is Computer Science?
5The Computer Revolution
- How fast did this happen?
- http//www.blinkenlights.com/pc.shtml
- 1950 Simon (plans published in Radio
Electronics) - 1973 HP 65 (programmable calculator)
- 1975 Altair 8800 (first widely used programmable
computer kit) - 1977 Apple II (a huge breakthrough, the first
mass-produced, inexpensive personal computer) - 1981 IBM 5150 PC (now were really taking off)
- 1984 Apple Macintosh 128K (my first computer!!)
- 2008 MacBook Air(my newest computer!)
6Moores Law
- Computer memory (and processing speed,
resolution, and just about everything else)
increases exponentially - (roughly doubles every 18-24 months)
7Measuring Memory
- One yes/no bit is the basic unit of memory
- Eight (23) bits one byte
- 1,024 (210) bytes one kilobyte (1K)
- 1,024K (220 bytes) one megabyte (1M)
- 1,024K (230 bytes) one gigabyte (1G)
- 1,024 (240 bytes) one terabyte (1T)
- 1,024 (250 bytes) one petabyte (1P)
- ... 280 bytes one yottabyte (1Y?)
Note that external storage is usually measured
in decimal rather than binary (1000 bytes 1K,
and so on)
8What Was It Like Then?
- The PDP-11/70s we used in college had 64K of RAM,
with hard disks that held less than 1M of
external storage - ... and we had to walk five miles, uphill, in the
snow, every day! And we had to live in a
cardboard box in the middle of the road!
9What Is It Like Now?
- The PDP-11/70s we used in college had 64K of RAM,
with hard disks that held less than 1M of memory - The cheapest Dell Inspiron laptop has 2G of RAM
and up to 80G of hard drive storage.... - ...a factor of 1018 more RAM and 1012 more disk
space - ...and your iPod nano has 8G of blindingly fast
storage - ...so dont come whining to me about how slow
your computer is!
10Its Not Just Speed, Its Quantity
- So just how big a revolution are we talking
about? - How many computers do you think were in the room
when I took my first programming class? - Answer ZERO().
- How many computers are in this room?
- ( First we need to decide what is a computer
not so easy!) - Answer Im going to guess around 100.
11Grand Challenges for CS
Ubiquitous Computing and Situation Awareness
Information Search
Autonomous Vehicles
NIST
Human-Level Intelligence
DARPA
Claytronics
http//www.cs.cmu.edu/claytronics/software/
thebrain.mcgill.ca
12How Does a Computer Work?
- The work performed by the computer is specified
by a program, which is written in a programming
language. This language is converted to sequences
of machine-language instructions by interpreters
or compilers, via a predefined set of subroutines
called the operating system. The instructions,
which are stored in the memory of the computer,
define the operations to be performed on data,
which are also stored in the computer's memory. A
finite-state machine fetches and executes these
instructions. The instructions as well as the
data are represented by patterns of bits. Both
the finite-state machine and the memory are built
of storage registers and Boolean logic blocks,
and the latter are based on simple logical
functions, such as And, Or, and Invert. These
logical functions are implemented by switches,
which are set up either in series or in parallel,
and these switches control a physical substance,
such as water or electricity, which is used to
send one of two possible signals from one switch
to another 1 or 0. This is the hierarchy of
abstraction that makes computers work. -- W.
Daniel Hillis, The Pattern on the Stone
13How Does a Computer Work?
- The work performed by the computer is specified
by a program, which is written in a programming
language. This language is converted to sequences
of machine-language instructions by interpreters
or compilers, via a predefined set of subroutines
called the operating system. The instructions,
which are stored in the memory of the computer,
define the operations to be performed on data,
which are also stored in the computer's memory. A
finite-state machine fetches and executes these
instructions. The instructions as well as the
data are represented by patterns of bits. Both
the finite-state machine and the memory are built
of storage registers and Boolean logic blocks,
and the latter are based on simple logical
functions, such as And, Or, and Invert. These
logical functions are implemented by switches,
which are set up either in series or in parallel,
and these switches control a physical substance,
such as water or electricity, which is used to
send one of two possible signals from one switch
to another 1 or 0. This is the hierarchy of
abstraction that makes computers work. -- W.
Daniel Hillis, The Pattern on the Stone
14Abstraction The Key Idea!
- Computers are very complex
- Most interesting programs are very complex
- What makes it possible to design and maintain
these complex systems?? - Which just means
- Once weve solved a low-level detail, we can
treat that solution as a black box with known
inputs and outputs, and not worry about how it
works. - The way we get there is called problem reduction
(or decomposition or divide-and-conquer)
Abstraction!
15Hardware
- Patterns of bits
- Memory / storage registers
- Machine-language instructions
- Switches and Boolean logic blocks
16Systems
- Operating systems
- Compilers
17Software
- Programs
- Programming languages
18What this class is about
- How computers are built, programmed, and used to
solve problems - Hardware Digital logic and system architecture
- Systems Operating systems and networks
- Software Basic programming/algorithms,
databases - Theory Algorithms, computation, complexity
- Applications AI, graphics,
- Social issues Ethics, privacy, environmental
impact - Other skills emphasized
- Effective writing and presentation skills
- Basic programming (in Alice)
- Foundational mathematics for computer science
19What this class is NOT about
- How to install Windows or Linux
- How to use Excel and PowerPoint
- What kind of computer you should buy
- Advanced programming techniques
20Course Logistics
- Instructor Prof. Marie desJardins,
mariedj_at_cs.umbc.edu http//www.csee.umbc.edu/mari
edj/Office hours Mon 11-12, Thurs 330-430,
ITE 337 - TA Ms. Chaitra Sathyanarayana,
chaitra1_at_umbc.eduOffice hours Tues 11-12, Wed
230-330, ITE 334 - Course website/syllabus http//www.csee.umbc.edu/
courses/undergraduate/100/Fall08/ - Schedule http//www.csee.umbc.edu/courses/undergr
aduate/100/Fall08/schedule.html
21Textbooks
- Brookshear, Introduction to
Computer Science - Hillis, The Pattern on the Stone
- Dann et al., Learning to Program with Alice
(regular or brief edition) - 100H only Stork, Hals Legacy
22My Expectations
- Students will
- Attend class regularly
- Be prompt, and not engage in distracting or
disruptive behaviors - NO LAPTOPS OR CELLPHONES DURING CLASS
- Take responsibility for knowing what work is due,
and turning the coursework in promptly - Follow the courses academic honesty policy, and
not present anothers work as your own - Be engaged in the learning process, respectful of
the course staff, and supportive of your fellow
students - Express concerns and ask questions
- Understand that the course staff has other
obligations outside of this class
23Your Expectations
- The instructor will
- Tell students what is expected in terms of
coursework and behavior - Be fair in giving assignments, grading
assignments, and returning coursework in a timely
fashion - Answer questions and concerns promptly
- Be open to feedback and suggestions
- Be respectful of students
- Try to make the course useful, interesting, and
enjoyable - Understand that students have other obligations
outside of this class
24Academic Honesty Policy
25Course Communications
- Email
- Requests for extensions, questions about course
policies ? Prof. dJ - Grading inquiries, requests for help with
assignments ? TA - Still having trouble? Talk to Prof. dJ
- Office hours
- One point of EXTRA CREDIT if you come to my
office hours before 9/12 to introduce yourself! - Blackboard
- Instructor postings
- Discussion board
- Assignment submission
- Wiki/blog(?)
26First Assignments
- First Assignments
- Academic Honesty Policy and Survey
- Due Tuesday 9/2
- Submit in class
- HW 1
- Due Tuesday 9/9 NOTE CHANGE!
- Submit via Blackboard
- Late policy
27EXAMPLE Universal Product Codes
- First scanned product Wrigleys gum (1974).
- Method of identifying products at point of sale
by 11-digit numbers. - Method of encoding digit sequences so they can be
read quickly and easily by machine.
Slides for the UPC example courtesy of Prof.
Michael Littman (Rutgers University)
28Reduction Idea
- Each level uses an encoding to translate to the
next level (i.e., the next higher abstraction) - Patterns of ink.
- Sequence of 95 zeros and ones (bits).
- Sequence of 12 digits.
- Sequence of 11 digits.
- Name/type/manufacturer of product.
29Product Name
- Ponds Dry Skin Cream
- 3.9 oz (110g)
- Unilever Home and Personal Care USA
- Name Badge Labels (Size 2 3/16" x 3 3/8")
- 100 Labels
- Avery Dennison/Avery Division
3011-Digit Number
- Digit 0,1,2,3,4,5,6,7,8,9
- Sequence of 11 digits
- QUESTION How many different items can be
encoded?
31Encode Name By 11 Digits
- First 6 digits Manufacturer
- First digit, product category
- 0, 1, 6, 7, 8, or 9 most products
- 2 stores use, for variable-weight items
- 3 drugs by National Drug Code number
- Last 5 digits Manufacturer-assigned ID
32Examples
- Labels 0-72782-051440
- 0general product
- 72782 Avery
- 051440Averys code for this product
- Ponds 3-05210-04300
- 3drug code
- 05210 Unilever
- 04300National Drug Code for this product
3312-Digit Number
- The UPC folks decided to include another digit
for error checking. Example - 01660000070 Roses Lime Juice (12 oz)
- 04660000070 Eckrich Franks, Jumbo (16 oz)
- 05660000070 Reese PB/Choc Egg (34 g)
- 08660000070 Bumble Bee Salmon (14.75 OZ)
- Misread digit 2 and you turn sweet to sour.
34Check Digit
- Add the digits in the odd-numbered positions
(first, third, fifth, etc.) together and multiply
by three. - Add the digits in the even-numbered positions
(second, fourth, sixth, etc.) to the result. - Subtract the result from the next-higher multiple
of ten. The result is the check digit.
35Code and Example
01660000070
set evensum to d2d4d6d8d10 set oddsum to
d1d3d5d7d9d11 set checkdigit to
(0-(3oddsumoddsum)) mod 10
01660000070
odd-digit sum 0600006 even-digit sum
1600714 odd3even 631432 subtract from
mult of 1040-328
- Lime juice 01660000070?016600000708
- Franks 04660000070?046600000705
- Choc Egg 05660000070?056600000704
- Salmon 08660000070?086600000701
all are two digits different now
36Some (Mod) Math
- 3 x Sodd Seven 0 mod 10
- The sum of the odd-position digits (times 3) plus
the sum of the even position digits (including
the check digit) is 0 mod 10. - Modulo math is just like regular math, except
things wrap around (like an odometer). Mod 10
means we only pay attention to the last digit in
the number. - Divide by 10 and only keep the remainder.
37More Modulo Math
- Whats the check digit for the code
0-000000-000000? - What happens to the check digit if you add one to
an odd-position digit? - What happens to the check digit if you add one to
an even-position digit?
38Bits
- Weve gone from a product name to an 11-digit
number to a 12-digit number. - A 0 will appear in the UPC as a white bar (space)
and a 1 as a black bar. - So we need to turn each digit (base 10) into a
series of bits (base 2). - Also, we want to be sure we alternate 0s and 1s
often enough (e.g., dont want 20 black bars (1s)
in a row). - Finally, we want to have a code that we can scan
in either direction (i.e., we need to be able to
tell which direction were reading it in).
39Bits
5 0110001 6 0101111 7 0111011 8 0110111 9
0001011
- Encode d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12
as101 d1 d2 d3 d4 d5 d6 01010 d7 d8 d9 d10 d11
d12 101
Last 6 digits have 0s and 1s reversed. (No
reverse complements ? can tell what direction
were scanning in!)
40How Many Bits?
- How many bits (zeros and ones) long is the code
for the original 12-digit sequence?
41Finally, Ink!
- Given the long pattern of bits, we write a 1 as a
bar and a zero as a space. - Two 1s in a row become a double-wide bar.
- Two 0s in a row become a double-wide space.
- No UPC has more than four 0s or 1s in a row.
- All digits have equal width.
- All UPCs start and end with bars (actually with
black-white-black pattern). - UPCs can be read upside down.
- UPCs can be read at an angle or variable speed
via ratios.
42Example .......
- Barcode for skin cream
- 3-05210-04300-8 (8 is the check digit)
- start 101 3 0111101
- 05210 0001101-0110001-0010011-0011001-0001101
- middle 01010
- 04300 1110010-1011100-1000010-1110010-1110010
(rev) - 8 1001000 (rev) end 101
- The digits underneath are for our benefit.
43Whew!
- The UPC example illustrates
- Abstraction
- Binary numbers and modulo math
- Encoding (error correction, readability
constraints)