Computer Science
I
CS 221
Instructor:
Anne DeFrance
Office
EPS 361
Office
hours: Tuesday 9-11; Wed 9-11; Thurs 12-2
And
as needed, make an appointment
I'm
in my office most of the day, feel free to drop by
Purpose of this course
o Give you an overview of the Computer Science field
o Help you continue to learn to program
o But CS is NOT just programming
n Programming is skill you must master, but there is
much more
Core areas of computer science
o Algorithms and data structures
o Programming languages
o Architecture
o Software engineering
Other areas of computer science
o Operating systems
o Networking
o Artificial intelligence and robotics
o Database and information retrieval systems
o Numerical and symbolic computation
o Human computer communication
Courses in these areas
o You will be taking courses in most of these areas
o This course
will emphasis the relationship between
n Architecture,
n Programming, and
n Data representation
Architecture--how computers are organized so that they can carry out
the steps of a program.
Processing hardware--the brain
n
Central
Processing Unit (CPU)
n
Main
Memory—electronic two state devices
o
RAM—like a
blackboard, can be overwritten
o
ROM—Read Only; cannot be changed
Peripheral devices--get data into and
out of main memory
n
Input devices
n
Output devices
n
Secondary storage
o
physical two state devices
Bus to connect components
Data Representation
o
Everything the
machine uses must be represented as zeros and ones.
o
What types of
things must be represented in RAM?
n
Programs
n
Data
o
Text
o
Values
o
Objects
o
References and/or
addresses
Representing Text-- alphanumeric
o ASCII code--8 bits represent one character
n Example
n A is 0100 0001
n B is 0100 0010
n 1 is 0011 0001
n 2 is 0011 0010
n 12 is 0011 0001 0011 0010
Values--numbers to do calculations
n Integers --use
the binary number system
n Binary number system is much the same as the decimal system. In both:
o the value of a digit is positional
o value of digit = digit * basepower
o the base is the number of digits
Review of the
Decimal number system
o Example: 685
means
(6*100) + (8*10) + (5*1)
o In the decimal number system, the digit positions are
worth
____ ____ ____
____ ____
10,000 1,000 100 10 1
104 103 102 101 100
Binary number system
o In the binary number system the digit positions are
worth
__ __ __
__ __ __
__ __
27 26 25 24 23 22 21 20
128 64 32
16 8 4
2 1
Storing data in RAM
o Everything entered at the keyboard is first stored as
ASCII
o Software makes the conversion to values, if necessary
o What is the largest integer that can be stored by one
byte?
o Numbers can be stored as either text or values
Example
ASCII vs. binary number system
o Some ASCII codes
n 1 is 0011 0001
n 2 is 0011 0010
o
What is 12 in ASCII?
o
What is 12 in the binary number system?
Values (cont)
o Real numbers
o values are stored in exponential form
o the mantissa(value) and
o exponent (places the decimal point)
Instructions to the CPU i.e. Programs
o Machine language
n must be stored as bits
o example--
n 01 means add
n 02 means subtract