How sameer07-sam/arithmetic-logic-unit-alu- works
Project Type and Purpose
• This is a VLSI‐domain hardware design project: a simple 8-bit Arithmetic Logic Unit (ALU) implemented in Verilog.
• Purpose: support addition, subtraction, bitwise AND, OR, NOT based on a 3-bit selector, and verify via a testbench.
File Structure Analysis
• ALU.v – Verilog source for the ALU module
• ALU_TB.v – Verilog testbench to simulate and verify ALU behavior
• ALU REPORT.docx – Design report/documentation
• README.md – Project overview and instructions
README Insights
• Lists supported operations and sel encoding (000→add, 001→sub, 010→AND, 011→OR, 100→NOT).
• Describes simulation flow (ModelSim, waveform verification).
System Design as a Flow Chart
We will create a flow chart that shows:
a. Input capture (A[7:0], B[7:0], sel[2:0])
b. Operation decode (chain of decisions on sel)
c. Functional units (adder/subtractor block, AND gate, OR gate, NOT gate)
d. Output multiplexing and result presentation
e. Testbench stimulus loop (optional sub-chart)
ASCII flow chart blueprint:
+-------------------------------------------------+
| START |
+-------------------------------------------------+
│
Read inputs A[7:0], B[7:0], sel[2:0]
│
▼
+----------------------------------------------+
| sel == 000 ? (Addition) |
+----------------------------------------------+
│ Yes │ No
▼ ▼
Compute sum = A + B +------------------------------------+
│ | sel == 001 ? (Subtraction) |
│ +------------------------------------+
│ Yes │ No │ Yes
│ ▼ ▼
│ Compute diff = A – B +----------------------+
│ | sel == 010 ? (AND) |
│ +--------------------------+
│ │ No │ Yes
│ ▼ ▼
│ +------------------+ Compute A & B
│ | sel == 011 ? OR? |
│ +------------------+
│ │ No │ Yes
│ ▼ ▼
│ +----------------+ Compute A | B
│ | sel == 100 ? |
│ | (NOT A) |
│ +----------------+
│ │ No │ Yes
│ ▼ ▼
│ +----------------+ Compute ~A
│ | Invalid sel? |
│ | (Default = 0) |
│ +----------------+
│ │
└─────────────────────────┴─────────────────►
│
▼
+-------------------------------+
| OUTPUT result[7:0] to bus |
+-------------------------------+
│
▼
+------------------+
| END LOOP |
+------------------+