Computer Hardware: Basic Definitions Computer program: A...

32
Computer Hardware: Basic Definitions Programming: The planning, scheduling, or performing of a task or event Computer program: A sequence of instructions for a computer to execute Computer: An electronic, programmable device that can store, retrieve, and process data Modern computers based on the von Neumann architecture Information: General, abstract knowledge Data: Information to be processed by a computer Must be in form computer can understand Computer converts data to information Computer system consists of 2 general components: 1. Hardware 2. Software Units Unit Quantity symbol Bit (binary digit) atomic piece of storage/memory b Byte: 8 bits smallest ”standard” size of storage/data B Second s Hertz Speed H Common prefixes Prefix Value Symbol Quantity Tera 2 40 =1, 099, 511, 627, 776 t memory, speed Giga 2 30 =1, 073, 741, 824 g memory, speed Mega 2 20 =1, 048, 576 m memory, speed Kilo 2 10 =1, 024 k memory, speed Milli 10 -3 (0.001) m time Micro 10 -6 (0.000001) μ time Nano 10 -9 (0.000000001) n time 1

Transcript of Computer Hardware: Basic Definitions Computer program: A...

Page 1: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Basic Definitions

• Programming: The planning, scheduling, or performing of a task or event

• Computer program: A sequence of instructions for a computer to execute

• Computer: An electronic, programmable device that can store, retrieve, and processdata

– Modern computers based on the von Neumann architecture

• Information: General, abstract knowledge

• Data: Information to be processed by a computer

– Must be in form computer can understand

– Computer converts data to information

• Computer system consists of 2 general components:

1. Hardware

2. Software

• Units

Unit Quantity symbol

Bit (binary digit) atomic piece of storage/memory bByte: 8 bits smallest ”standard” size of storage/data BSecond sHertz Speed H

• Common prefixes

Prefix Value Symbol Quantity

Tera 240 = 1, 099, 511, 627, 776 t memory, speedGiga 230 = 1, 073, 741, 824 g memory, speedMega 220 = 1, 048, 576 m memory, speedKilo 210 = 1, 024 k memory, speedMilli 10−3 (0.001) m timeMicro 10−6 (0.000001) µ timeNano 10−9 (0.000000001) n time

1

Page 2: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Basic Definitions (2)

• Approximations

Prefix Approximate Value

Tera ∼ 1012 = 1, 000, 000, 000, 000Giga ∼ 109 = 1, 000, 000, 000Mega ∼ 106 = 1, 000, 000Kilo ∼ 103 = 1, 000

2

Page 3: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Basic Components

• Represents physical components

• 2 general types

– Computer proper

1. Main memory

2. Central Processing Unit (CPU)

3. Bus

– Peripherals

∗ ”Add-ons”

∗ E.g., printer, DVD drive, hard disk

3

Page 4: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Memory - Intro

• Refers to data storage components of computer

• Hierarchy of memory types:

Type Speed Cost Nature

Register fastest most expensive volatileCache volatileRAM slowest least expensive volatileROM nonvolatile

• Volatile memory loses its contents when computer is powered off

• Stores everything used by the computer:programs, data, ...

• Stored electronically

– Standard approach uses bi-stable (two-state) device

– Transistors used - electronic switches

∗ When voltage applied to base, electricity flows from collector to emitter

· Switch is on

∗ No voltage to base, no flow

· Switch is off

– Transistor represents a bit(binary digit) of data

– Each transistor can represent 2 ”values”:

∗ on, and

∗ off

– Values represented as ”1” and ”0”

• Byte considered basic unit of storage

4

Page 5: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Memory - RAM

• RAM stands for Random Access Memory

• Consists of a linear sequence of storage locations (cells, words, ...)

– Each byte has a unique address, numbered from 0 to total amount of memory - 1

– Often, bytes grouped together into words

– Memory generally measured in terms of mega or gigabytes

• RAM is primary storage area for computer during operation

