ALU design and operations

Embed Size (px)

Citation preview

  • 7/30/2019 ALU design and operations

    1/35

    Lesson 11:Design of ALU

    Chapter 03: Computer Arithmetic

  • 7/30/2019 ALU design and operations

    2/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009

    2

    Objective

    Understand the units in ALU

  • 7/30/2019 ALU design and operations

    3/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009

    3

    ALUs

  • 7/30/2019 ALU design and operations

    4/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009

    4

    ALU

    Each processor has an ALU

    At ALU the arithmetic and logic operationsperformed.

    ALU performs two types of operations.

    1. Fixed point operations 2. Floating point operations

  • 7/30/2019 ALU design and operations

    5/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009

    5

    ALU Design

    Combinational Logic

    Circuits-based ALUs

    Sequential Logic Circuits

    Based ALUs

    Bit SliceProcessors

  • 7/30/2019 ALU design and operations

    6/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009

    6

    ALUs

    Fixed Point ALUs

    Floating Point Point

    ALUs

    Bit Slice Processors Based

    ALUs

  • 7/30/2019 ALU design and operations

    7/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009

    7

    ALU Operations

  • 7/30/2019 ALU design and operations

    8/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009

    8

    ALU two types of operations

    1. Fixed point operations

    2. Floating point operations

  • 7/30/2019 ALU design and operations

    9/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 9

    Fixed Point (Integer) ALU Operations

    Add

    Unsigned Multiply

    ANDAdd with carry

    Subtract

    Multiply

    Subtract with

    Borrow

    Divide Unsigned Divide

    OR

    XOR

    NOT

    L-Shift

    R-Shift

    Arth R-Shift

    TEST

    CMP

  • 7/30/2019 ALU design and operations

    10/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 10

    Floating Point ALU Operations

    FAdd FSub FMul FDiv

  • 7/30/2019 ALU design and operations

    11/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 11

    Complex ALU Operations

    MAC VLIW operations

  • 7/30/2019 ALU design and operations

    12/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 12

    Common arithmetic operations

    1. Addition, subtraction

    2. Addition-with-carry (from a previousoperation)

  • 7/30/2019 ALU design and operations

    13/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 13

    Common arithmetic operations

    3. Subtraction with borrow from a previousoperation. Common circuit for addition and

    subtraction.

    ALU common flag for carry and borrow(many processors) or common flag for carryand not-borrow (8096)

    Carry flag an output carry from a chain of bit-adders

  • 7/30/2019 ALU design and operations

    14/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 14

    Common arithmetic operations

    4. Division

    5. Increment and decrement6. Logical shift left and logical shift right

  • 7/30/2019 ALU design and operations

    15/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 15

    Logical Shift

    0b00100111 after logical left shift

    = 0b01001110 0b00100111 after logical right shift

    = 0b00010011

  • 7/30/2019 ALU design and operations

    16/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 16

    Common arithmetic operations

    Arithmetic shift left and logical shift right

    Arithmetic shift left and logical shift left same. Arithmetic shift right and logical shift right are

    different.

  • 7/30/2019 ALU design and operations

    17/35

    Schaums Outline of Theory and Problems of Computer ArchitectureCopyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 17

    Arithmetic Shift

    0b00100111 after arth. left shift

    = 0b01001110 0b00100111 after arth. right shift

    = 0b00010011

    0b10100111 after arth. right shift

    = 0b11010011

  • 7/30/2019 ALU design and operations

    18/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 18

    Common logic operations

    NOT

    AND, OR, XOR COMPARE

    TEST

  • 7/30/2019 ALU design and operations

    19/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 19

    Logic Operations 0b00100111 after NOT

    = 0b11011000

    0b00100111 and 0b11011001 after AND =

    0b00000001

    0b00100111 and 0b11011001 after OR =0b11111111

    0b00100111 and 0b11011001 after XOR =

    0b11111110

  • 7/30/2019 ALU design and operations

    20/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 20

    Compare Operations

    0b00100111 and 0b11011001 after operation

    Sign Flag = 1, Zero Flag = 0

    0b11011001 and 0b 00100111 after operation

    Sign Flag = 0, Zero Flag = 0

    0b 00100111 and 0b 00100111 after operationSign Flag = 0, Zero Flag = 1

  • 7/30/2019 ALU design and operations

    21/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 21

    TEST Operations

    0b00100111 and 0b11011000 after operation

    Test Flag = 0, Zero Flag = 1

    0b11011001 and 0b 11011001 after operation

    Test Flag = 1, Zero Flag = 0

    0b 00100111 and 0b 00000111 after operationTest Flag = 0, Zero Flag = 0

  • 7/30/2019 ALU design and operations

    22/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 22

    Combinational Logic Circuits-based ALUs

  • 7/30/2019 ALU design and operations

    23/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 23

    An ALU using combinational circuits

  • 7/30/2019 ALU design and operations

    24/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 24

    Combinational Circuits Based ALU

    k-Input X Select Circuitk-Input Y

    XOR OR ADD

    ResultFlags

    Bus

  • 7/30/2019 ALU design and operations

    25/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 25

    Sequentias Circuits-based ALUs

  • 7/30/2019 ALU design and operations

    26/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 26

    An ALU using sequential circuit

  • 7/30/2019 ALU design and operations

    27/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 27

    Sequential LogicCircuits Based ALU

    k-Input X Select/Controlk-Input Y

    AND OR ADD

    ResultFlags

    Bus

    Control Unit Registers

    For

    intermediateresults

  • 7/30/2019 ALU design and operations

    28/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 28

    Bit Slice Circuits-based ALUs

  • 7/30/2019 ALU design and operations

    29/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 29

    Bit Slice Processors Circuit Based ALU

    k-Input X Select/Controlk-Input Y

    P2

    P3 P5

    ResultFlags

    Bus

    P1

    P4

    For

    intermediateresults

    Bit Slice ALUs

  • 7/30/2019 ALU design and operations

    30/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 30

    Bit Slice

  • 7/30/2019 ALU design and operations

    31/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 31

    Summary

  • 7/30/2019 ALU design and operations

    32/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 32

    ALUs

    Fixed Point ALUs

    Floating Point Point

    ALUs

    Bit Slice Processors Based

    ALUs

  • 7/30/2019 ALU design and operations

    33/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 33

    ALU Operations

    Add

    Unsigned Multiply

    ANDAdd with carry

    Subtract

    Multiply

    Subtract with

    Borrow

    Divide Unsigned Divide

    OR

    XOR

    NOT

    L-Shift

    R-Shift

    Arth R-Shift

    TEST

    CMP

  • 7/30/2019 ALU design and operations

    34/35

    Schaums Outline of Theory and Problems of Computer Architecture

    Copyright The McGraw-Hill Companies Inc. Indian Special Edition 2009 34

    ALU Design

    Combinational Logic

    Circuits-based ALUs

    Sequential Logic Circuits

    Based ALUs

    Bit Slice

    Processors

  • 7/30/2019 ALU design and operations

    35/35

    End of Lesson 11 on

    Design of ALU