55
DATA STORAGE Chapter 1

Cs160 chapter 1

Embed Size (px)

Citation preview

Page 1: Cs160 chapter 1

DATA STORAGE

Chapter 1

Page 2: Cs160 chapter 1

1.1 BITS AND THEIR STORAGE

Data Storage1-2

Page 3: Cs160 chapter 1

BITS AND BIT PATTERNS

Bit: Binary Digit (0 or 1)

Bit Patterns are used to represent

information. Numbers

Text characters

Images

Sound

And others

1-3

Page 4: Cs160 chapter 1

BOOLEAN OPERATIONS

Boolean Operation: An operation that manipulates

one or more true/false values

Specific operations

AND

OR

XOR (exclusive or)

NOT

1-4

Page 5: Cs160 chapter 1

THE BOOLEAN OPERATIONS AND, OR, AND XOR

(EXCLUSIVE OR)

1-5

Page 6: Cs160 chapter 1

GATES

Gate: A device that computes a Boolean operation

Often implemented as (small) electronic circuits

Provide the building blocks from which computers are

constructed

VLSI (Very Large Scale Integration)

1-6

Page 7: Cs160 chapter 1

A PICTORIAL REPRESENTATION OF AND, OR, XOR, AND NOT

GATES AS WELL AS THEIR INPUT AND OUTPUT VALUES

1-7

Page 8: Cs160 chapter 1

FLIP-FLOPS

Flip-flop: A circuit built from gates that can store one bit.

One input line is used to set its stored value to 1

One input line is used to set its stored value to 0

While both input lines are 0, the most recently stored value is

preserved

1-8

Page 9: Cs160 chapter 1

A SIMPLE FLIP-FLOP CIRCUIT

1-9

Page 10: Cs160 chapter 1

1.2 MAIN MEMORY

Data Storage1-10

Page 11: Cs160 chapter 1

MAIN MEMORY CELLS

Cell: A unit of main memory (typically 8 bits

which is one byte) Most significant bit: the bit at the left (high-order) end

of the conceptual row of bits in a memory cell

Least significant bit: the bit at the right (low-order) end

of the conceptual row of bits in a memory cell

1-11

Page 12: Cs160 chapter 1

THE ORGANIZATION OF A BYTE-SIZE MEMORY CELL

1-12

Page 13: Cs160 chapter 1

MAIN MEMORY ADDRESSES

Address: A “name” that uniquely identifies

one cell in the computer’s main memory The names are actually numbers.

These numbers are assigned consecutively starting at

zero.

Numbering the cells in this manner associates an order

with the memory cells.

1-13

Page 14: Cs160 chapter 1

MEMORY CELLS ARRANGED BY ADDRESS

1-14

Page 15: Cs160 chapter 1

MEASURING MEMORY CAPACITY

Kilobyte: 210 bytes = 1024 bytes Example: 3 KB = 3 times1024 bytes

Sometimes “kibi” rather than “kilo”

Megabyte: 220 bytes = 1,048,576 bytes Example: 3 MB = 3 times 1,048,576 bytes

Sometimes “megi” rather than “mega”

Gigabyte: 230 bytes = 1,073,741,824 bytes Example: 3 GB = 3 times 1,073,741,824 bytes

Sometimes “gigi” rather than “giga”

1-15

Page 16: Cs160 chapter 1

1.3 MASS STORAGE

Data Storage1-16

Page 17: Cs160 chapter 1

MASS STORAGE

On-line versus off-line

Typically larger than main memory

Typically less volatile than main memory

Typically slower than main memory

1-17

Page 18: Cs160 chapter 1

MASS STORAGE SYSTEMS

Magnetic Systems

Disk

Tape (all but obsolete)

Optical Systems

CD

DVD

Blu-Ray

Flash Drives

Solid State Drives (SSDs)

1-18

Page 19: Cs160 chapter 1

MAGNETIC DISKS

1-19

Page 20: Cs160 chapter 1

GAP BETWEEN HEAD AND PLATTER

1-20

Head

Smoke

Particle

Human

Hair

Dust

Particle

Page 21: Cs160 chapter 1

DISK PERFORMANCE

1-21

Disk Performance

Seek time

Rotational latency

Transfer rate

Page 22: Cs160 chapter 1

OPTICAL DISKS

1-22

Page 23: Cs160 chapter 1

CD AND DVD TRACK COMPARISON

1-23

CD DVD

Page 24: Cs160 chapter 1

FILES

A file is a named collection of bits

Files are often stored in pieces

1 byte chunks in memory

Sector-sized chunks on disk

1-24

Page 25: Cs160 chapter 1

1.4 REPRESENTING INFORMATION AS BIT

PATTERNS

Data Storage1-26