– Often referred to as primary storage, main memory

– Stores both programs and data

• When power turned off, all switches open

– Memory becomes 000000000000000...

– Contents must be loaded during operation

• Physically exists as an array of cells

– Each row and column has a wired connection

– To access a particular memory cell, activate the connections for its row andcolumn

5

Page 6: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Memory - RAM (2)

• Types of RAM

– Dynamic (DRAM)

∗ Electricity stored in a capacitor

∗ Transistor controls amount (voltage) stored

· If greater than about 50% capacity ⇒ 1

· If less than about 50% capacity ⇒ 0

∗ Capacitors lose charge over time (msec)

∗ Computer must refresh value in each bit on a regular basis

· Done thousands of times per second

· Hence: dynamic RAM

– Static (SRAM)

∗ Uses multiple transistors per bit

∗ Value does not need to be refreshed

∗ Compared to DRAM

1. Faster (no need to refresh)

2. More expensive

3. Larger

∗ Hence, not used for main memory

• Typical time to access data: 50 nsec

6

Page 7: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Memory - ROM

• ROM stands for Read Only Memory

• Often called BIOS (Basic Input Output System)

• Data permanently stored - cannot be changed

– Hardwired using diodes

– Stores parts of operating system needed to start computer

7

Page 8: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Seconday Storage - Intro

• Secondary storage refers to ”memory” that is not part of the computer proper

– Examples:

∗ Disks

∗ Tapes

∗ CDR

∗ DVD

∗ Flash memory

• These types of memory are nonvolatile:

– They retain their contents when unpowered

• Without secondary storage, programs, data, etc. would need to be typed into acomputer every time it was turned on

• These devices generally are magnetic or optical in nature

8

Page 9: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Secondary Storage - Magnetic Devices

1. Disks

• Typical disk structure:

• Bits stored as alignments of magnetic particles

– Microscopic magnetic particles have north and south poles

– One alignment corresponds to a ’1’ bit, the other to a ’0’ bit

– Data bits appear sequentially along a track

• Disk addresses consist of track, block, and byte offset

– Block size multiple of 512 bytes

• Data transfer is a whole block at a time

9

Page 10: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Secondary Storage - Magnetic Devices (2)

• Read/write process: Given a disk address to access

– Disk spins

∗ Typically 7200 rpm

∗ 8.33 msec per 1 rotation

– Position arm over appropriate track

∗ Called seek time

∗ E.g., 0.02 msec to move to adjacent track

– Wait until appropriate block rotates under head - latency time (fast)

∗ Called (rotational) latency

∗ E.g., 0.02 msec to move to adjacent track

∗ Best case: 0 msec

∗ Worst case: 8.33 msec

– Read the block

∗ Called read time

∗ Requires 8.33/n msec, where n is number of blocks per track

10

Page 11: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Secondary Storage - Magnetic Devices (3)

• Disk pack

– Set of disks packaged as a rigid unit

– Each arm has 2 read/write heads - one for each adjacent surface

– Actuator moves arms as a unit

– Disk address will include surface

– Cylinder: set of tracks that can be read/written for a given position of theactuator

• Data transfers flow through a buffer

– Part of memory reserved for data transfers

– Usually can hold several disk blocks

– Want efficient data transfer

– Factors that affect transfer speed:

∗ Physical record structure

∗ File organization

∗ Buffer management

11

Page 12: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Secondary Storage - Magnetic Devices (4)

• Disk is a random access device

– Can access disk address independently of others

2. Tape

• Tape has 8 tracks

– Each track stores one bit

– Bytes stored sequentially along tape

• Tape is sequential access device

– Given an address, must pass over all data that precedes it

• Significantly slower than disk

• Used for long-term storage of files

12

Page 13: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Secondary Storage - Optical Devices

• CDR and DVD basically the same

• Structure is similar to disk structure, except have continuous spiral instead of sepa-rate tracks

• Bits stored as differences of reflectivity

