ENGR/CS 101 CS Session Lecture 1 Course and session webpages http://csserver.evansville.edu/~hwang/f11-courses/engrcs101.html http://csserver.evansville.edu/~hwang/f11-courses/engrcs101/cs.html Introduction sheet, turn in at the end of class. Lecture 1 ENGR/CS 101 Computer Science Session 1 Outline Bits to Brains Binary digits (bits) Binary numbers ASCII encoding Lecture 1 ENGR/CS 101 Computer Science Session 2 Binary Digits (Bits) A bit is a digit that can have value 0 or 1. A byte is (a sequence of) 8 bits 8 bits 10011101 1 byte A word is 16, 32, or 64 bits, depending on the machine architecture. Lecture 1 ENGR/CS 101 Computer Science Session 3 Binary Numbers Use the cards to help answer the following questions: What is the pattern of dots on the cards? How many dots would the fifth card have? Lecture 1 What is the highest number of dots that we can count to with these cards? What is the smallest number of dots we can represent with these cards? ENGR/CS 101 Computer Science Session 4 Binary Numbers Arrange the cards like so: Lecture 1 Count from 0 to 15 dots with the cards in this arrangement by showing the correct number of dots What is the pattern of flipping over the cards as you count? ENGR/CS 101 Computer Science Session 5 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). Alphabet-based Ordering based on English alphabet Extended for other language's alphabet symbols Lecture 1 ENGR/CS 101 Computer Science Session 6 ASCII Encoding Lecture 1 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 sp 32 . 46 , 44 ! 33 ENGR/CS 101 Computer Science Session 7 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 8 In-class Exercise Decode the ASCII message on the worksheet Write the name of your hometown in ASCII Turn in the worksheet before you leave. Lecture 1 ENGR/CS 101 Computer Science Session 9