chap1.3 CPU

Embed Size (px)

Citation preview

  • 8/12/2019 chap1.3 CPU

    1/4

    UNIT 2: 2.1 CPU (CENTRAL PROCESSING UNIT)

    CPU is the brain of the computer

    All major calculations and comparisions performed by the computer are

    carried out inside the its CPU.

    CPU is responsible for activating can controlling the operation of other units

    of the computer system.

    In order to understand the capability of a computer it is important to

    understand how CPU is structured internally.

    How CPU differ from each other

    How CPU speed is evaluated

    Two basic components of CPU are the control unit and arithmetic logic unit.

    C!T"# U!IT

    It has a number of registers$

    %. Instruction register which holds the current instruction that is being e&ecuted.

    '. Program Control register holds the ne&t instruction to be e&ecuted.(. )ecoder has the circuitry to decode and interpret the meaning of each and every

    instruction.

    A#U *A"ITH+,TIC #-IC U!IT

    The A#U is the place where actual e&ecution of the instruction ta/es place during thedata processing operation. 0hen the control unit encounters an instruction that involvesan arithmetic operation *such as add1 subtract1 multiply1divideor logic operation *213 14

    etc

    In case of a microcomputer 1 the entire CPU *both the control unit and the A#U iscontained on a single tiny silicon chip called a microprocessor.

    Instruction set:

    ,very CPU has a built in ability to e&ecute a particular set of machine instructions

    calledits instruction set. +ost CPUs have '55 or more instructions in their instruction set.CPU made by different manufacturers have different instruction set. Also1 different CPU

    model of the same manufacturer also often have different instruction set.

    To speed up the rate of information transfer1 the computer uses a number of special

    registers

  • 8/12/2019 chap1.3 CPU

    2/4

    *a +A" 6 +emory address register7 it holds the address of the active

    memory location*b +8"7 +emory buffer register 6 it holds the contents of the memory word

    read from or written in memory.

    9 PC7 Program Control 6 it holds the address of the ne&t instruction to bee&ecuted. A branch address is an operation that calls for a transfer to a

    non consecutive memory location.

    *c AC7 accumulator register7 This register holds the initial data to beoperated on1 the intermediate result and also the final result of the

    processing operations. The result of the arithmetic operations are

    returned of AC for transfer to main memory .

    *d I" 6Instruction register 6 It holds the current instruction that is beinge&ecuted.

    *e I:7 Input :utput "egister7 this register is used to communicate with the

    input :output devices.All input information such as instructions and data

    are transferred to this register by an input device. Also1 all outputinformation to be transferred to an output device is found in this register.

    The e&ecution of an instruction by the CPU during program e&ecution normally involves

    the following steps$

    %. The control unit ta/es the address of the ne&t instruction to be e&ecuted by the

    PC*program control register and reads the instruction from the memory address

    into the I"*instruction register of the control unit.

    '. The control unit then sends the operation part and the address part of theinstruction to the decoder and the memory address register respectively.

    (. The decoder interprets the instruction and accordingly the control unit sends

    signals to the unit needed to carry out the specific ta/s.;. As the instruction is e&ecuted 1 the address of the ne&t instruction to be e&ecuted

    automatically gets loaded into the PC*program control register.

    PROCESSOR SPEE

    The operation of the A#U and the control unit are performed with incredible speed.These operations are usually synchroniuired to fetch1 decode and e&ecute single program

    instruction.The speed with which an instruction is e&ecuted is directly related to the computer?s built

    in cloc/ speed1 which is the number of pulses produced per second. This cloc/ speed is

    measured in meghahert< or +H< 1 where mega means million and hert< means producedcycles per second. +ost computer have the speed of %55 to %555 +H

  • 8/12/2019 chap1.3 CPU

    3/4

    The processing speed of the wor/stations1 minicomputers and main frames are measured

    in +IP=*million of instructions per second or 8IP=*billion instrcutiono per second andthat of super computer in +@#P=* millions of floating point operations per second and

    -@#P=*gigaflops 4 billion @#P=

    C=IC and "I=C processor

    C=IC*Comple& instruction set computer has CPU with a large instruction set1 variable

    length instructions and a variety of addressing modes. C=IC processors possess so manyprocessing features that they ma/e the job of the programmer easy. However1 they are

    comple& and e&pensive to produce. +ost of the CPU today use C=IC processor.

    "=IC*"educed Instruction =et Computer have a small instruction set1 they place e&tra

    demand on the programmer1 who must consider how to implement comple& calculations

    by combining simple instructions. )ue to simple design 1 "I=C processor are faster for

    most applications1 less comple& and less e&pensive to produce than CI=C processors.

    CACH,

    Cache memory is an e&tremely fast1 small memory between CPU and main memorywhose access s closer to the processing speed of the CPU. It acts as a high speed buffer

    between the CPU and main memory and is used to temporarily store very active data and

    instructions during processing. =ince the cache is faster than main memory1 theprocessing speed is increased by ma/ing data and instruction needed in present

    processing available in the cache.

    Loc!"it# o$ re$erence6 )uring a course of e&ecution of most programs 1 memory

    references by the processor 1 both instructions and data tend to cluster. That is if an any

    instruction is e&ecuted 1 there is a li/elihood of the same instruction being e&ecuted again

    soon. Hence such program and data are /ept in the cache memory.

    8TI!-

    The process of switching on the computer is referred as the bootingB of the computer. Itis also called the startup of the computer. The dis/ from which the startup of booting is

    done is called a %oot!%"e &is' or st!rtup &is' or s#stem &is'

    0e can define booting as It is the loading of set of programs form the "+ *read only

    memory into the "A+*random access memory so that it creates an environment for the

    e&ecution of commands . )uring booting1 three files are loaded into memory*"A+.These are I.==1 +=)=.== and C++A!).C+

    =T,P @ 8TI!- A ==T,+$

  • 8/12/2019 chap1.3 CPU

    4/4

    %. The P=T *power on self test routine performs a reliability test on the other

    "+ programs to find whether they are in order or not

    '. The "+ startup routines set up addresses of "+ 68I= routine inIDT*interrupt vector table at the low end of memory. It also performs "A+ test

    and store the memory si