CS225,  Fall 2006,  Monday Aug. 28, Day 2 .

Handout:  ASCII table.
Read: 
Warford, Ch. 2: 2.1, pp. 33-40.  Focus on Data types (global/local variables a little later)
   Ch. 3: 3.1 p.87-94 (Unsigned integers)  and 3.4 p. 109-115 (Hex and ASCII)
Bookmark pp.112-14,  Hex-decimal, Hex-binary conversions.
Memorize: be able to count in binary 0-1610, know the hex-decimal digit conversion (e.g E=14)
Write in the flyleaf of your book, and/or on margin of the ASCII table2 columns: x,   2x : the powers of 2 from x = 0 to 16.
      Mark the ones which are powers of 16 (and what power) e.g. 256 = 162  . (See problem 27 below)

Day 2HW:  Due Day 3. 
3.1: p.136, 1c, 2c,  (counting binary)
 Do 3abce, 4bcde  by hand.  Do 3df and 4af using the PC's calculator.  (bin->dec)
Do 5bcde by hand.  Check by looking at your list made in class.
      Do a and f with the calculator.  Then write the result in the "powers of two" form and check it.(dec->bin)

7 (range of numbers in n bits)
8all (addition, binary)
A.  Assuming an 8-bit cell, add 1111 1100 and 0000 0101 by hand.  Add it on the PC calculator, using the Byte size.  Note the loss of the carry.

3.4 p 140  27all (count in hex)
   28 all by hand.  162 =(24 )2 =28 = 256.  163 =(24 )3 =212 = ?, 164 =(24 )4 =216 = ?
36  It might be easier to rewrite as hex first. (code from binary ASCII)
A. Write your first name or nickname  and last initial, followed by period, in ASCII ( hex version)  (e.g. I would do Sally S.)  Don't forget the space.
B. What is the difference between the ASCII code for A and a?  B and b? X and x?  (Look at the binary) Make a guess as to what the shift key on the keyboard does.
C.  What do you have to do to the ASCII digit "3" to change it to the unsigned binary byte representing 3?  What do you have to do to go the other way?  Does this work for the other digits 0-9?


Notes: On PC's, the Calculator (Programs>Accessories>Calculator:  View>Scientific) will do numerical conversions.  Type the number in in one form, then choose the button for another form.
For non-decimal numbers (binary, hex) it limits sizes:  "Word" is 16 bits (2 bytes), "Dword" is double-word is 32 bits (4 bytes), etc. It simply loses the carry, if there is one.

Next:  The Pep8 simulator is working, so: We'll start with the computer architecture, chapter 4, thru p. 159, then start chapter 5.


This page belongs to Sally Sievers who is solely responsible for its content. Please see our statement of responsibility.
To Sievers Home Page
CS225-Fall06/Day2.htm 
8 pm, 8/27/06