Nios II Classic Processor Reference Guide

ID 683620
Date 10/28/2016
Public
Document Table of Contents

4.6.1.2. Floating-Point Hardware Custom Instruction

Floating-Point Hardware Custom Instruction

The Nios II processor offers a set of optional predefined custom instructions that implement floating-point arithmetic operations. You can include these custom instructions to support computation-intensive floating-point applications.

The basic set of floating-point custom instructions includes single precision (32-bit) floating-point addition, subtraction, and multiplication. Floating-point division is available as an extension to the basic instruction set. The best choice for your hardware design depends on a balance among floating-point usage, hardware resource usage, and performance.

If the target device includes on-chip multiplier blocks, the floating-point custom instructions incorporate them as needed. If there are no on-chip multiplier blocks, the floating-point custom instructions are entirely based on general-purpose logic elements.

Note: The opcode extensions for the floating-point custom instructions are 252 through 255 (0xFC through 0xFF). These opcode extensions cannot be modified.

To add the floating-point custom instructions to the Nios II processor in Qsys, select Floating Point Hardware under Custom Instruction Modules on the Component Library tab, and click Add. By default, Qsys includes floating-point addition, subtraction, and multiplication, but omit the more resource intensive floating-point division. The Floating Point Hardware parameter editor appears, giving you the option to include the floating-point division hardware.

Table 63.  Floating Point Hardware Parameters
Name Values Description
Use floating point division hardware On/Off Specifies inclusion of floating-point division hardware.

Turn on Use floating point division hardware to include floating-point division hardware. The floating-point division hardware requires more resources than the other instructions, so you might wish to omit it if your application does not make heavy use of floating-point division.

Click Finish to add the floating-point custom instructions to the Nios II processor.

For more information about the floating-point custom instructions, refer to the Processor Architecture chapter of the Nios II Processor Reference Handbook.