Sunteți pe pagina 1din 5

A generic computer

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

Week: Lecture Date:


Course: Instructor: Topic:

05 05/03/2012
Input Devices
Data

Computer Fundamental Dr. Arif Mushtaq Processor/Memory

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

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

Data

Memory
Instructions Data Information

Information

Output Devices

Step 4. Store
Write result to memory
Processor

Step 2. Decode
Translate instruction into commands

Also called the processor

ALU

Step 3. Execute
Carry out command

Control Unit

Storage Devices

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

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

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)

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.

Letter a b c d e f

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

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

g h i j k l m n o p q r

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.

s t u v w x

11

y z

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:

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.

13

14

Moving Information Within the Computer


Example of sending the word WOW over the ribbon cable

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
15 16

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

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

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 volatile, when computers power is turned off

The more RAM a computer has, the faster it responds


17 18

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

Memory
dual inline memory module

Where does memory reside?


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

Step 1. When you start the computer, certain


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

Operating system instructions

Operating system interface

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 Word processing program window
RAM

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.

memory chip

memory slot

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

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)

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

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

21

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

BITS
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?
23

Speed One-thousandth of a second One-millionth of a second One-billionth of a second One-trillionth of a second

BITS
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
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? 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?

S-ar putea să vă placă și