Page 26: Cs160 chapter 1

REPRESENTING TEXT

Each character (letter, punctuation, etc.) is

assigned a unique bit pattern

ASCII

American Standard Code for Information Interchange

Uses patterns of 7-bits to represent most symbols used in

written English text

128 (27) unique characters

Unicode

Uses patterns of 16-bits to represent the major symbols used

in languages world side

65,536 (216) possible characters

ISO

International Organization for Standardization

4,294,967,296 (232) possible characters

1-27

Page 27: Cs160 chapter 1

“HELLO.” IN ASCII

1-28

Page 28: Cs160 chapter 1

REPRESENTING NUMERIC VALUES

Binary: a number system using only the digits 0 (zero) and 1 (one)

Maps well to the internal characteristics of the computer

Limitations of computer representations of numeric values

Overflow: happens when a value is too big to be represented

Truncation: happens when a value is between two representable values

1-32

Page 29: Cs160 chapter 1

REPRESENTING IMAGES

1-33

Bit map techniques

Pixel: short for “picture element”

RGB

Luminance and chrominance

Vector techniques

Scalable

TrueType and PostScript

Page 30: Cs160 chapter 1

SCALABLE VS. BITMAPPED FONTS

1-34

Page 31: Cs160 chapter 1

A SOUND WAVE REPRESENTED BY THE SEQUENCE 0,

1.5, 2.0, 1.5, 2.0, 3.0, 4.0, 3.0, 0

1-35

Page 32: Cs160 chapter 1

1.5 THE BINARY SYSTEM

Data Storage1-36

Page 33: Cs160 chapter 1

THE BASE TEN AND BINARY SYSTEMS

1-37

Page 34: Cs160 chapter 1

DECODING THE BINARY REPRESENTATION 100101

1-38

Page 35: Cs160 chapter 1

FINDING THE BINARY REPRESENTATION OF 13

1-39

Page 36: Cs160 chapter 1

BINARY ADDITION

1-40

Page 37: Cs160 chapter 1

DECODING THE BINARY REPRESENTATION 101.101

1-41

Page 38: Cs160 chapter 1

1-42

There are 10 kinds of people in

the world: those who understand

binary and those who don’t.

Page 39: Cs160 chapter 1

HEXADECIMAL NOTATION

Hexadecimal notation: A shorthand notation for long bit patterns

Divides a pattern into groups of four bits each

Represents each group by a single symbol

Example: 1010 0011 becomes A3

1-43

Page 40: Cs160 chapter 1

THE HEXADECIMAL CODING SYSTEM

1-44

Page 41: Cs160 chapter 1

1-45

How many people can read hex

if only you and DEAD people

can read hex? 57,006

Page 42: Cs160 chapter 1

1.6 STORING INTEGERS

Data Storage1-46

Page 43: Cs160 chapter 1

STORING INTEGERS

Two’s complement notation: The most popular

means of representing integer values

Excess notation: Another means of representing

integer values

Both can suffer from overflow errors.

1-47

Page 44: Cs160 chapter 1

TWO’S COMPLEMENT

1-48

Fixed number of bits

MSB is sign bit

1 = negative

0 = positive

Page 45: Cs160 chapter 1

ENCODING IN TWO’S COMPLEMENT NOTATION

1-49

Page 46: Cs160 chapter 1

ADDITION AND SUBTRACTION USING TWO’S

COMPLEMENT

1-50

Page 47: Cs160 chapter 1

TAKING ISSUE WITH THE BOOK

“The point is that computers

can make mistakes.”-J. Glenn Brookshear, Computer Science, an Overview, p. 54

1-51

Page 48: Cs160 chapter 1

WRONG

Page 49: Cs160 chapter 1

TAKING ISSUE WITH THE BOOK

Computers don’t make

mistakes. They do exactly

what you tell them to.

1-61

Page 50: Cs160 chapter 1

EXCESS NOTATION

Another system of representing signed integers

1. List all bit patterns of a given length

2. Find the first bit pattern with a 1 in the MSB; this will

represent zero

3. Patterns below our zero represent negative number,

patterns preceding it represent positive numbers

1-62

Page 51: Cs160 chapter 1

EXCESS EIGHT CONVERSION TABLE

1-63

Page 52: Cs160 chapter 1

1.7 STORING FRACTIONS

Data Storage1-64

Page 53: Cs160 chapter 1

STORING FRACTIONS

Floating-point Notation: Consists of a sign bit, a

mantissa field, and an exponent field.

Related topics include

Normalized form

Truncation errors

1-65

Page 54: Cs160 chapter 1

FLOATING-POINT NOTATION COMPONENTS

1-66

Page 55: Cs160 chapter 1

ENCODING THE VALUE 25⁄8

1-67