28farithmetic logic unit

Upload: gianluca-mura

Post on 05-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 28FArithmetic Logic Unit

    1/13

    Arithmetic Logic UnitALU

    By: Ahmad Yazdankhah

    CS 147

    Fall 2008Prof: Dr. Sin-Min Lee

  • 8/2/2019 28FArithmetic Logic Unit

    2/13

    Table of Contents

    Assumptions

    Review: Bus Concept

    Review: CPU Building Block

    The Simplest Computer Building Blocks Whats ALU?

    Typical Schematic Symbol of an ALU

    Lets Build a 1-Bit ALU

    Useful Links

    References

  • 8/2/2019 28FArithmetic Logic Unit

    3/13

    Assumptions

    You are familiar with:

    1. Number representations (1s complement, 2s

    comp.)

    2. Arithmetic operations (Add, Sub, . . .)

    3. Floating Point concept

    4. Registers in CPU (Accumulator, ProgramCounter, Instruction Register, )

  • 8/2/2019 28FArithmetic Logic Unit

    4/13

    Review: Bus Concept

  • 8/2/2019 28FArithmetic Logic Unit

    5/13

    Review: CPU Building Blocks

    Registers

    (IR, PC, ACC)

    Control Unit

    (CU)

    Arithmetic

    Logic Unit

    (ALU)

  • 8/2/2019 28FArithmetic Logic Unit

    6/13

    The Simplest Computer Building Blocks

    Instruction Register (IR) Program Counter (PC)

    Control Unit (CU)

    ALU

    Accumulator (ACC)

    0

    1

    2

    3

    4

    5

    .

    CPU RAM

    Status Register (FLAG)

  • 8/2/2019 28FArithmetic Logic Unit

    7/13

    Whats ALU?

    1. ALU stands for: Arithmetic Logic Unit

    2. ALU is a digital circuit that performs

    Arithmetic (Add, Sub, . . .) and Logical

    (AND, OR, NOT) operations.

    3. John Von Neumann proposed the ALU in

    1945 when he was working on EDVAC.

  • 8/2/2019 28FArithmetic Logic Unit

    8/13

    Typical Schematic Symbol of an ALU

    A and B: the inputs to the ALU

    (aka operands)

    R: Output or Result

    F: Code or Instruction from the

    Control Unit (aka as op-code)

    D: Output status; it indicates cases

    such as:

    carry-in

    carry-out,overflow,

    division-by-zero

    And . . .

  • 8/2/2019 28FArithmetic Logic Unit

    9/13

    Lets Build a 1-Bit ALU

    This is an one-bit ALU which can do Logical AND and Logical OR operation.

    Result = a AND b when operation = 0

    Result = a OR b when operation = 1

    The operation line is the input of a MUX.

  • 8/2/2019 28FArithmetic Logic Unit

    10/13

    Adding a full adder to our ALU

    Building a 1-Bit ALU (contd)

  • 8/2/2019 28FArithmetic Logic Unit

    11/13

    A 32-Bit ALU

    By paralleling the one-bit ALUs and some other modification on the

    logical circuits, we can create bigger ALUs.

  • 8/2/2019 28FArithmetic Logic Unit

    12/13

    Useful Links

    Virginia Tech online courses:http://courses.cs.vt.edu/~csonline/index.html

    Virginia Tech online Circuit Simulator

    http://courses.cs.vt.edu/~csonline/MachineArchitecture/Lessons/Circuits/simcir_frame.html

    Virginia Tech Microprocessor Simulation:http://courses.cs.vt.edu/~csonline/MachineArchitecture/Less

    ons/CPU/sumprogram.html

    http://courses.cs.vt.edu/~csonline/index.htmlhttp://en.wikipedia.org/wiki/Arithmetic_logic_unithttp://courses.cs.vt.edu/~csonline/MachineArchitecture/Lessons/Circuits/simcir_frame.htmlhttp://courses.cs.vt.edu/~csonline/MachineArchitecture/Lessons/Circuits/simcir_frame.htmlhttp://courses.cs.vt.edu/~csonline/index.htmlhttp://courses.cs.vt.edu/~csonline/MachineArchitecture/Lessons/CPU/sumprogram.htmlhttp://courses.cs.vt.edu/~csonline/MachineArchitecture/Lessons/CPU/sumprogram.htmlhttp://courses.cs.vt.edu/~csonline/MachineArchitecture/Lessons/Circuits/simcir_frame.htmlhttp://courses.cs.vt.edu/~csonline/MachineArchitecture/Lessons/Circuits/simcir_frame.htmlhttp://courses.cs.vt.edu/~csonline/MachineArchitecture/Lessons/CPU/sumprogram.htmlhttp://courses.cs.vt.edu/~csonline/MachineArchitecture/Lessons/CPU/sumprogram.htmlhttp://courses.cs.vt.edu/~csonline/index.htmlhttp://courses.cs.vt.edu/~csonline/MachineArchitecture/Lessons/Circuits/simcir_frame.htmlhttp://courses.cs.vt.edu/~csonline/MachineArchitecture/Lessons/Circuits/simcir_frame.htmlhttp://en.wikipedia.org/wiki/Arithmetic_logic_unithttp://courses.cs.vt.edu/~csonline/index.html
  • 8/2/2019 28FArithmetic Logic Unit

    13/13

    References:

    Text book: Computer System Architecture(By: Rob Williams, 2nd Edition, Prentice Hall, 2006)

    Site Wikipedia:

    http://en.wikipedia.org/wiki/Arithmetic_logic_unit

    Previous Student Lectures:(By: Anna Kurek, Spring 2008)

    Professors Lecture Notes.

    Virginia Tech online courses:http://courses.cs.vt.edu/~csonline/index.html

    http://en.wikipedia.org/wiki/Arithmetic_logic_unithttp://courses.cs.vt.edu/~csonline/index.htmlhttp://en.wikipedia.org/wiki/Arithmetic_logic_unithttp://en.wikipedia.org/wiki/Arithmetic_logic_unithttp://courses.cs.vt.edu/~csonline/index.htmlhttp://en.wikipedia.org/wiki/Arithmetic_logic_unit