ppt by mudit n vibhu

Embed Size (px)

Citation preview

  • 8/7/2019 ppt by mudit n vibhu

    1/40

  • 8/7/2019 ppt by mudit n vibhu

    2/40

    Computer Operations1. Control Unit

    2. Arithmetic and Logic Unit

    3. Instruction Cycle

  • 8/7/2019 ppt by mudit n vibhu

    3/40

    Simple Computer

  • 8/7/2019 ppt by mudit n vibhu

    4/40

    Arithmetic

    and

    logic

    unit

    Control

    unit

    Memory

    unit

    Input/

    output

    unit

    CPU

    control bus

    data bus

    address bus

    Simple Model Computer block diagramSimple Model Computer block diagram

  • 8/7/2019 ppt by mudit n vibhu

    5/40

    Arithmetic and logic unit

    SR ACC

    ALU

    Arithmetic and Logical

    operations are performed in

    the ALU

    1

    ALU consists of an

    accumulator (ACC), a set of

    logic circuits, and a

    status register (SR).

    2

  • 8/7/2019 ppt by mudit n vibhu

    6/40

    Instruction

    decoder PC

    IR

    Control unit

    Control Unit

    controls the overall

    operations of the

    computer.

    1

    Control Unit Consists

    of the program

    Counter (PC), the

    instruction register (IR)

    and the instructiondecoder.

    2

  • 8/7/2019 ppt by mudit n vibhu

    7/40

    main memoryaddress decoder

    MDR

    MAR

    Memory unit consists ofthe main store, the

    memory data register

    (MDR), the memory

    address register (MAR),

    and the address decoder.

    1

    Memory Unit 1

    2Main store is composed of

    a large number of memory

    locations.

  • 8/7/2019 ppt by mudit n vibhu

    8/40

    Address decoder isresponsible for

    selecting the

    appropriate memory

    location.

    3

    The memory data register holds

    the piece of information read

    from or written to the specified

    memory location

    4

    The memory address registerholds the address of the

    memory location to be

    accessed.

    5

    Memory Unit 1

  • 8/7/2019 ppt by mudit n vibhu

    9/40

    Instruction Cycle

  • 8/7/2019 ppt by mudit n vibhu

    10/40

    Instruction Cycle

    The instruction is fetched from memory

    addressed by PC.

    PC is advanced to address the next instruction.2

    1

    3 Instruction Decoder decodes theinstruction held in IR.

    4 Instruction is then executed.

    The process is repeated until the complete set

    of instructions is fetched.

  • 8/7/2019 ppt by mudit n vibhu

    11/40

    Fetch instruction

    from memory to IR

    Increment PCExecute the

    instruction

    Decode the

    instruction

    Instruction Cycle

  • 8/7/2019 ppt by mudit n vibhu

    12/40

    main memory

    SR

    Instructiondecoder

    addressdecoder

    MDR

    I/O unit

    ACC

    ALU

    MAR

    PC

    IR

  • 8/7/2019 ppt by mudit n vibhu

    13/40

    main memory

    SR

    Instruction

    decoder

    address decoder

    MDR

    I/O unit

    ACC

    ALU

    MAR

    PC

    IR

    Memory unit

  • 8/7/2019 ppt by mudit n vibhu

    14/40

    main memory

    SR

    Instruction

    decoder

    address decoder

    MDR

    I/O unit

    ACC

    ALU

    MAR

    PC

    IR

    Memory unitControl unit

  • 8/7/2019 ppt by mudit n vibhu

    15/40

    Arithmetic and

    logic unit main memory

    SR

    Instruction

    decoder

    address decoder

    MDR

    I/O unit

    ACC

    ALU

    MAR

    PC

    IR

    Memory unitControl unit

  • 8/7/2019 ppt by mudit n vibhu

    16/40

    Instruction

    numberInstruction Address

    location

    1

    2

    3

    10000

    10001

    10010Store the result held in the ACC

    in memory location 11101

    Load the contents in memorylocation 11111 into the ACC

    Add the contents in memory

    location 11110 to the ACC

  • 8/7/2019 ppt by mudit n vibhu

    17/40

    Main memory

  • 8/7/2019 ppt by mudit n vibhu

    18/40

    Load the contents in memory

    location 11111 into the ACC

  • 8/7/2019 ppt by mudit n vibhu

    19/40

    Fetch cycle

  • 8/7/2019 ppt by mudit n vibhu

    20/40

    Fetch cycleFetch cycle- step 1

    10000

    PC

  • 8/7/2019 ppt by mudit n vibhu

    21/40

    PC

    10000

    Fetch cycleFetch cycle- step 2

    MAR

    10000

    MAR

  • 8/7/2019 ppt by mudit n vibhu

    22/40

    10000

    MAR

    PC

    Fetch cycleFetch cycle- step 3

    Main memoryAddressdecoder

    Instruction 1 10000

    10000

    Addressdecoder Main memory

    10000

  • 8/7/2019 ppt by mudit n vibhu

    23/40

    10000

    Main memoryFetch cycleFetch cycle

    - step 4Addressdecoder

    Instruction 1

    Instruction 2

    Instruction 3

    10001

    10010

    11111

    MDR

    Instruction 1

    Instruction 1 MDR

    Number 1

    10000

    10000

  • 8/7/2019 ppt by mudit n vibhu

    24/40

    MDR

    10000

    10000

    Fetch cycleFetch cycle- step 5

    IRInstruction 1 IR Instruction 1Instruction 1

  • 8/7/2019 ppt by mudit n vibhu

    25/40

    Executing cycle

  • 8/7/2019 ppt by mudit n vibhu

    26/40

    Executing cycleExecuting cycle- step 1

    1000010000PC

    Instruction 1

    PC10001

    Instruction 1

  • 8/7/2019 ppt by mudit n vibhu

    27/40

    PCPC

    Instruction 1Instruction 1

    Executing cycleExecuting cycle- step 2

    10000

    Instruction

    decoder

    IR

    10001

    Instruction 1

    10001

    IR

    Instruction

    decoder

  • 8/7/2019 ppt by mudit n vibhu

    28/40

    Instruction

    decoder

    Instruction

    decoder

    Executing cycleExecuting cycle- step 3

    10000

    MAR

    10001

    Instruction 1Instruction 1

    11111

    MAR

  • 8/7/2019 ppt by mudit n vibhu

    29/40

    Instruction 1

    1111111111

    MAR

    Main memoryAddressdecoderAddressdecoder Main memory

    Executing cycleExecuting cycle- step 4

    Instruction 1

    10001

    11111

    Number 1

  • 8/7/2019 ppt by mudit n vibhu

    30/40

    Instruction 1 MDR

    Executing cycleExecuting cycle- step 5

    Instruction 1

    10001

    11111

    Number 1Number 1

    MDRNumber 1

    Number 1 11111

    Main memory

  • 8/7/2019 ppt by mudit n vibhu

    31/40

    Instruction 1 MDRACC

    Executing cycleExecuting cycle- step 6

    10001

    11111

    Number 1

    Number 1 Number 1ACC

  • 8/7/2019 ppt by mudit n vibhu

    32/40

    Fetch Executing

  • 8/7/2019 ppt by mudit n vibhu

    33/40

    Add the contents in memory

    location 11110 to the ACC

  • 8/7/2019 ppt by mudit n vibhu

    34/40

    PC10001

    MDRMDR

    MAR

    Number 1

    PCPC

    Main memoryAddressdecoder

    Instruction 2

    10000

    10001

    10010

    IR

    Fetch cycleFetch cycle

    Instruction 1

    11111

    Number 1

    10001

    Instruction 2

    Addressdecoder Main memory

    10001

    Instruction 2Instruction 2

    10001

    IR

    10001

    10001

    Main memory

    10001

    MAR

  • 8/7/2019 ppt by mudit n vibhu

    35/40

    Executing cycleExecuting cycle

    100011000111110

    10001PCPC

    10010

    Number 1 Instruction 2Instruction 2Instruction 2

    PC

    Instruction

    decoder

    IR

    10010

    IR

    Instruction

    decoder

    MAR

    Instruction

    decoder

    MAR

    11110

    Addressdecoder Main memory

    Number 2

    Instruction 2

    Number 2

    MDRNumber 2

    Number 2

    ACCNumber 1Number 1Result

    11110

    MAR

    11110

    Main memory

    ALU

  • 8/7/2019 ppt by mudit n vibhu

    36/40

    Store the result held in the ACC

    in memory location 11101

  • 8/7/2019 ppt by mudit n vibhu

    37/40

    10010PC

    MDRMDR

    MAR

    Main memoryAddressdecoder

    10000

    IR

    Fetch cycleFetch cycle

    Instruction 1

    11111

    Number 1

    10010

    MARMAR

    Addressdecoder Main memory

    10010

    Instruction 3Instruction 3

    10010

    IR

    10010

    Main memory

    10010

    Instruction 3Instruction 310010

    Result

  • 8/7/2019 ppt by mudit n vibhu

    38/40

    Main memoryMain memory

    Result

    100011000111101

    10001PCPC

    10011

    Instruction 2Instruction 3Instruction 3

    PC

    Instruction

    decoder

    IR

    10011

    IR

    Instruction

    decoder

    MAR

    Instruction

    decoder

    MAR

    11101

    Addressdecoder

    Number 2

    Instruction 3

    Result

    MDRResultACCResult

    11101

    MAR

    1110111101

    Main memoryExecuting cycleExecuting cycle

  • 8/7/2019 ppt by mudit n vibhu

    39/40

    Summary

    Register Abbreviation unction

    Instruction

    RegisterIR

    Stores the current

    instruction

    Program

    CounterPC

    Stores the address of

    the next instruction

    to be executed.

    InstructionDecoder

    ---

    Decode the

    instruction in IR

    Control nit

  • 8/7/2019 ppt by mudit n vibhu

    40/40

    The End !!!

    Thank You!!!