0% found this document useful (0 votes)
6 views15 pages

Aluverificationuvm 1

Uploaded by

karun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views15 pages

Aluverificationuvm 1

Uploaded by

karun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

ALU (Arithmetic and Logic Unit)

What is ALU?
• An ALU (Arithmetic Logic Unit) is a critical component of a computer's CPU (Central Processing Unit) that performs arithmetic and logical operations.
• It is responsible for carrying out basic mathematical operations

Why are we using ALU in real time ?


• The ALU receives input data, which may come from memory, registers, or other components, and produces an output based on the operation requested by
the control unit of the CPU.
• The result from the ALU is usually stored in registers or memory for further use by the system

Key Operations of an ALU:


1. Arithmetic Operations:
• Addition: Adds two binary numbers.
• Subtraction: Subtracts one number binary number from another.
• Multiplication (in some cases, though multiplication is often handled by a separate unit).
• Division (also sometimes handled by a separate unit).
2. Logical (Bitwise) Operations:
• AND: Performs a bitwise AND operation between two binary numbers.
• OR: Performs a bitwise OR operation
• XOR: Performs a bitwise Exclusive OR operation
• NOT: performs bitwise negation.
3. Shift Operations:
• Left Shift: Shifts the bits of a number to the left.
• Right Shift: Shifts the bits of a number to the right.
4. Comparison Operations:
• Equal to: Checks if two numbers are equal.
• Less than/Greater than: Compares two numbers to determine their relative sizes.

Basic 4-bit ALU Design:


In a simple 4-bit ALU, the ALU would have two 4-bit operands (a_in and b_in) and a 2-bit sel_in to select operations.
For example:
00: Addition (a + b)
01: Subtraction (a - b)
10: Multiplication (a * b)
11: Division (a / b)
Testbench Architecture
Verifying an ALU using UVM:
To ensure an ALU works correctly, you can create a UVM testbench where:
The Sequence generates operands (a_in, b_in) and operation codes (sel_in).
The Driver sends these to the ALU.
The DUT (ALU) processes the data and generates a result.
The Monitor captures the result.
The Scoreboard compares the ALU's result with the expected output
ALU RTL & TB with display outputs
To generate wave forms in EDA Play ground

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#happy_learning
#LWL

You might also like