Arithmetic Logic Unit
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.
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).
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
- To see the pin descriptions on the '181, right click with the cursor over the 181 and VIEW | Extra Layers.
- You can zoom in and out by right clicking the mouse and slecting zoom (from there you can select the zoom level you wish)
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).
- For the binary Inputs just click on the input to change the state of the input, red=HIGH, Grey=LOW. Outputs use the same collor scheme.
- For the HEX INPUTS, you can select the output by clicking on the areas marked 0 to F. You can also increment by selecting the '+' and decrement by selecting the '-'. The HEX OUTPUT, just read the LED. WARNING: the number 6 and the letter b alike. the 6 will have the top bar ON and the b will not have that segment lit.
Circuit - ALU