Design and Implementation of a 4-Bit ALU with Bit-Wise Operations Using Verilog

VLSI Design course project, 2022

In this project I had to build a 4-Bit Alu that can perform 4 operations(X-NOR, SUB, NAND, ADD). The constraint was to code the project in such a way that operations are done bit-wise.

The ALU takes two four-bit inputs: A, B and Three-bit operation Code (opcode). Based on the opcode, it performs four different operations on A and B and produces a four-bit output, C. Depending on the result of a particular operation, the ALU also produces three flags: carry, zero and sign flag.

The whole project was done in the Quartus and used Verilog programming language.

Block Diagram of the ALU
The details of the flags followed by an operation.
Op Codes Description
State Diagram
Timing diagram of the output (w0,w1,w2 represents 3-bit OP Code)

You can find more about the project here.