70
1 CS1010 Introduction to Computing Lecture 04 Computer Hardware (Microprocessor and Memory)

Lec 04 Computer Hardware (CPU Memory)

Embed Size (px)

DESCRIPTION

This is the best document for the information of the hardware and its componets you shoudl definitely read it as it is a good presentation from me i can upload more if u like.

Citation preview

Page 1: Lec 04 Computer Hardware (CPU Memory)

1

CS1010 Introduction to Computing

Lecture 04Computer Hardware

(Microprocessor and Memory)

Page 2: Lec 04 Computer Hardware (CPU Memory)

TODAY’S LECTURE• Today we learn about the microprocessor, the

key component, the brain of a computer.

• We will learn about the function/building blocks of a microprocessor and its various sub-systems.

• We also familiarize with memory and its functions.

Page 3: Lec 04 Computer Hardware (CPU Memory)

MICROPROCESSOR

Page 4: Lec 04 Computer Hardware (CPU Memory)

MICROPROCESSOR• A microprocessor is a computer processor on a microchip. Its

sometime called logic chips or CPU.

• A microprocessor is designed to perform all calculations, decision making and control functions.

• Today’s state of the art processors including Pentium, Athalon, powerpc, etc, they are very complex circuits, it has tens of millions of transistors.

• They work at ultra fast speed, many can perform more than 1 billions operations per second.

• These all microprocessors are made up of same material, which is semi-conductor means they are made up of silicon.

Page 5: Lec 04 Computer Hardware (CPU Memory)

• A microprocessor is designed to perform:– Arithmetic calculations– Logic operations– Use small number-holding areas called registers.

• Microprocessor operations include:– Adding– Subtracting– Comparing two numbers– Fetching numbers from one area to another.

Page 6: Lec 04 Computer Hardware (CPU Memory)

• When computer in turned on, the microprocessor is designed to get the first instruction from the basic input/output system (BIOS) that comes with the computer as a part of its memory.

• BIOS loads operating system into computer memory.

• A microprocessor is made from miniaturized transistors and other circuit elements on a single semiconductor integrated circuit (IC). These are made up of semiconductor and silicon.

Page 7: Lec 04 Computer Hardware (CPU Memory)

INTEGRATED CIRCUITS• A microprocessor is an integrated circuit made up

of silicon.

• A chip is also called IC (aka microchip or just chip).

• An IC is collection of several electronic components and these all components are miniaturized.

• One electronic component is millionth of a meter, means it is in microns. The thickness of human hair is 100 um (microns).

Page 8: Lec 04 Computer Hardware (CPU Memory)

these components are…• The components of IC

– Transistors– Resistors– Diodes– Capacitors– Wiring

• In any IC the most area covered is by its wiring(means that part of conductor who carry signal from one point to another).

Page 9: Lec 04 Computer Hardware (CPU Memory)

TRANSISTORS• In digital circuits, transistors are used as very

fast electrical switches, and arrangements of transistors can function as logic gates.

Page 10: Lec 04 Computer Hardware (CPU Memory)
Page 11: Lec 04 Computer Hardware (CPU Memory)

MATERIALS• The materials used in IC are:

– Silicon – semiconductor– Copper – conductor (wires, the connecting

path are made up of coppers)– Silicon Dioxide - insulator

Page 12: Lec 04 Computer Hardware (CPU Memory)

SILICON

Page 13: Lec 04 Computer Hardware (CPU Memory)

MICROPROCESSOR SYSTEM• Microprocessor System is different then

microprocessor as the body is different then the brain.

• If we have the brain, but do not have hands, feet, then what is the benefit of this brain.

• Similarly, if we have microprocessor but do not have input, output and storage devices then this microprocessor is useless.

Page 14: Lec 04 Computer Hardware (CPU Memory)

• So in Microprocessor system, the major component is microprocessor, other components are input, output, storage and memory. Collectively it become Microprocessor system.

• Personal computer is one very popular example of Microprocessor System, another example of Microprocessor system is Micro-controllers.

Page 15: Lec 04 Computer Hardware (CPU Memory)

MICRO-CONTROLLERS• Micro-controller is a type of microprocessor system.

• The special thing is in micro-controller system these are all components i.e. microprocessor, memory of the program (ROM), memory of the data (RAM), I/O lines to communicate with peripherals & complementary recourses is on one chip.

