Table Of Contents

High Throughput Divide (Clock-Driven Logic)

Last Modified: January 9, 2018

Computes the quotient of two numbers.

connector_pane_image
datatype_icon

x

Dividend.

datatype_icon

y

Divisor. If the value of y is 0, overflow occurs in the x/y output terminal.

datatype_icon

input valid

Boolean value that describes whether the next data point has arrived for processing. Wire the output valid output of an upstream node to this input to transfer data from the upstream node to this node.

True The next data point has arrived for processing.
False The next data point has not arrived for processing.
datatype_icon

ready for output

Boolean value that defines whether downstream nodes are ready for this node to return a new value. Use a Feedback Node to wire the ready for input output of a downstream node to this input of the current node.

True Downstream nodes are ready for this node to return a new value.
False Downstream nodes are not ready for this node to return a new value.
spd-note-note
Note  

If this input is False during a cycle, the output valid output returns False during that cycle.

Default: True

datatype_icon

operation overflow

A Boolean that indicates whether the theoretical computed value exceeds the valid range of the output data type.

TRUE The theoretical computed value exceeds the valid range of the output data type.
FALSE The theoretical computed value does not exceed the valid range of the output data type.
datatype_icon

x/y

x divided by y.

datatype_icon

output valid

Boolean value that indicates whether this node computes a result that downstream nodes can use.

Wire this output to input valid of a downstream node to transfer data from the node to the downstream node.

True Downstream nodes can use the result this node computes.
False This node returns an undefined value that downstream nodes cannot use.
spd-note-note
Note  

This node may return different undefined values when executed in simulation mode versus when executed on hardware.

datatype_icon

ready for input

Boolean value that indicates whether this node is ready to accept new input data.

Use Feedback Node to wire this output to ready for output of an upstream node.

True The node is ready to accept new input data.
False The node is not ready to accept new input data.
spd-note-note
Note  

If this output returns False during a given cycle, this node discards any data that other nodes send to this node during the following cycle. This node discards the data even if input valid is True during the following cycle.

Avoiding Overflow in x/y

If you leave Auto Adapt enabled for the Precision configuration of this node, overflow can still occur in the x/y output for non-zero values of y if both of the following conditions are true:

  • x = -2iwlx - 1
  • y = -2iwly - wly

where wl refers to the word length of an input and iwl refers to the integer word length of an input.

Complete the following steps to avoid overflow in the situation described in the previous section and for any non-zero value of y:

  1. Select this node on the diagram.
  2. Disable Auto Adapt for the Precision option on the Item tab. When you disable Auto Adapt, you also disable the Auto Adapt Options button.
  3. Configure the Precision, Overflow, and Rounding for the node.

After you complete these steps, LabVIEW no longer adjusts the fixed-point configuration of x/y automatically. Therefore, if you change the fixed-point configuration of the x or y and still want to avoid overflow for any non-zero value of y, re-enable Auto Adapt on the Item tab. Then, complete the same steps to specify word length and integer word lengths.

Effect of Rounding on x/y

The fixed-point behavior for this node uses a rounding mode that truncates the output value towards zero. This mode rounds the output value down to the nearest value that the output type can represent. If the value is positive, LabVIEW truncates the value. If the value is negative, LabVIEW deletes the least significant bits (LSBs) and adds the sign bit to the remaining LSBs, provided at least one of the deleted bits differs from 0.

Where This Node Can Run:

Desktop OS: none

FPGA: All devices

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics