computer system2

Upload: havend-ali

Post on 08-Apr-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Computer System2

    1/14

    Lecture 2

    CPU BASICS

    Central Processor Unit

  • 8/6/2019 Computer System2

    2/14

    FigureFigure 1-1 Block Diagram of a Digital Computer

    Memory

    Input Device Output DeviceInterface Port

    Or IOP

    CPU

  • 8/6/2019 Computer System2

    3/14

    A typical CPU has three major components:

    yregister set

    y

    arithmetic logic unit (AL

    U)y control unit (CU)

  • 8/6/2019 Computer System2

    4/14

    A CPU contains very fast memory called registers.The register can do one of two things: it can

    parallel load the inputs, that is, it can read in allfour inputs and store the four bits into the array.Each element of the array can store a single bit.

    Register

  • 8/6/2019 Computer System2

    5/14

    The black box shown has four inputs or (8, 16, 32 inputs).

    Data Inputs

    b3 b2 b1 b0

    1 0 1 0

    z3 z2 z1 z0

    Outputs

  • 8/6/2019 Computer System2

    6/14

    Register Types

    The register set differs from one computerarchitecture to another. It is usually a

    combination of general-purpose andspecial purpose registers.

    General-purpose registers are used for

    any purpose, hence the name generalpurpose. For example (A, B, C, D, R1, R2, R3)

  • 8/6/2019 Computer System2

    7/14

    Special-purpose registers have specificfunctions within the CPU.

    For example of special-purpose registers:

    The program counter (PC) is a special-purpose register that is used to hold theaddress of the instruction to be executed

    next.The instruction register (IR) which isused to hold the instruction that is currentlyexecuted.

  • 8/6/2019 Computer System2

    8/14

    Other processor registers used by a program instruction.

    Instruction Decoder (ID)

    MAR (Memory Address Register)

    MDR (Memory Data Register) .

  • 8/6/2019 Computer System2

    9/14

    The ALU provides the circuitry needed toperform the arithmetic, logical and shift

    operations demanded of the instructionset.

    ALU

  • 8/6/2019 Computer System2

    10/14

    The control unit is the entity responsiblefor fetching the instruction to be

    executed from the main memory anddecoding and then executing it.

    Control Unit

  • 8/6/2019 Computer System2

    11/14

    A typical and simple execution cycle can be summarized as follows:

    y The next instruction to be executed, whoseaddress is obtained from the PC, is fetched fromthe memory and stored in the IR.

    y The instruction is decoded.y Operands are fetched from the memory and

    stored in CPU registers, if needed.

    y The instruction is executed.

    y Results are transferred from CPU registers to thememory, if needed.

  • 8/6/2019 Computer System2

    12/14

  • 8/6/2019 Computer System2

    13/14

    The CPU fetches instructions frommemory, reads and writes data from and

    to memory, and transfers data from andto input/output devices.

  • 8/6/2019 Computer System2

    14/14

    Question

    -List the main components of CPU.

    -Define the following:

    y Register

    y ALU

    y Control Unit