• Means a complete computer on a chip.

• Micro-controllers are found in almost any electrical device e.g. washing machines, microwave ovens and in toaster etc…

Page 16: Lec 04 Computer Hardware (CPU Memory)
Page 17: Lec 04 Computer Hardware (CPU Memory)

MAIN MEMORY BOTTLENECK• Microprocessor speed as compare to memory are quite

faster. Today’s microprocessors can perform 1 operation in 1 nanosecond ((10-9) or 1 billionth of a second), but the memory is respond in 100 nanosecond.

• It means if microprocessor say to memory it needs data, it can say it in 1 nanosecond, but he will get the response from memory in 100 nanoseconds or more. It means today’s slow memory making efficiency of a microprocessor less.

• It means microprocessor who are capable to perform at high speed due to slow memory are performing at low speed.

Page 18: Lec 04 Computer Hardware (CPU Memory)

• To fully efficiently perform the speed of microprocessor, then we have to search a method through which microprocessor quickly access the memory.

• Solution: Invent that memory who work at the speed of microprocessor, if microprocessor respond in 1 nanosecond, then memory also respond in one nanosecond. There exist such memory. But the key issue in proposed solution is they are very expensive.

Page 19: Lec 04 Computer Hardware (CPU Memory)

• Alternate solution is on the same chip we put very high speed memory, means 1 nanosecond response time memory. The benefit of this is data will be available on same speed at which microprocessor work. To make this solution effective, the memory we put on the same chip, insert those data and instructions, which microprocessor need so often. 90 % of time microprocessor need same data and instructions.

• So, 90 % of time, microprocessor will not fetch data & instructions from outside, in-fact the memory which is located near it, 90 % of time it get data & instruction from the memory which is near it on the same chip.

Page 20: Lec 04 Computer Hardware (CPU Memory)

ON-CHIP(L1) CACHE MEMORY• So, the 90 % of time microprocessor is working at full speed.

• So, this small, super fast memory that we locate on the same chip is called On-Chip(L1) Cache Memory. The frequently used data and instructions reside on the on-chip cache memory.

• So, whenever microprocessor needs data or instructions, its check in cache memory, if they don’t find those data & instructions then it checks the main memory.

• The size of cache memory is small 8KB to 64KB and its one of the building blocks that is located on a microprocessor.

Page 21: Lec 04 Computer Hardware (CPU Memory)

Registers

Registers

Microprocessor

InstructionCache(L1)

Arithmetic& Logic

Unit

ControlUnitBus

InterfaceUnit

DataCache(L1)

InstructionDecoder

I/O

RAM

MemoryBus

SystemBus

FloatingPointUnit

Page 22: Lec 04 Computer Hardware (CPU Memory)

CACHE MEMORY• L2, cache memory, which is on a separate

chip from the microprocessor.

• It is the small size and proximity to the microprocessor makes access times short, resulting in a boost in performance.

• It is an extremely fast, small memory between CPU and MAIN MEMORY whose access time is closer to the processing speed of the CPU.

• Cache is pronounced as “cash”.

Page 23: Lec 04 Computer Hardware (CPU Memory)
Page 24: Lec 04 Computer Hardware (CPU Memory)
Page 25: Lec 04 Computer Hardware (CPU Memory)

BUS INTERFACE UNIT• The Bus Interface unit is the hub of communication between

microprocessor and outside world. The data & instruction coming from memory and I/O devices interact with Bus Interface Unit.

• Bus interface unit first of all identify these data & instruction that either these are data or instructions. If it is data then it send to data cache, if it is instruction then it send it to instruction cache.

• Similarly processed data in registers will be send to data cache from there it comes to bus interface unit, and send out from the processor.

• So, the bus interface unit do both works, it received data & instruction and send data out from the processor as well.

Page 26: Lec 04 Computer Hardware (CPU Memory)

INSTRUCTION DECODER • Instruction decoder analysis the instruction,

which comes from instruction cache and decide these instructions will be send to ALU or FPU.

• It also simplify the instructions so that ALU or FPU understand it easily. Means it converts complex instructions into simple instructions.

Page 27: Lec 04 Computer Hardware (CPU Memory)

ARITHMETIC & LOGIC UNIT(ALU) • Also known as “Integer Unit”.

