Está en la página 1de 27

Week: Lecture Date:

Course: Instructor: Topic:

05 05/03/2012

Computer Fundamental Dr. Arif Mushtaq Processor/Memory

A generic computer
Processor
Control Control Unit Unit Arithmetic Arithmetic Logic Unit (ALU) Logic Unit (ALU) Instructions Data Information

Input Devices

Data

Memory
Instructions Data Information

Information

Output Devices

Storage Devices
2

Processor
The central processing unit (CPU)
Interprets

and carries out basic instructions that operate a computer


Control unit directs and coordinates operations in computer Arithmetic logic unit Input (ALU) performs Devices arithmetic, comparison, and logical operations

Processor
Control Control Unit Unit Arithmetic Arithmetic Logic Unit (ALU) Logic Unit (ALU) Instructions Data Information

Data

Memory
Instructions Data Information

Information

Output Devices

Also

called the processor

Storage Devices

Processor
What is the machine cycle?

Four operations of the CPU comprise a machine cycle


Step 1. Fetch
Obtain program instruction or data item from memory

Memory

Step 4. Store
Write result to memory
Processor

Step 2. Decode
Translate instruction into commands

ALU

Step 3. Execute
Carry out command

Control Unit

Processor
Pipelining is where

The CPU begins fetching the second instruction before completing machine cycle for first instruction Results in faster processing

Processor
A register is

A temporary high-speed storage area that holds data and instructions


Stores location from where instruction was fetched Stores instruction while it is being decoded Stores results of calculation Stores data while ALU computes it

Processor
The system clock

Controls timing of all computer operations Generates regular electronic pulses, or ticks, that set operating pace of components of system unit

Each tick is a clock cycle

Pace of system clock is clock speed Most clock speeds are in the gigahertz (GHz) range (1 GHz = one billion ticks of system clock per second)

Processor speed can also be measured in millions of instructions per second (MIPS)

Processor
Parallel processing

Using multiple processors simultaneously to execute a program faster Requires special software to divide problem and bring results together

Control Processor

Processor 1
Memory

Processor 2
Memory

Processor 3
Memory

Processor 4
Memory

Results combined

Data Representation
How do computers represent data?

Most computers are digital


Recognize only two discrete states: on or off Use a binary system to recognize two states Use Number system with two unique digits: 0 and 1, called bits (short for binary digits)

Data Representation
A byte is

Eight bits grouped together as a unit Provides enough different combinations of 0s and 1s to represent 256 individual characters
Numbers Uppercase and lowercase letters Punctuation marks Other
10

Data Representation
How is a letter converted to binary form and back?
Step 1.
The user presses the capital letter D (shift+D key) on the keyboard.

Step 2.
An electronic signal for the capital letter D is sent to the system unit.

Step 4.
After processing, the binary code for the capital letter D is converted to an image, and displayed on the output device.

Step 3.
The signal for the capital letter D is converted to its ASCII binary code (01000100) and is stored in memory for processing. 11

Letter a b c d e f g h i j k l m n o p q r s t u v w x y z

ASCII Code 097 098 099 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122

Binary 01100001 01100010 01100011 01100100 01100101 01100110 01100111 01101000 01101001 01101010 01101011 01101100 01101101 01101110 01101111 01110000 01110001 01110010 01110011 01110100 01110101 01110110 01110111 01111000 01111001 01111010

Letter A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

ASCII Code 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087 088 089 090

Binary 01000001 01000010 01000011 01000100 01000101 01000110 01000111 01001000 01001001 01001010 01001011 01001100 01001101 01001110 01001111 01010000 01010001 01010010 01010011 01010100 01010101 01010110 01010111 01011000 01011001 01011010

Moving Information within the Computer


How do binary numerals move into, out of, and within the computer?

Information is moved about in bytes, or multiple bytes called words.


Words are the fundamental units of information. The number of bits per word may vary per computer. A common word length for most computers is 32 bits:

13

Moving Information Within the Computer


Bits that compose a word are passed in parallel from place to place.
Ribbon

cables:

