Arithmetic Logic Unit


Instructions:

Follow this LINK. In the new IE window, select EDIT | SELECT ALL from the menu. Then select EDIT | COPY. Now open up Microsoft Word and paste the document into the word document so you can save and edit the assignment. You can closed the 2nd window of IE once the sheet has been placed in WORD.

The Simulations below are created using HADES.


Purpose:

To become familiar with the operation of the Arithmetic Logic Unit inside the CPU by setting up and executing a number of mathematical and logical operations.


Background (from http://en.wikipedia.org/wiki/ALU):

The arithmetic logic unit (ALU) of a computer's CPU is a part of the execution unit, a core component of all CPUs. ALUs are capable of calculating the results of a wide variety of basic arithmetical computations.

Virtually all modern computer ALUs use the two's complement binary number representation (whereas some early computers used either one's complement or sign-magnitude format).

ALU operations

Most ALUs will perform the following operations:

  • integer arithmetic operations (addition, subtraction, multiplication)
  • bitwise logic operations (and, not, or, xor)
  • bit-shifting operations (shifting or rotating a word by a specified number of bits to the left or right, with or without sign extension)

    A standard ALU typically does not handle integer division or any floating point operations. Optional methods for these types of calculations include:
  • software emulation, commonly implemented in hand-written assembly code and placed in a library for use by other programs (slowest)
  • microcode programs using the ALU to emulate the missing operations ("medium speed")
  • Separate hardware components, such as dividers and floating point units (FPUs), sometimes in the form of arithmetic coprocessors (fastest)

    Inputs and outputs
    The ALU takes as input the data to be operated on (called operands) and a code from the control unit indicating which operation to perform. The output is the result of the computation.

    In many designs the ALU also takes/generates as inputs/outputs a set of condition codes from/to a status register; typically these codes are used to indicate cases such as carry-in or carry-out, overflow, divide-by-zero, etc.


    Hints on using the simulation:
    Inputs and Outputs For a worked example of how to use the ALU play the VIDEO (you can ignore the part discussing the x,y and A=B).

    Circuit - ALU


    The image above shows a thumbnail of the interactive Java applet embedded into this page. Unfortunately, your browser is not Java-aware or Java is disabled in the browser preferences.

    To check if java is disabled (and you are using IE) goto TOOLS | Internet Options | Advanced (tab) | Scroll down the list and look for Java it should appear as shown:

    If Java is not listed. You will need instal it. After the installation is complete you might have to restart the browser.