• In this building block mostly computations of microprocessor took place for example add, subtract, divide & multiply.

• Comparison is also took place here for example A is greater than B or A is less than B.

• Logical operations also took place.• e.g. A AND B, A OR B.

Page 28: Lec 04 Computer Hardware (CPU Memory)

• Three types of operations took place here:– Arithmetic– Logic– Comparison.

• Modern microprocessors have two and more ALU, the benefit of it two instructions can compute simultaneously.

Page 29: Lec 04 Computer Hardware (CPU Memory)

FLOATING POINT UNIT (FPU)• Another computation unit that found in modern

microprocessor is FPU. Also known as Numeric Unit. ALU only deals with integers, the FPU deals with floating point numbers.

• Floating point numbers are those numbers which involved decimals or fractions.

• Through FPU you can store very very large and small numbers in compact form.

• So, FPU work is to multiply, divide, subtract or add fraction numbers.

Page 30: Lec 04 Computer Hardware (CPU Memory)

NOTE• FPU’s have importance when you are doing graphics

calculations, design engineering software or scientific software.

• All those work which FPU perform, ALU also perform the difference is if FPU do it 1 machine cycle, then ALU can perform same job in 100 machine cycles.

• So, without FPU, your processor can work, but it really slow down the speed.

• In previous generations many microprocessors do not have FPU.

Page 31: Lec 04 Computer Hardware (CPU Memory)

REGISTERS• The registers are attached with ALU & FPU, they are

super fast memory like cache.

• When ALU & FPU are doing some calculations, then they store their intermediate calculations in registers on a temporary basis. Those calculation, which results you need after some time.

• When the calculation is finished, then this processed data from registers goes to data cache and then to bus interface unit from there either it goes out to memory or I/O devices.

Page 32: Lec 04 Computer Hardware (CPU Memory)

• Registers are part of the CPU (not main memory) of a computer.

• The length of a register, sometimes called its word size, equals the number of bits it can store.

Page 33: Lec 04 Computer Hardware (CPU Memory)

COMMONLY USED REGISTERS

Page 34: Lec 04 Computer Hardware (CPU Memory)

CONTROL UNIT• Control unit is like a brain or heart of any

microprocessor.

• Its most complex element of any microprocessor.

• Control unit is like, in war a field marshal or general is.

• If instructions come, the CU generate its order.• If data have to come, the CU generate its order.

• It manages whole process of microprocessors.

Page 35: Lec 04 Computer Hardware (CPU Memory)

PROCESSOR MANUFACTURERS• The leading manufacturer of personal

computer processor chips are Intel and AMD.

Used in Server

Computers

Page 36: Lec 04 Computer Hardware (CPU Memory)

PROCESSOR HEAT• A processor chip generates heat that could

cause the chip to burn up.

• Require additionalcooling:• Heat Sinks Fan• Liquid Cooling Technology

Page 37: Lec 04 Computer Hardware (CPU Memory)

LANGUAGE OF A MICROPROCESSOR• The language of microprocessor is called Instruction Set.

• The instructions must be structured. In instructions set there are command which a microprocessor can understand and execute.

• These instructions are simple.

• Different microprocessor have different instruction sets for example powerpc microprocessor instruction set is difficult then Pentium microprocessor instruction set.

Page 38: Lec 04 Computer Hardware (CPU Memory)

MACHINE CYCLES• Each time the CPU executes an instruction. It

takes a series of steps. The completed series of steps is called a machine cycle.

• A machine cycle itself can be broken down into two smaller cycles:– Instruction cycle– Execution cycle

Page 39: Lec 04 Computer Hardware (CPU Memory)

• During the instruction cycle, the CPU takes two steps:

– Fetching: Before the CPU can execute an instruction, the CU must retrieve (or fetch) a command or data from computer’s memory.

– Decoding: Before a command can be executed, the CU must break down (or decode) the command into instructions that correspond to those in the CPU’s instruction set.

Page 40: Lec 04 Computer Hardware (CPU Memory)

• At this point, the CPU is ready to begin the execution cycle:

– Executing: When the command is executed, the CPU carries out the instructions in order by converting them into microcode.

– Storing: The CPU may be required to store the results of an instruction in memory.

Page 41: Lec 04 Computer Hardware (CPU Memory)

MACHINE CYCLESRAM

Play Sound

