• No results found

CS100: Introduction to Computer Science

N/A
N/A
Protected

Academic year: 2021

Share "CS100: Introduction to Computer Science"

Copied!
6
0
0

Loading.... (view fulltext now)

Full text

(1)

CS100: Introduction to

Computer Science

Lecture 3: Data Storage -- Mass storage & representing information

In-class Exercise:

n

What is a flip-flop?

n

What are the properties of flip-flops?

n

Draw a simple flip-flop circuit?

Review:

bits, their storage and main memory

n

Bits

n

Boolean operations

n

Gates

n

Flip-flops (store a single bit)

n

Main memory (RAM)

q Cell, Byte, Address

Mass Storage or Secondary Storage

n

Magnetic disks

n

CDs

n

DVDs

n

Magnetic tapes

n

Flash drives

Mass Storage or Secondary Storage

n

On-line versus off-line

q Online - connected and readily available to the

machine

q Offline - human intervention required

n

Typically larger than main memory

n

Typically less volatile than main memory

n

Typically slower than main memory

Mass Storage Systems

n

Magnetic Systems

q Hard Disk q Floppy Disk q Tape n

Optical Systems

q CD q DVD n

Flash Drives

(2)

Figure 1.9 A magnetic disk storage

system

Magnetic Disks

n Floppy disk q Low capacity

n 3.5 inch diskettes 1.44MB q A single plastic disk n Hard Disk system

q High capacity systems

q Multiple disks mounted on a spindle, multiple read/write heads move in unison

n Cylinder: a set of tracks

n Platter : a flat circular disk

q Heads do not tough the surface of disks

Measuring the Performance of Hard Disk

Systems

n

(1) seek time

q The time to move heads from one track to another

n

(2) rotation delay

q Half the time required for the disk to make a

complete rotation n

(3) access time

q Seek time + rotation delay

n

(4) transfer rate

q The rate at which data can be transferred to or

from the disk

Capacity of Hard Disk Systems

n

5MB (1956 by IBM)

n

20MB (1980s)

n

1 GB (1990s)

n

20 GB – 768 GB (3/4) (2006)

q the lowest-capacity - the highest-capacity desktop q On 4 platters

n

1 TB (2007)

q 5 platters

Figure 1.10 Magnetic tape storage

Magnetic Tapes

n

High capacity

q Many GBs

n

A big disadvantage

q Very time-consuming, much longer data access

times

n

Good for archival storage

q High capacity q Reliability q Cost efficiency

(3)

Figure 1.11 CD storage- Optical Systems

Compact Disks

n

A spiral approach:

q one long track that spirals around a CD from

inside out.

n

Capacity in the ranges of 600 - 700 MB

n

Good for long continuous strings of data

q music

DVDs (Digital Versatile Disks) or (Digital

Video Disks)

n

Same size as CDs (5 inches in diameter)

n

Encoded in in a different format at a much

higher density

n

Multiple layers

n

High capacity of several GBs

n

Good for lengthy multimedia presentations,

movies with high video and sound quality

Flash Drives

n

Flash memory technology

q Bits are stored by sending electronic signals

directly to the storage medium where they cause electrons to be trapped in tiny chambers of silicon dioxide.

n

Capacity of up to a few GB

n

Portable, small size, easy to connect to a

computer

Flash Drives

n

Storing and retrieving data faster than optical

and magnetic systems

n

Digital cameras, cellular telephones,

hand-held PDAs

n

Vulnerable, repeated erasing slowly damages

the chambers

q Not suitable for general main memory applications q Not good for long term applications

Questions:

n 1. When recording data on a multiple-disk storage

system, should we fill a complete disk surface before starting on another surface, or should we first fill an entire cylinder before starting on another cylinder?

n Why should the data in a reservation system that is

constantly being updated be stored o a magnetic disk instead of a CD or DVD?

n What advantage do flash drives have over the other

(4)

Files

n

File: A unit of data stored in mass storage

system

q A complete text documents q A photograph

q A program q A music recording

q A collection of data about the students in a

college

Files

n

Logical records

q Correspond to natural divisions with data

n

Physical Records

q Correspond to the size of a sector

n

Buffer: A memory area used for the

temporary storage of data (usually as a step

in transferring the data)

Figure 1.12 Logical records versus

physical records on a disk

Representing Information as bit Patterns

n

Representing text

n

Representing numeric values

n

Representing Images

n

Representing sounds

Representing Text

n

