AN 977: Nios® V Processor Custom Instruction

ID 773194
Date 4/14/2023
Public
Document Table of Contents

3.3.2. ALU Switch

The funct3 field determines the ALU switch. Using data0 and data1 as inputs, the ALU switch picks an ALU operation, and delivers the result as alu_result at the start of the custom instruction. You can use the alu_result, concurrently with the same data0 and data1 in the custom instruction. When applying this feature, Intel recommends you to hardcode the funct3 value in the Platform Designer.

Table 9.  ALU Switch Options
funct3 ALU Operation alu_result[31:0]
000 ADD

Addition of data0 and data1.

001 Reserved N/A
010 SLT (Set on Less Than (signed)) 1 if data0 < data1, 0 otherwise.
011 SLTU (Set on Less Than (unsigned)) 1 if data0 < data1, 0 otherwise.
100 XOR (Exclusive OR) Bitwise XOR operation of data0 and data1.
101 Reserved N/A
110 OR Bitwise OR operation of data0 and data1.
111 AND Bitwise AND operation of data0 and data1.
Figure 11. ALU Switch Block Diagram
Figure 12. ALU Switch Timing Diagram with AND Operation