Control UnitInstruction 1Instruction 2Instruction 3

Steps: 1. Play sound is sent from RAM to CPU.(Fetch)2. Control Unit breaks the command into

instruction set the CPU can handle.(Decoding)

System Bus

Play sound sent over bus to CPU.

RAM

Play Sound

Control UnitInstruction 1Instruction 2Instruction 3

Steps: 1. Control Unit executes instruction 1-3.

(Executing)2. Command is sent over system bus to

sound card.(Storing)

System Bus

CPU tells sound card to play sound.

Sound Card

Page 42: Lec 04 Computer Hardware (CPU Memory)

PIPELINING• Processors starting from Intel Pentium 3 & 4 support Pipelining.

In some & obsolete computers, the CPU processes only one instruction at one time. i.e., the CPU waits until an instruction completes all four stages of the machine cycle before beginning work on the next instruction.

• With Pipelining, the CPUbegins executing a secondinstruction before it completes

the first instruction. Pipeliningresults faster processingbecause the CPU does nothave to wait for oneinstruction to complete

Page 43: Lec 04 Computer Hardware (CPU Memory)

WORD SIZE• The length of register equals the number of

bits it can store. Hence, a register that can store 8 bits is normally referred to as 8-bit register.

• The size of registers is sometimes called the word size.

• The biggest the word size, the fastest the computer can process a set of data.

Page 44: Lec 04 Computer Hardware (CPU Memory)

• The Intel 4004 dealt with data in chunks of 4-bits at a time.

• Pentium 4 deals with data in chunks (words) of 32-bit length.

• Modern processor deals with 64-bits, and 128-bits.

Page 45: Lec 04 Computer Hardware (CPU Memory)

THE COMPUTER’s INTERNAL CLOCK• Every microcomputer has a system clock. The pace of

the system clock is called the clock speed, and is measured in gigahertz.

• When electricity applied, the molecules in the crystal vibrate millions of times per second.

• Example: First PC operated at 4.77 mega hertz.

• Hertz = measure of cycles per second.• Megahertz = millions of cycles per second.• Gigahertz = Billions of cycles per second.

Page 46: Lec 04 Computer Hardware (CPU Memory)
Page 47: Lec 04 Computer Hardware (CPU Memory)

• 10 hertz means 10 cycles per second. Therefore, a CPU running at 900 MHZ means 900 millions cycles will occur per second.

• Example:– Intel 80286 microprocessor requires 20 cycles to

multiply two numbers. Clock frequency = 12.5 MHz

– Intel 80486 or later microprocessor can perform the same calculation is single cycle.

• The latest processors have clock frequency in GHz.

Page 48: Lec 04 Computer Hardware (CPU Memory)

ARCHITECTURE OF PROCESSORType of

Architecture Usage. Processors

CISC (Complex Instruction Set

Computer)

Mostly used in Personal

Computers.32 – Bit

microprocessor

RISC (Reduced Instruction Set)

Mostly used in workstations.

32 – Bit microprocessor

EPIC (Explicitly Parallel

Instruction Computing)

Mostly used in high-end servers

and workstations.64 – Bit

microprocessor

Multi-Core Processor

Mostly used in high-end servers

and workstations.Multiple separate core on same chip

Page 49: Lec 04 Computer Hardware (CPU Memory)

MULTI-CORE PROCESSORS• Dual-core refers to a CPU that includes two

complete execution cores per processor.

• It has combine two processors and their caches and their controllers onto a single chip.

• They each have their own datapath and logic units.

• Example: If you are running a virus scan, and a word processor, you can set the virus scan to only run through one core, and word processor to work on the other core.

Page 50: Lec 04 Computer Hardware (CPU Memory)

Multi-core Processor

Dual-core Processor

Quad-core Processor

Page 51: Lec 04 Computer Hardware (CPU Memory)

THE 1st MICROPROCESSOR: INTEL 4004• Introduced in 1971.• 2250 Transistors• 4-bit word length• 10-micron process• Size was 1/6th of an inch x 1/8th of an inch.• As powerful as the ENIAC which has 19000

tubes and occupied a large room.• Cost of this processor was 100 $.• Targeted use: Calculators

Page 52: Lec 04 Computer Hardware (CPU Memory)