Each character (letter, punctuation, etc.) is

assigned a unique bit pattern.

q ASCII: Uses patterns of 7-bits to represent most

symbols used in written English text

q Unicode: Uses patterns of 16-bits to represent

the major symbols used in languages world side

q ISO standard: Uses patterns of 32-bits to

represent most symbols used in languages world wide

Figure 1.13 The message “Hello.” in

ASCII

Find the meaning of the following text which is encoded in ASCII:

01000011 01101111 01101101 01110000 01110101 01110100 01100101 01110010

(5)

Representing Numeric Values

n

Binary notation: Uses bits to represent a

number in base two

n

Hexadecimal notation: Uses bits to represent

a number in base 16

Hexadecimal Notation

n

Hexadecimal notation: A shorthand notation

for long bit patterns

q Divides a pattern into groups of four bits each q Represents each group by a single symbol

n

Example: 10100011 becomes A3

Figure 1.6 The hexadecimal

coding system

Representing Numeric Values

n

Binary notation: Uses bits to represent a

number in base two

n

Hexadecimal notation: Uses bits to represent

a number in base 16

n

Limitations of computer representations of

numeric values

q Overflow – happens when a value is too big to be

represented

q Truncation – happens when a value is between

two representable values

Question:

n

1. What is the largest numeric value that

could be represented with three bytes if each

digit were encoded using one ASCII pattern

per byte?

n

What if binary notation were used?

n

What if hexadecimal notation were used?

n

Covert binary representations to its

equivalent base ten form

q 0101 q 10011

Representing Images

n Bit map techniques

n Pixel: short for “picture element” q 1 bit for 1 pixel

n A black and white image is encoded as a long string of bits representing rows of pixels in the image.

n The bit is 1 if the corresponding pixel is black, 0 otherwise.

q 8 bit for 1 pixel

n For white and black photos, allows a variety of shades of grayness to be represented.

q 3 bytes for 1 pixel

n For color images. RGB encoding, 1 byte for the intensity of each color

(6)

Representing Images

n

Bit map techniques

n

Vector techniques

q Scalable

q Word processing systems use vector techniques

to provide flexibility in character size.

q PostScript

q Also popular in Computer-aided design systems

Representing Sound

n

Sampling techniques

q Sample the amplitude of the sound waves at

regular intervals and record the series of values obtains.

q 8000 samples per second

n used in long-distance telephone communication

q 44,100 samples per second for high quality

recordings (each sample represented in 16 or 32 bits) a million bits for a second of music

Figure 1.14 The sound wave represented by

the sequence 0, 1.5, 2.0, 1.5, 2.0, 3.0, 4.0, 3.0, 0

Representing Sound

n

Sampling techniques

n

MIDI

q Used in music synthesizers in electronic

keyboards

q Contains individual instructions for playing each

individual note of each individual instrument.

q Encoding directions for producing music on a

synthesizer rather than encoding the sound itself.

Homework Assignment1:

(Due in-class next Monday)

n

Page 71, 1b, 2b, 3b

n

Page 72, 5, 6, 9,11, 12, 19

Next Lecture:

n

The binary system, storing integers and

fractions

Figure

Figure 1.9 A magnetic disk storage
Figure 1.11 CD storage- Optical Systems Compact Disks
Figure 1.12 Logical records versus  physical records on a disk
Figure 1.6 The hexadecimal
+2

References

Related documents

 Computer systems store information electronically using bits (binary digits).. • Each bit can be in one of two states, which we can take to represent the binary (base-2) digits

$7f as an 8 bit twos complement integer = +127 To do hex to signed decimal conversion, we need to determine sign (Step 1), determine Magnitude (step 2), combine sign and

Number systems, Introduction to binary, octal, decimal and hexadecimal number systems, Bits, bytes, characters, types of file, file management, types of data – numeric data,

Unsigned fractional numbers use a convenient notation to keep track of the location of a radix point (i.e., the binary or decimal point); a number with N bits to the left of

• When this instruction is executed, the algorithm stops, waits for the user to type in an answer, and the value typed by the user is stored into variable a. Whatever the value of a

– When a print instruction is executed, the algorithm writes to screen the value of variable x. print

• Problem: Write an algorithm that reads from the user a list of 100 numbers and a target value, and searches to see if any element in the list is equal to the target value. If not,

- the efficiency averaged on all possible inputs of size n - must assume a distribution of the input. - we normally assume uniform distribution (all inputs are