Simple ALU
0 Stars     5 Views    

Author: Husam El-Issa

Project access type: Public

Description:

A simple ALU that can perform four functions: bitwise AND, bitwise OR, bitwise XOR, and bitwise NOT on two operands, A and B. 

Design logic circuits for each of these operations. Use a 2-bit opcode as the select signal for a 4x1 multiplexer:

AND à Opcode 00: Perform bitwise AND (A AND B).

OR    à Opcode 01: Perform bitwise OR (A OR B).

XOR  à Opcode 10: Perform bitwise XOR (A XOR B).

NOT  à Opcode 11: Perform bitwise NOT (A NOT B).


Using Select Inputs (ALU), the multiplexer's output gives the result of the selected operation.

Using Select Input(NOT), the 2x1 multiplexer output the selected variable A or B to run through the NOT gate.

This simplistic example can be expanded with more operations, larger bit-widths, and additional complexities like handling overflow or underflow, sign extension for subtraction, and so on.

Created: Apr 05, 2024

Updated: Apr 23, 2024


Comments

You must login before you can post a comment.