Consist of several wires, molded together. One wire for each bit of the word or byte. Additional wires coordinate the activity of moving information. Each wire sends information in the form of a voltage pulse.

14

Moving Information Within the Computer


Example of sending the word WOW over the ribbon cable

Voltage pulses corresponding to the ASCII codes would pass through the cable.
15

Memory
Memory includes

Electronic components that store instructions, data and results Consists of one or more chips on the motherboard or other circuit board Each byte stored in unique location called an address, similar to seats in a concert hall
16

Memory
How is memory measured?

By number of bytes available for storage


Term Kilobyte Megabyte Gigabyte Terabyte Abbreviation KB or K MB GB TB Approximate Size 1 thousand bytes 1 million bytes 1 billion bytes 1 trillion bytes

17

Memory
What is random access memory (RAM)?
Memory chips that can be read from and written to by the processor(s)
Also called main memory or primary storage Most RAM is volatile, it is lost when computers power is turned off

The more RAM a computer has, the faster it responds


18

Memory
How do program instructions transfer in and out of RAM?
RAM

Step 1. When you start the computer, certain


Operating system interface
operating system files are loaded into RAM from the hard disk. The operating system displays the user interface on the screen.

Operating system instructions

Step 2. When you start a Web browser, the


Web browser instructions Web browser window
programs instructions are loaded into RAM from the hard disk. The Web browser window is displayed on the screen.

Step 3. When you start a word processing


Word processing program instructions
RAM

Word processing program window

program, the programs instructions are loaded into RAM from the hard disk. The word processing program, along with the Web Browser and certain operating system instructions are in RAM. The word processing program window is displayed on the screen.

Step 4. When you quit a program, such as the


Web browser, its program instructions are removed from RAM. The Web browser is no longer displayed on the screen.

Web browser program instructions are removed from RAM

Web browser window is no longer displayed on desktop

19

Memory
dual inline memory module

Where does memory reside?

Resides on small circuit board called memory module Memory slots on motherboard hold memory modules

memory chip

memory slot

20

Memory
Cache

Helps speed computer processes by storing frequently used instructions and data Also called memory cache
L1 cache built into processor L2 cache slower but has larger capacity L2 advanced transfer cache is faster, built directly on processor chip L3 cache is separate from processor chip on motherboard (L3 is only on computers that use L2 advanced transfer cache)

21

Memory
Read-Only Memory (ROM) includes
Memory chips that store permanent data and instructions Three types:
EEPROM (electrically Firmware erasable programmable Manufactured with read-only memory) permanently written Type of PROM data, instructions, containing microcode or information PROM programmer (programmable can erase read-only memory) Blank ROM chip onto which a programmer can write permanently

Nonvolatile memory, it is not lost when computers power is turned off

22

Memory
Access time is

The amount of time it takes the processor to read data from memory Measured in nanoseconds (ns), one billionth of a second It takes 1/10 of a second to blink your eye; a computer can perform up to 10 million operations in same amount of time
Term Millisecond Microsecond Nanosecond Picosecond Speed One-thousandth of a second One-millionth of a second One-billionth of a second One-trillionth of a second

23

BITS
y

Given 1 bit, how many distinct combinations of 1 bit exist? Given 4 bits, how many distinct combinations of 4 bits exist? Given n bits, how many distinct combinations of n bits exist?

BITS
y

A bit can take the values 0 or 1, thus it can describe 2 possibilities or can uniquely identify 2 things. Two bits can take the value 00, 01, 10, 11, thus it can describe four 22 possibilities or can uniquely identify 4 things. n bits can encode 2 power n (2n possibilities).

BITS
y

Assume there are 400 students in this campus. If every student is to be assigned a unique bit pattern, what is the minimum number of bits required to do this? How many more students can be admitted to this campus without requiring additional bits for each students unique bit pattern?

BITS
What is the minimum number of bits required to represent the last four digits of your roll number? y Suppose that for village A, we need 8 bits to represent everyone uniquely. Similarly for village B, we need 9 bits. If both villages are combined into one big village, What is the minimum number of bits required to represent everyone uniquely in the combined village?
y

También podría gustarte