– Laser shines on disk

– Light is reflected into a sensor

– Bright interpreted as ’1’, dull as ’0’

• CDROM

– Plastic substrate has bumps burned in with laser

– Shiny aluminum coated over the substrate

– Laser light shining on a bump reflected away from sensor, so appears dark (rep-resenting a ’0’)

– Data cannot be changed

13

Page 14: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Secondary Storage - Optical Devices (2)

• CD-R

– Uses a heat-sensitive, translucent dye instead of bumps

∗ When heated, dye becomes opaque

– To write a ’0’, heat spot on CD with write laser

∗ More powerful than read laser

∗ Read laser not strong enough to affect dye

– Can only be written once

14

Page 15: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Secondary Storage - Optical Devices (3)

• CD-RW

– Uses a phase-change chemical

∗ In crystalline form, is translucent

∗ In amorphous form, is opaque

∗ When melted and cooled quickly, becomes amorphous

∗ When melted and cooled slowly, becomes crystalline

– Initially, compound in crystalline form

– To write a ’0’, melt and cool quickly

– To overwrite a ’0’ with a ’1’, melt and cool slowly

15

Page 16: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Flash Memory

• Flash memory is like ROM on the motherboard

• However, it uses an EEPROM - Eelectronically Erasable Programmable ROM

• Using transistors and quantum effects at the atomic level, a charge can be semi-permanantly stored in a memory cell

• The charge can be removed at a later date

16

Page 17: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Representation

1. Integers (whole numbers)

• Each digit of a binary integer represents a power of 2

• In decimal (base 10), each digit represents a power of 10:182610 = 1× 103 + 8× 108 + 2× 101 + 6× 100

• In binary (base 2), each digit represents a power of 2:101101012 = 1× 27 + 0× 26 + 1× 25 + 1× 24 + 0× 23 + 1× 22 + 0× 21 + 1× 20 =1× 128 + 0× 64 + 1× 32 + 1× 16 + 0× 8 + 1× 4 + 0× 2 + 1× 1 = 18110

• Note that the largest value that can be represented is limited by the amount ofstorage allocated

– If 1 byte is used for integers, the largest integer that can be represented is11111111 = 28 − 1 = 255

– If 2 bytes are used for integers, the largest integer that can be represented is1111111111111111 = 216 − 1 = 65535

• To convert decimal representation to binary: Cast out 2’s

– Steps:

(a) Divide decimal representation by 2

(b) Write down the remainder

(c) Repeat the previous 2 steps, using the quotient for the dividend

(d) Continue until quotient is 0

(e) Write the remainders in the reverse order in which they were calculated

– Example: 5310

(a) 53/2 = 26R1

(b) 26/2 = 13R0

(c) 13/2 = 6R1

(d) 6/2 = 3R0

(e) 3/2 = 1R1

(f) 1/2 = 0R1

(g) Answer = 110101

17

Page 18: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Representation (2)

• Negative integers are represented using a leading ’1’

– One’s complement

∗ A leading ’1’ means a negative number

∗ A leading ’0’ means a positive number

∗ Remaining digits interpreted as above

∗ Example: 101101012 =− (0× 26 + 1× 25 + 1× 24 + 0× 23 + 1× 22 + 0× 21 + 1× 20) =− (1× 128 + 0× 64 + 1× 32 + 1× 16 + 0× 8 + 1× 4 + 0× 2 + 1× 1) =− 5310

∗ There is a problem with this representation:10000002 = −010

00000002 = +010

– Two’s complement

∗ Developed to eliminate above problem

∗ To represent an integer in two’s complement representation:

(a) Write the binary representation as usual

(b) Flip all the digits (1 → 0, 0 → 1)

(c) Add 1

∗ Example: −5310

(a) Binary representation of +53: 00110101

(b) Flip all the digits: 11001010

(c) Add 1: 11001011

– Note that using either approach cuts the size of the largest integer that canbe represented in half

