CS145 - Chapter 2

Chapter 2 - Preparing Information for the Computer 2.1 What is Information?

[List different types of information]
The five kinds of information computers maintain and manipulate:
visual information
numeric information
character or symbol information
audio information
command or instructional information

need to:
1) transform information
2) place information into an acceptable representation
Binary digits (bits) - binary circuits
Information can be represented by numbers which can be associated with parts of an electronic machine and their state or condition at a given moment

2.2 Representation of Numbers
Number Systems - base 10 (decimal) 1234.56

base 2 (binary) 10110.101 = 22.625 (base 10 decimal)
10110.101 = 16 + 4 + 2 + 1/2 + 1/8 = 22.625

base 16 (hexadecimal) 1A7.B3 = 423.6992 (base 10 decimal)
1A7.B3 = 1*256 + 10*16 + 7 + 11*1/16 + 3*1/256 = 423.6992
base 16 1A7 = 110100111 (base 2)

What is 0.1 in binary? 0.00011001100110011..two

101101
+ 10101
---------
1000010
Remember that in binary 1 + 1 = 10
Multiplication by 2 in binary is the same as shifting the number to the left one position
Division by 2 in binary is the same as shifting the number to the right one position
Subtraction in binary can be done by transforming the subtrahend to it's two's complement and then adding it:
ex.
101101
- 10101
--------
101101
+101011
----------
11000

2.3 Representation of Pictures, Symbols, Sound, and Instructions

Representing Symbols and Text
represent words with numbers
represent symbols with numbers
Morse Code: A .- B -... C -.-.

character code mapping of characters onto integers
byte = numbers of bits necessary to represent one character

7-bit ASCII(American Standard Code for Information Interchange) code (pg. 34)
8-bit EBCDIC (Extended Binary Coded Decimal Interchange Code)
Extended ASCII - includes symbols for graphics
parity bit - extra bit for detecting errors in a byte (even vs. odd parity)
**IMAGE GOES HERE**
Representing Pictures
**IMAGE GOES HERE**
pixel (Picture Element) building blocks of a computer picture
**IMAGE GOES HERE**
Arecibo, PR radio telescope transmission of 1679 = 23 x 73 0s & 1s (Fig. 2.11)

gray-scale - each pixel assigned a value from 000000two to 111111two

digitizer - device used to convert pictures to numeric form

color pictures -> numbers [requires 3 numbers (hue (color), saturation (richness of color) & gray scale (intensity)]
Sound as Information
Twinkle, Twinkle, Little Star

numerals on the notes == numerals on the instrument
(How long between notes? - half-note, whole-note, quarter-rest
What is the tempo? - number of beats / minute)

Digital Alternative Representation of Musical Scores (DARMS)

Fig. 2.14 - !G !K1- !MC 22H 23Q 24/ 26 26 27E 28 29Q J/ 29Q 28 27H/

treble clef, key of 1 flat, meter C (4/4 time), half note F, quarter note G, ...

digitize sound using frequency of notes produced (middle C = 256Hz)
by reproducing voltages electronically:
CD & DAT recorders/players can sample voltages at 40,000 times / second
digitize voice for phone transmission
Instructions as numbers
Word Hunt instructions
GOTO # : goto specified page number
SELECT LINE # : move to specified line number
FORWARD # : move to specified word
BACKUP # : move back specified words
WRITE word : write word to paper
STOP


GOTO : 3
SELECT: 16
FORWARD: 2
WRITE : WORD
SELECT : 27
FORWARD: 11
WRITE : WORD
GOTO : 11
SELECT : 2
FORWARD : 8
WRITE : WORD
BACKUP : 6
WRITE : WORD


1 stands for GOTO #
2 stands for SELECT #
3 stands for FORWARD #
4 stands for BACKUP #
5 stands for WRITE WORD
6 stands for STOP

1 3 2 16 3 2 5 2 27 3 11 5 1 11 2 2 3 8 5 4 6 5 6

001 00011 010 1000 011 00010 101 010 11011 011 01011 101 001 01011 010 000010
011 01000 101 100 00110 101 000

Classification of instructions
Arithmetic instructions: +, -, *, /, etc.
Data Movement instructions: assignment statements
Logical / Comparison instructions:
Control instructions:
Input/Output Instructions:

assembler (machine) languages: requires an opcode & address(es)

ex.
mov ax,1 0000 0001 0001
mov bx, 3 0000 0010 0011
add ax, bx 1010 0001 0010

2.4 Storage of Binary Information

main memory unit (semiconductor memory) - reading/writing data
RAM - DRAM (cheaper/higher density vs. needs refresh) vs. sRAM
ROM - PROM & EPROM & EEPROM

DOS goes in RAM then application software then data

Special-purpose memories: registers (acc, ir, pc, addr. reg)
buffer - intermediary between CPU and I/O devices
cache memory - intermediary between CPU and main memory

Characteristics of Secondary Storage
nonvolatile, more memory, slower, external, requires an I/O device
3 types: tape, disk, optical
How much: density, total bytes
How fast: data access time, data transfer time
Costs: fixed cost, cost per megabyte

Magnetic Tape (sequential access)
1/2" or 1/4" Mylar ribbon
needs read/write head
9 tracks (8 data bits & parity bit)
IRG - interrecord gap; IBG - interblock gap
tape - cheap, reusable, durable, used for backup, slow retrieval if random

Reel-to-reel - 2,400' long, 1/2" wide, 60,000 bytes/sec
Casette tape - 1/4" wide, stores 60-150 Mbytes
Catridge tape - greater density (up to 500 Mbytes)
8mm can hold 2.2 gigabytes

Magnetic Disk - Mylar/metallic platter; can access data directly (randomly)

Floppy Diskette - 8", 5 1/4" (360K & 1.2M), 3 1/2" (720K & 1.44M), 2"
needs formatting tracks & sectors

Hard Disks - aluminum surface (head crash) can revolve 10 times as fast as floppies = faster data transfer; can store more
Fixed Disk - 5 1/4", 3 1/2", 2"; multiple platters - cylinders
Removable Catridge (1 or 2 disks) Bernoulli Box
Disk Pack - 11 platters
Optical Technology
Optical laser disks: CD-ROM > 500 Mbytes
WORM < 5 1/4" = 500 Mbytes; 12" - 3 Gbytes
erasable (combines optical & magnetic, NEXT)
one 14" CD-ROM can hold up to 350,000 pages of documents

Optical card(laser card) - 4 Mbtes ROM
Optical tape

bit -> byte -> K -> MB -> GB -> TB

2.5 Representation of Special Types of Information

Dance Notation - Labanotation
Human Movement

Specialized Character Sets
used for CRT displays (4x6, 5x7 or 6x9 matrix of dots)
Hebrew, Arabic, Cyrlllic, Japanese

HOMEWORK: pp. 50-51 - # 1, 2, 3a,b,c, 4a,b,c, 5b,d, 6c (due Feb. 28, 1997)
page 51-3 - # 8, 10, 12a, 16 (due March 7, 1997)
BACK TO Computer Science I Page