INTEL PENTIUM-IV (2.2 GHz)• Introduced December, 2001• 55 million transistors• 32-bit word length( manipulate 4 word)• 20 KB L1 Cache.• 2 ALU’s, each working at 4.4 GHz• 128-bit FPU• 0.11 micron process (smallest electronic

component size)• Targeted use: PC’s and workstations• Cost: around 600 $

Page 53: Lec 04 Computer Hardware (CPU Memory)
Page 54: Lec 04 Computer Hardware (CPU Memory)

ENHANCING THE CAPABILITY OF A MICROPROCESSOR

• The computing capability of a microprocessor can be enhanced in many different ways:

– By increasing the clock frequency.– By increasing the word-size.– Having more effective caching algorithm and right

cache size.– By increasing the RAM.– By adding more functional units (e.g. ALU’s, FPU, etc)– Improving the architecture (e.g. if a task is perform in

3, 4 cycles, it performs in 1 or 2 cycles)

Page 55: Lec 04 Computer Hardware (CPU Memory)

MOORE’S LAW• Gordon Moore who was the co-founder of

Intel published a paper in 1965.

• Stating in effect that at our rate of technological development and advancement in industry the complexity of integrated circuits double every year.

• Their prediction is still valid.

Page 56: Lec 04 Computer Hardware (CPU Memory)
Page 57: Lec 04 Computer Hardware (CPU Memory)

MEMORY

Page 58: Lec 04 Computer Hardware (CPU Memory)
Page 59: Lec 04 Computer Hardware (CPU Memory)

RANDOM ACCESS MEMORY (RAM)• Primary storage of a computer is often referred to as RAM

because of its random access capability.

• RAM’s are volatile memory.

• A computer’s motherboard is designed in a manner that the memory capacity can be enhanced by adding more memory chips.

• RAM is the place in computer, whereOS, application programs and datain current use are kept. So that theycan be quickly reached by processor.

Page 60: Lec 04 Computer Hardware (CPU Memory)

• RAM is considered “random access” because you can access any memory cell directly.

• Every byte in RAM has an address.00000000 0000000000000000 00000001

00000000 00000010 ………11111111 11111111

Page 61: Lec 04 Computer Hardware (CPU Memory)
Page 62: Lec 04 Computer Hardware (CPU Memory)

More RAM = Better Performance!

Page 63: Lec 04 Computer Hardware (CPU Memory)
Page 64: Lec 04 Computer Hardware (CPU Memory)

TYPES OF RAM

Page 65: Lec 04 Computer Hardware (CPU Memory)

SRAM• SRAM is a type of memory that is faster and more

reliable than the common DRAM (Dynamic RAM).

• The term static is derived from the fact that it doesn’t need to be refreshed like DRAM.

• Access time is around 10 nanoseconds.

• Both SRAM and DRAM are volatile, means that they lose their contents when the power is turned off.

Page 66: Lec 04 Computer Hardware (CPU Memory)

DRAM• Dynamic RAM needs to be refreshed

thousands of times per second.

• The term dynamic indicates that the memory must be constantly refreshed.

• Access time is around 60-70 nanoseconds.

• DRAM is slower than SRAM.

Page 67: Lec 04 Computer Hardware (CPU Memory)

CAPACITY OF RAM

Page 68: Lec 04 Computer Hardware (CPU Memory)

ACCESS TIME OF RAM

Page 69: Lec 04 Computer Hardware (CPU Memory)

READ ONLY MEMORY (ROM)• ROM is a non-volatile memory chip.• Data stored in ROM can only be read.• ROM memory typically stores the instructions

which is known as BIOS/system boot program.

• BIOS loads operating system into computer memory, check systemhardware, like memory, I/Odevices etc are functioningproperly.

Page 70: Lec 04 Computer Hardware (CPU Memory)

TYPES OF ROMsType Usage.

Manufactured-Programmed ROM Data is burnt by the manufacturer of the electronic equipment in which it is used.

User-programmed ROM or Programmable ROM (PROM)

User can load and store “read-only” programs and data in it.

Erasable PROM (EPROM)User can erase information stored in it and the

chip can be reprogrammed to store new information.

Ultra Violet EPROM (UVEPROM)A type of EPROM chip in which information is erased by exposing the chip for some time to

ultra-violet light.

Electronically EPROM (EEPROM) A type of EPROM chip in which the stored

information is erased by using high voltage electric pulses.