∗ One’s complement:

· Largest positive integer (1 byte): 01111111 = 12710

· Smallest negative integer (1 byte): 11111111 = −12710

∗ Two’s complement:

· Largest positive integer (1 byte): 01111111 = 12710

· Smallest negative integer (1 byte): 10000000 = −12810

18

Page 19: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Representation (3)

2. Floating point (real) numbers

• Represented using scientific notation:32.746× 107 = 327, 460, 000

• In the computer, only the values are stored:sign mantissa sign exponent

• Since storage is of fixed size, a fixed set of bits are used for the mantissa andexponent

• In addition, the decimal point is assumed to be in a specific location

• For example (base 10):

(a) Assuming decimal is in front of first digit of mantissa

(b) 4 digits for mantissa

(c) 2 digits for exponent327, 460, 000 = .32746× 109 → +3274 + 09

• This leads to loss of precision (inability to represent all digits in original)

• It increases the range of values that can be represented:

– Largest value: 9999× 1099

– (As opposed to 9999999 in decimal using 8 digits)

• Binary representation is used for mantissa, exponent, and signs in the computer

19

Page 20: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Representation (4)

3. Characters

• There is no direct correlation between printable characters and binary represen-tation

• Arbitrary codes are used

• ASCII (American Standard Code for Information Interchange)

– Standard code for representing characters

– Uses 7 bits

– ’A’ represented by 6510 = 01000001

– ’a’ represented by 9710 = 01100001

– ’1’ represented by 4910 = 00110001

• Note: Character ’1’ not the same as the integer 1

• Unicode

– Extension of ASCII

– Uses up to 4 bytes

• EBCDIC

– IBM standard for mainframes

4. Parity bits

• Extra bit to help insure data integrity

• Odd parity means the number of 1’s in a byte will add to an odd number

• The parity bit is set to insure this is the case

• For example:00110101 → 10011010100110100 → 000110100

• If an extended byte does not have the proper parity, an error has occured

20

Page 21: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Representation (5)

5. Hexadecimal

• Used to simplify representation of binary values

• Hexadecimal is base 16

• Requires 16 digits

– Uses letters in addition to the digits 0 - 9

hex digit 0 1 2 3 4 5 6 7 8 9 A B C D E Fvalue 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

– Every byte can be represented by a pair of hex digits

– Example:110100102 is represented as 1101 = 1310 = D, 0010 = 210 = 2, or D216

21

Page 22: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Central Processing Unit (CPU)

• ”Brains” of computer

• Components:

1. Registers

– Special high-speed memory cells local to the CPU

2. Arithmetic Logic Unit (ALU)

– Performs computations

3. Control unit (CU)

– Controls operation of the system

22

Page 23: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: Central Processing Unit (CPU) (2)

• Operation based on von Neumann architecture

1. Computer composed of following systems

(a) Memory

(b) CPU

(c) IO system

2. Programs are stored in memory

3. Program statements are executed sequentially

23

Page 24: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: CPU - Registers

• Storage local to CPU

• High-speed memory directly accessible to CPU components

• Examples:

1. General purpose registers to hold operands and results of computations

2. Accumulator - Specially designated register for operands and results

3. 0

4. +1

5. -1

6. Memory Address Register (MAR)

– Stores address of memory location to be accessed

– Must be large enough to store largest address in memory address space

– E.g., 4GB = 230 memory requires 31 bits

7. Memory Data Register (MDR)

– Stores data to be retrieved from or saved to memory

– One or more bytes in width

8. Instruction Register (IR)

– Holds instruction being executed

– Must be large enough to hold largest instruction

– E.g., 4, 8, 16 bytes

9. Program Counter (PC)

– Holds address (in memory) of next instruction to be executed

– Must be large enough to store largest address of memory reserved for holdingprograms

24

Page 25: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: CPU - ALU

• Types of operations performed:

– Arithmetic

∗ Addition

∗ Subtraction

– Logic

