Ahsanullah University of Science and Technology
Department of Computer Science and Engineering
Assignment/Home Work#1, Fall 2023
Course Code CSE 2213 Course Title: Computer Architecture
Due Date: 23/7/2023 Full Marks: 10
ID: Name:
16 bits ALU in MIPS
In this assignment, you will implement a 16 bit ALU in MIPS with the following inputs
and outputs.
Wire Name Direction Bit Width
Input A Input 16
Input B Input 16
Select Input 3
Result Output 16
Zero Flag Overflow Output 1
Zero Flag Output 1
Fig 1: 16 Bit ALU Block Diagram
The eight functions that you will implement are: add, subtract, OR, AND, shift left logical, shift
right logical, and set less than. The ALU will perform the desired function on two 16-bit inputs
(X and Y, where x0 is the lowest order bit for x, y0 is the lowest order bit for y, etc...) and output
the result on the 16-bit Result bus. The function will be determined by the value of a control
signal (Select), as listed below.
Select Operation Result
000 OR X|Y
001 AND X&Y
010 ADD X+Y
011 SUB X-Y
100 SLL X<<4 (logically, don't sign
extend!)
101 SRL X>>4 (logically, don't sign
extend!)
111 SLT If(X>Y) result=1
Else result=0
Testing:
Use some test cases to test your outputs.
Rubrics:
Design and Implementation‐ 5 Marks
Viva‐ 3 Marks
Evaluation(Test Cases)‐2 Marks