1 computer organization and architecture by dr. ramesh babu dr professor dept. of computer science...
TRANSCRIPT
11
Computer Organization Computer Organization and and
Architecture Architecture
ByByDr. Ramesh Babu DRDr. Ramesh Babu DR
ProfessorProfessorDept. of Computer Science & EngineeringDept. of Computer Science & Engineering
PES Institute of TechnologyPES Institute of Technology
22
ReferencesReferences
1.1. ““Computer Organization”,Carl Hamacher, Computer Organization”,Carl Hamacher, Zvonko Vranesic and Safwat Zaky, Fifth Zvonko Vranesic and Safwat Zaky, Fifth Edition, McGrawHillEdition, McGrawHill
2. “Computer Organization and Design”, Davis A 2. “Computer Organization and Design”, Davis A Patterson & John L Hennessy, Third Edition, Patterson & John L Hennessy, Third Edition, ElsevierElsevier
3. “Computer Architecture: A Quantitative 3. “Computer Architecture: A Quantitative Approach”, John L Hennessy & Davis A Approach”, John L Hennessy & Davis A Patterson Patterson
33
ContentsContents
Today’s Lecture will cover:Today’s Lecture will cover: - Introduction to Computers- Introduction to Computers - Various Application of Computers- Various Application of Computers - Generation of computers- Generation of computers - Classes of Computing Applications- Classes of Computing Applications - Understanding Program Performance- Understanding Program Performance - Below your Program- Below your Program
- High-Level Language to the Language of - High-Level Language to the Language of HardwareHardware
44
Contents Contents
- Inside the Computer- Inside the Computer
- Communication with Other Computers- Communication with Other Computers
- Technologies for Building Processors and - Technologies for Building Processors and MemoriesMemories
- Real Stuff : Manufacturing Pentium 4 - Real Stuff : Manufacturing Pentium 4 ChipsChips
- Basic Operational Concepts - Basic Operational Concepts
55
Definition of a ComputerDefinition of a Computer
What is it? What is it?
A Computer is a machine capable of A Computer is a machine capable of manipulating data in complex, manipulating data in complex, programmable ways.programmable ways.
wikipediawikipedia
66
GenerationsGenerations
• First generation Computer, 1940-1956, defined First generation Computer, 1940-1956, defined by by Vacuum tubesVacuum tubes..
• Second generation Computer, 1956-1963, Second generation Computer, 1956-1963, defined by defined by TransistorsTransistors
• Third generation Computer, 1964-1971, defined Third generation Computer, 1964-1971, defined by by Integrated Circuits (IC)Integrated Circuits (IC)
• Fourth generation computer, 1971-today, Fourth generation computer, 1971-today, defined by defined by MicroprocessorsMicroprocessors
• Fifth generation computer, Present and Beyond, Fifth generation computer, Present and Beyond, defined by defined by Artificial Intelligence (AI)Artificial Intelligence (AI)
77
GENERATION 0 :GENERATION 0 : MECHANICAL COMPUTERS (1642-1945) MECHANICAL COMPUTERS (1642-1945)
AbacusAbacus Pascal’s Mechanical CalculatorPascal’s Mechanical Calculator
88
GENERATION 0 :GENERATION 0 : MECHANICAL COMPUTERS (1642-1945) MECHANICAL COMPUTERS (1642-1945)
Leibniz CalculatorLeibniz Calculator
99
GENERATION 0 :GENERATION 0 : MECHANICAL COMPUTERS (1642-1945) MECHANICAL COMPUTERS (1642-1945)
Programmable devicesProgrammable devices Jacquard’s loomJacquard’s loom
1010
GENERATION 0 :GENERATION 0 : MECHANICAL COMPUTERS (1642-1945) MECHANICAL COMPUTERS (1642-1945)
Babbage’s Difference EngineBabbage’s Difference Engine
1111
First Generation(First Generation(1940-1956)1940-1956)
Stored Program Concept(John von Stored Program Concept(John von Neumann)Neumann)
Vacuum tubesVacuum tubes
1212
Second Generation(Second Generation(1956-1963)1956-1963)
TransistorTransistor Development of programming languages Development of programming languages
(COBOL, FORTRAN)(COBOL, FORTRAN)
1313
Third Generation(1964-1973)Third Generation(1964-1973)
IC technologyIC technology Microprogramming, parallelism, pipeliningMicroprogramming, parallelism, pipelining Cache memory, Virtual memoryCache memory, Virtual memory
1414
Fourth Generation(1973-1985)Fourth Generation(1973-1985)
VLSI technologyVLSI technology MicroprocessorsMicroprocessors LAN, WAN, InternetLAN, WAN, Internet
1515
Beyond the Fourth Beyond the Fourth Generation(1985-??)Generation(1985-??)
AIAI Parallel processingParallel processing NetworkingNetworking
1616
Classes of Computing ApplicationsClasses of Computing Applications
• Desktop ComputersDesktop Computers WorkstationsWorkstations MainframesMainframes SupercomputersSupercomputers MinicomputersMinicomputers• ServersServers• Embedded computersEmbedded computers
1717
Desktop ComputerDesktop Computer
A Computer designed for use by an A Computer designed for use by an individual, usually incorporating a graphics individual, usually incorporating a graphics display, keyboard and mousedisplay, keyboard and mouse
1818
ServersServers
A computer used for running larger A computer used for running larger programs for multiple users often programs for multiple users often simultaneously and typically accessed simultaneously and typically accessed only via networkonly via network
1919
SupercomputersSupercomputers
A class of computers with the highest A class of computers with the highest performance and cost; they are configured performance and cost; they are configured as servers and typically cost millions of as servers and typically cost millions of dollarsdollars
- Tsubame- Tsubame
- Earth simulator- Earth simulator
- Param- ParamSupercomputer
2020
Embedded computerEmbedded computer
A computer inside another device used for A computer inside another device used for running one predetermined application or running one predetermined application or collection of softwarecollection of software
2121
Handheld/Pocket PC PDA Tablet PC
Desktop Laptop
2222
Workstation
2323
Mainframe
2424
Supercomputer
2525
Understanding Program Understanding Program PerformancePerformance
The performance of a program depends on The performance of a program depends on a combination of the effectiveness of the a combination of the effectiveness of the algorithms used in the program, the algorithms used in the program, the software systems used to create and software systems used to create and translate the program into machine translate the program into machine instructions, and the effectiveness of the instructions, and the effectiveness of the computer in executing those instructionscomputer in executing those instructions
2626
Below your ProgramBelow your Program
Application softwareApplication software
System softwareSystem software
HardwareHardware
2727
System SoftwareSystem Software
Software that provides services that are Software that provides services that are commonly useful, including operating commonly useful, including operating system, compilers and assemblerssystem, compilers and assemblers
2828
Operating SystemOperating System
Supervising program that manages the Supervising program that manages the resources of a computer for the benefit of resources of a computer for the benefit of the programs that run on that machinethe programs that run on that machine
2929
ComplierComplier
A Program that translates high-level A Program that translates high-level language statements into assembly language statements into assembly language statementslanguage statements
3030
High-Level Language to the High-Level Language to the Language of HardwareLanguage of Hardware
Assembler – A program that translates a Assembler – A program that translates a symbolic version of instructions into the symbolic version of instructions into the binary versionbinary version
Assembly language A symbolic Assembly language A symbolic representation of machine instructionrepresentation of machine instruction
3131
High-Level Language to the High-Level Language to the Language of HardwareLanguage of Hardware
A portable language such as C, Fortran, or A portable language such as C, Fortran, or Java composed of words and algebraic Java composed of words and algebraic notation that can be translated by a notation that can be translated by a complier into assembly languagecomplier into assembly language
3232
Under the coversUnder the covers
Five Classic components of computerFive Classic components of computer
- Input- Input
- Output- Output
- Memory- Memory
- Datapath- Datapath
- Control Processor- Control Processor
3333
InputInput
A mechanism through which the computer A mechanism through which the computer is fed information, such as the keyboard, is fed information, such as the keyboard, mouse, scanners, etc…mouse, scanners, etc…
3434
Output DeviceOutput Device
A Mechanism that conveys the result of a A Mechanism that conveys the result of a computation to a user or another computercomputation to a user or another computer
3535
Opening the BoxOpening the Box
Motherboard – A plastic board containing Motherboard – A plastic board containing packages of ICs, including processor, packages of ICs, including processor, cache memeory, and connectors for I/O cache memeory, and connectors for I/O devices such as networks and disksdevices such as networks and disks
IC- Also called Chip A device combining IC- Also called Chip A device combining dozens to millions of transistorsdozens to millions of transistors
3636
Opening the BoxOpening the Box
Memory – The storage area in which programs are Memory – The storage area in which programs are kept when they are running and that contains the kept when they are running and that contains the data needed by the running programsdata needed by the running programs
Central Processor Unit (CPU)Central Processor Unit (CPU)
Also called processor. The active part of the Also called processor. The active part of the computer, which contains the datapath and computer, which contains the datapath and control and which adds numbers, tests numbers, control and which adds numbers, tests numbers, signals I/O devices to activate, and so on..signals I/O devices to activate, and so on..
3737
Datapath – The component of the Datapath – The component of the processor that performs arithmetic processor that performs arithmetic operationsoperations
Control – The component of the processor Control – The component of the processor that commands the datapath, memory, that commands the datapath, memory, and I/O devices according to the and I/O devices according to the instructions of the programinstructions of the program
3838
DRAM – Memory built as an integrated DRAM – Memory built as an integrated circuit, it provides random access to any circuit, it provides random access to any locationlocation
Cache Memory – A small, fast memory that Cache Memory – A small, fast memory that acts as a buffer for a slower, larger acts as a buffer for a slower, larger memorymemory
3939
Last week questionLast week question
What is liquid Crystal in LCD display.What is liquid Crystal in LCD display.
Liquid crystal – substance that has Liquid crystal – substance that has properties between those of a properties between those of a conventional liquid and a solidconventional liquid and a solid
4040
Liquid crystal flow like a liquid, but have the Liquid crystal flow like a liquid, but have the molecules in the liquid arranged and oriented in molecules in the liquid arranged and oriented in a crystal-like way.a crystal-like way.
LCD Display is a thin, flat display device made LCD Display is a thin, flat display device made up of any number of color or monochrome pixels up of any number of color or monochrome pixels arrayed in front of a light source or reflector. arrayed in front of a light source or reflector. Each pixel consists of a layer of liquid crystal Each pixel consists of a layer of liquid crystal molecules suspended between two transparent molecules suspended between two transparent electrodes and two polarizing filters, the axes of electrodes and two polarizing filters, the axes of polarity of which are perpendicular to each . polarity of which are perpendicular to each .
4141
A safe place for dataA safe place for data
Memory – The storage area in which Memory – The storage area in which programs are kept when they are running programs are kept when they are running and that contains the data needed by the and that contains the data needed by the running programsrunning programs
Volatile Memory – Storage, such as DRAM, Volatile Memory – Storage, such as DRAM, that only retains only if it is receiving that only retains only if it is receiving powerpower
4242
Nonvolatile memory – A form of memory Nonvolatile memory – A form of memory that retains data even in the absence of a that retains data even in the absence of a power source and that is used to store power source and that is used to store programs between runs. Magnetic disk is programs between runs. Magnetic disk is nonvolatile and DRAM is not.nonvolatile and DRAM is not.
4343
Primary Memory : Also called main Primary Memory : Also called main memory. Volatile memory used to hold memory. Volatile memory used to hold programs while they are running; typically programs while they are running; typically consists of DRAM in today’s computersconsists of DRAM in today’s computers
Secondary Memory : Nonvolatile memory Secondary Memory : Nonvolatile memory used to store programs and data between used to store programs and data between runs; typically consists of magnetic disks runs; typically consists of magnetic disks in today's computersin today's computers
4444
Magnetic disk ( Also called Hard disk )Magnetic disk ( Also called Hard disk )
A form of nonvolatile secondary memory A form of nonvolatile secondary memory composed of rotating platters coated with composed of rotating platters coated with a magnetic recording materiala magnetic recording material
4545
Communicating with other Communicating with other computerscomputers
NetworkNetworkLANLANWANWAN
AdvantagesAdvantages-Communication-Communication- Resource SharingResource Sharing- Nonlocal accessNonlocal access
4646
Technologies for Building Technologies for Building processors and Memoriesprocessors and Memories
Silicon – A natural element which is a Silicon – A natural element which is a semiconductorsemiconductor
Semiconductor – A substance that does not Semiconductor – A substance that does not conduct electricity wellconduct electricity well
4747
Real Stuff: Manufacturing Pentium 4 ChipsReal Stuff: Manufacturing Pentium 4 Chips
Silicon ingotSilicon ingot SlicerSlicer Blank wafersBlank wafers Patterned wafersPatterned wafers Wafer testerWafer tester DicerDicer Tested diesTested dies
4848
4949
Moore’s law in MicroprocessorsMoore’s law in Microprocessors
40048008
80808085 8086
286386
486Pentium® proc
P6
0.001
0.01
0.1
1
10
100
1000
1970 1980 1990 2000 2010Year
Tra
nsi
sto
rs (
MT
)
2X growth in 1.96 years!
Transistors on Lead Microprocessors double every 2 yearsTransistors on Lead Microprocessors double every 2 years
Courtesy, Intel
5050
Metrics to evaluate a ComputerMetrics to evaluate a Computer
MetricsMetrics Speed – delay, frequencySpeed – delay, frequency Power DissipationPower Dissipation Energy to perform a functionEnergy to perform a function CostCost ScalabilityScalability ReliabilityReliability
5151
Basic Operational ConceptsBasic Operational Concepts
To perform a given task, an appropriate To perform a given task, an appropriate program consisting of a list of instruction is program consisting of a list of instruction is stored in the memory. Individual stored in the memory. Individual instructions are brought from the memory instructions are brought from the memory into the processor, which executes the into the processor, which executes the specified operation.specified operation.
5252
Add LOCA, R0Add LOCA, R0
Load LOCA, R1Load LOCA, R1
Add R1, R0Add R1, R0
5353
Connections between the processor and the memory
Processor
Memory
PC
IR
MDR
Control
ALUR
n 1-
R1
R0
MAR
n general purposeregisters
5454
Terms usedTerms used
IR - instruction currently being executedIR - instruction currently being executed PC - memory address of next instruction to PC - memory address of next instruction to
be fetched and executed be fetched and executed MAR - address of location to be accessedMAR - address of location to be accessed MDR - data to be written into or read out of MDR - data to be written into or read out of
the addressed locationthe addressed location Interrupts and ISRsInterrupts and ISRs
5555
Functions…Functions…
Instruction Register :Instruction Register : contains the contains the instruction that is being executed. Its instruction that is being executed. Its output is available to the control circuits, output is available to the control circuits, that generates the timing signals for that generates the timing signals for control of the actual processing circuits control of the actual processing circuits needed to execute the instruction.needed to execute the instruction.
5656
Program Counter : Program Counter : is a register, that is a register, that contains the memory address of the contains the memory address of the instruction currently being executed. instruction currently being executed. During the execution of the current During the execution of the current instruction, the contents of program instruction, the contents of program counter is updated to correspond to the counter is updated to correspond to the address of the next instruction. address of the next instruction.
5757
Memory Address Register (MAR) : Memory Address Register (MAR) : holds holds the address of the memory location to or the address of the memory location to or from which data is to be transferred.from which data is to be transferred.
Memory Data Register (MDR): Memory Data Register (MDR): contains contains the data to be written into or read-out of the data to be written into or read-out of the addressed memory location.the addressed memory location.
5858
General- purpose Registers : General- purpose Registers : are used are used for holding data, intermediate results of for holding data, intermediate results of operations. They are also known as operations. They are also known as scratch-pad registers.scratch-pad registers.
5959
Steps involving instruction fetch Steps involving instruction fetch and executionand execution
INSTRUCTION FETCHINSTRUCTION FETCH
Execution of a program starts by setting Execution of a program starts by setting the PC to point to the first instruction of the the PC to point to the first instruction of the program.program.
The contents of PC are transferred to the The contents of PC are transferred to the MAR and a Read control signal is sent to MAR and a Read control signal is sent to the memorythe memory
6060
The addressed word (here it is the first The addressed word (here it is the first instruction of the program) is read out of instruction of the program) is read out of memory and loaded into the MDRmemory and loaded into the MDR
The contents of MDR are transferred to The contents of MDR are transferred to the IR for instruction decodingthe IR for instruction decoding
6161
INSTRUCTION EXECUTIONINSTRUCTION EXECUTION
The operation field of the instruction in IR is The operation field of the instruction in IR is examined to determine the type of examined to determine the type of operation to be performed by the ALUoperation to be performed by the ALU
The specified operation is performed by The specified operation is performed by obtaining the operand(s) from the memory obtaining the operand(s) from the memory locations or from GP registers.locations or from GP registers.
6262
Fetching the operands from the memory Fetching the operands from the memory requires sending the memory location address to requires sending the memory location address to the MAR and initiating a Read cycle. the MAR and initiating a Read cycle.
The operand is read from the memory into the The operand is read from the memory into the MDR and then from MDR to the ALU. MDR and then from MDR to the ALU.
The ALU performs the desired operation on one The ALU performs the desired operation on one or more operands fetched in this manner and or more operands fetched in this manner and sends the result either to memory location or to sends the result either to memory location or to a GP register. a GP register.
6363
The result is sent to MDR and the address of The result is sent to MDR and the address of the location where the result is to be stored is the location where the result is to be stored is sent to MAR and Write cycle is initiated.sent to MAR and Write cycle is initiated.
Thus, the execute cycle ends for the current Thus, the execute cycle ends for the current instruction and the PC is incremented to point to instruction and the PC is incremented to point to the next instruction for a new fetch cycle.the next instruction for a new fetch cycle.
6464
Bus StructuresBus Structures
BUS – Group of lines (wires) that serves BUS – Group of lines (wires) that serves as a connecting path for several devicesas a connecting path for several devices
Single-bus structure
6565
Data Bus : Data Bus : IIt is used for transmission of t is used for transmission of data. The number of data lines data. The number of data lines correspond to the number of bits in a correspond to the number of bits in a word.word.
Address Bus:Address Bus: it carries the address of the it carries the address of the main memory location from where main memory location from where the data can be accessed.the data can be accessed.
Control Bus:Control Bus: it is used to indicate the it is used to indicate the direction of data transfer and todirection of data transfer and to coordinate coordinate the timing of events during the transferthe timing of events during the transfer
6666
Bus StructuresBus Structures
Single-bus structureSingle-bus structure
Two-bus structureTwo-bus structure
6767
Single-bus structure
MemoryInput Output Processor
• Only two units can actively use the bus at any given time• Devices connected to bus vary in speed
6868
Advantages of Single-Bus StructureAdvantages of Single-Bus Structure
Low CostLow Cost Flexibility for attaching peripheral devicesFlexibility for attaching peripheral devices
Draw BackDraw Back
low operating speedlow operating speed
Found in small computers such as Found in small computers such as minicomputers and microcomputers.minicomputers and microcomputers.
6969
TWO-BUS STRUCTURETWO-BUS STRUCTURE
Input
Output
Processor
Memory
I/O bus
7070
The bus is said to perform two distinct The bus is said to perform two distinct functions by connecting the I/O units with functions by connecting the I/O units with memory and processor unit with memory. memory and processor unit with memory. The processor interacts with the memory The processor interacts with the memory through a memory bus and handles through a memory bus and handles input/output functions over I/O bus. input/output functions over I/O bus.
The main advantage of this structure is good The main advantage of this structure is good operating speed but on account of more operating speed but on account of more cost.cost.
7171
PerformancePerformance
Performance - measure of how quickly Performance - measure of how quickly the computer can execute programsthe computer can execute programs
Speed – Design of Hardware and its Speed – Design of Hardware and its machine Languagemachine Language
Best Performance – Design of compiler, Best Performance – Design of compiler, Machine instruction set, and the hardware Machine instruction set, and the hardware in a coordinated wayin a coordinated way
7272
Mainmemory Processor
Bus
Cachememory
Execution depends on all units in a computer system
Processor Time depends on the hardware involved in the execution of individual machine Instruction
7373
Processor ClockProcessor Clock
Processor circuits are controlled by timing Processor circuits are controlled by timing signal called clocksignal called clock
Clock cycle – regular time intervalClock cycle – regular time interval If P – length of one clock cycle is an If P – length of one clock cycle is an
important parameters that effects important parameters that effects processor performanceprocessor performance
Hertz (Hz) – cycles per second Hertz (Hz) – cycles per second
7474
500 millions cycles per second – 500 MHz500 millions cycles per second – 500 MHz
1250 millions cycles per second – 1.25 GHz1250 millions cycles per second – 1.25 GHz
7575
Basic Performance EquationBasic Performance Equation
T = N x S
R
T – processor time(program execution time)N – number of instruction executionsS – avg. no. of basic steps to execute 1 machine instructionR – clock rate
7676
Instruction SetInstruction Set
RISC ( Reduced Instruction Set Computers)RISC ( Reduced Instruction Set Computers) CISC ( Complex Instruction Set Computers)CISC ( Complex Instruction Set Computers)
7777
7878
Multiprocessors and Multiprocessors and MulticomputersMulticomputers
Shared-memory multiprocessor systemsShared-memory multiprocessor systems Message-passing multicomputersMessage-passing multicomputers