Sie sind auf Seite 1von 2

EE471 - Computer Organization and Design

Semester 1 2016-2017
Danang University of Science and Technology, Faculty of Electronics and Telecommunications
Prepared by Ho Viet Viet, Pham Xuan Trung, Nguyen Van Hieu, Tang Anh Tuan and Tran Van Lic
Lab2: Design a MIPS 32-bit ALU
Lab Objectives:
For this lab2 you are to design a simple 32-bit MIPS ALU. The ALU functions
implemented are Addition, Subtraction, eXclusive OR, and Set on Less Than.
Examples of this type of architecture is shown in chapter 4 of the textbook. The
overall block diagram of your design will look like the figure below.

Bus A

32
Output

32

ALU Zero

Bus B Overflow

32 Carryout

Negative

ALU
2
Control

The ALU has 8 ports. These ports are the two input ports A and B, the output port, ALU
control, zero detect output, overflow detect output, negative detect output, and the
carryout output. The ALU control line assignments is given below. Please use these
inputs to select the ALU function.

ALU CONTROL LINES FUNCTION


00 Add
01 iitiiti
XOR
10 Sub
11 Slt
Note:
- The Carryout and Overflow flags are very important for Addition and Subtraction. The
Carryout flag is set if an unsigned overflow occurs. The Overflow flag is set if a signed
overflow occurs.
- The Zero and Negative flags are only important for Addition, Subtraction, and XOR.
The Zero flag is set if the Output equals zero. The Negative flag is set if the most
significant bit of the Output equals one.
- What these flags do in the other cases is UP TO YOU.

Computer resources and software tools:


PCs with Software Quartus II, ModelSim, IVerilog installed, testbench: alustim.v
Lab Requirements (as in lab1)

Das könnte Ihnen auch gefallen