∗ AND

1 0

1 1 00 0 0

∗ OR

1 0

1 1 10 1 0

∗ NOT

1 00 1

∗ EXCLUSIVE OR

1 0

1 1 00 0 1

– Shifts

∗ Shift left11001010 ⇒ 10010100

∗ Shift right11001010 ⇒ 01100101

∗ Rotate left11001010 ⇒ 10010101

∗ Rotate right11001010 ⇒ 01100101

25

Page 26: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: CPU - ALU (2)

• Operands can be loaded from registers, or from elsewhere

• Results can be stored into a register, or elsewhere

• The control line selects the operation to be performed

• Can be designed to perform more complex operations

– But requires more circuitry

26

Page 27: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: CPU - CU

• Manages operation of computer

• Operates using following cycle

1. Retrieve instruction from memory

(a) This step referred to as a fetch

(b) A copy of the instruction is loaded into the IR

(c) Increment the PC

– It now holds the address of the next instruction to be executed

2. Decode the instruction

– Each instruction is in binary format

– Instructions of form opcode operands

– There is one opcode for each specific operation the CPU can perform

– Operands may take the form of actual values (e.g., 105, ’c’) or addresses (wherevalues are stored)

– Instructions may have from 0 to 3 operands

– For example:

10100101 01100000

11010101 00000110

10000101 01100001

∗ 8 bit opcode, 8 bit operand

∗ Performs x = y + 6

27

Page 28: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: CPU - CU (2)

– The instruction decoder circuit reads the opcode of the instruction

– The circuitry of this decoder converts the opcode into signals that carry outthe execution of the instruction; e.g.

∗ To add the contents of 2 registers and store the results into another register

∗ To load the value at a particular memory address into the MDR

– The signals enable various bus lines and devices needed for the task

3. Execute instruction

– The circuitry carries out the task

28

Page 29: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: CPU - Memory Access

• Execution may require transfer of data between memory and CU

– Fetch (read)

1. Load address into MAR

2. Copy contents of address into MDR

3. A fetch is non-destructive - contents of address are unaffected

29

Page 30: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: CPU - Memory Access (2)

– Store (write)

1. Load address into MAR

2. Load value into MDR

3. Copy contents of MDR into address

4. A write is destructive - original contents of address are lost

30

Page 31: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: CPU - Cache Memory

• To speed up processing, CPU may have cache memory

• This is high-speed memory local to CPU

– Access time about 10 ns

• Generally a few KB in size

• Operation based on Principle of Locality:

– What has been recently accessed is likely to be accessed again in near future

• Used as follows:When CPU needs something from memory

Search cache for itemif not found in cache

retrieve from main memorystore in cache

• To see how it improves speed:

– Assume memory fetch requires 50 ns

– Assume memory fetch requires 10 ns

– Assume data will be found in cache 60% of the time

– Average time to fetch a piece of data:(0.60× 10) + (0.4× (10 + 50)) = 6 + 24 = 30 ns on average

• Why not use cache for RAM if so fast?

– Expensive

31

Page 32: Computer Hardware: Basic Definitions Computer program: A ...djmoon/cisf/cisf-notes/cisf-hardware.pdf · Computer Hardware: Secondary Storage - Magnetic Devices (3) • Disk pack

Computer Hardware: CPU - Processing Speed

• Speed measured in

– Hertz (mega, giga)

∗ This refers to how fast the system clock ticks

– MIPS (Millions of Instructions Per Second)

∗ May require more than one clock tick per instruction

– FLOPS (FLOating Point operations per Second)

∗ Considered a more realistic measurement of speed

• The system clock controls the speed at which instructions are executed

– In general, each major step in CPU takes one clock cycle:

∗ Fetch

∗ Decode

∗ Execute

∗ Fetch data from memory

∗ Write result to memory

• Bus width affects transfer speeds

– If bus width is 16 bits, but data is 32 bits, requires 2 memory fetches

32