ENGR/CS 101 CS Session Lecture 1 Course and session webpages 

advertisement
ENGR/CS 101 CS Session
Lecture 1

Course and session webpages


http://csserver.evansville.edu/~hwang/f12-courses/engrcs101.html
http://csserver.evansville.edu/~hwang/f12-courses/engrcs101/cs.html

Introduction sheet, turn in at the end of class.

(Pre)Registration session for spring classes
will be on Monday, October 29. CS in KC267, CoE in KC-137, EE in KC-136.
Lecture 1
ENGR/CS 101 Computer Science Session
1
Outline


What is Computer Science?
Bits to Brains



Lecture 1
Binary digits (bits)
Binary numbers
ASCII encoding
ENGR/CS 101 Computer Science Session
2
What is Computer Science?

Short video (http://www.cs.washington.edu/WhyCSE)




"Power to Change the World"
Study of how computer programs are written
to solve problems using computation
Use an engineering approach to design and
implement a computer program
But first, a look at a basic idea underlying
computing
Lecture 1
ENGR/CS 101 Computer Science Session
3
Binary Digits (Bits)

A bit is a digit that can have value 0 or 1.
8 bits
10011101
1 byte


A byte is (a sequence of) 8 bits
A word is 16, 32, or 64 bits, depending on the
machine architecture.
Lecture 1
ENGR/CS 101 Computer Science Session
4
Binary Numbers

Use the cards to help answer the following
questions:




Lecture 1
What cards can we use to show 3 dots? 6 dots?
11 dots?
What is the highest number of dots that we can
represent with these cards?
What is the smallest number of dots we can
represent with these cards?
What is the pattern of the dots? How many dots
would there be on a fifth card?
ENGR/CS 101 Computer Science Session
5
Binary Numbers

Arrange the cards like so:


Lecture 1
Count from 0 to 15 dots by flipping over the cards
What is the pattern as you count?
ENGR/CS 101 Computer Science Session
6
Binary Numbers


Each digit place represents a power of the
base of the number in decimal. E.g.,

35610 = 3 x 102 + 5 x 101 + 6 x 100

100111012 = 1 x 27 + 0 x 26 + 0 x 25 + 1 x 24 +
1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 = 15710
What is 10001112 in decimal? What is 9710
in binary?
Lecture 1
ENGR/CS 101 Computer Science Session
7
Characters


Computers "speak" bits and bytes, but
humans communicate using letters, words,
and sentences.
Need to encode characters into bits. One
such encoding is called ASCII (American
Standard Code for Information Interchange).



Lecture 1
Alphabet-based
Ordering based on English alphabet
Extended for other language's alphabet symbols
ENGR/CS 101 Computer Science Session
8
ASCII Encoding (Decimal)
A
65
N
78
a
97
n
110
B
66
O
79
b
98
o
111
C
67
P
80
c
99
p
112
D
68
Q
81
d
100
q
113
E
69
R
82
e
101
r
114
F
70
S
83
f
102
s
115
G
71
T
84
g
103
t
116
H
72
U
85
h
104
u
117
I
73
V
86
I
105
v
118
J
74
W
87
j
106
w
119
K
75
X
88
k
107
x
120
L
76
Y
89
l
108
y
121
M
77
Z
90
m
109
z
122
space
32
!
33
,
44
.
46
Lecture 1
ENGR/CS 101 Computer Science Session
9
Characters


How many bits will it take to implement ASCII
encoding of characters?
Can you find a mathematical equation to
calculate the number of bits needed to
represent a number n?
Lecture 1
ENGR/CS 101 Computer Science Session
10
In-class Exercise



Decode the ASCII message on the worksheet
Write your first name in ASCII in binary
Turn in the worksheet and the introduction
sheet before you leave.
Lecture 1
ENGR/CS 101 Computer Science Session
11
Download