We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 24999

9.1i EDK - MicroBlaze v5/v6.0a integer divide generates incorrect results


MicroBlaze hardware integer division generates incorrect results for certain operands, for example 0x633b6b00 / 0xde713373. The problem occurs in MB v5 and v6.00.a.


The error is due to the IDIV instruction on MB.

For MB v.5.00x, you can work around this issue by using the FDIV instruction instead. If you need to perform integer divisions, you can write the code as follows:

i3 = (unsigned int) ((float) i1 / (float) i2) ;

i4 = (unsigned int) ((float) i2 / (float) i1) ;

For MB v6.00a, the same work-around applies. You can also work around it by setting the parameter C_AREA_OPTIMIZED to "1" in your MB instantiation.

This problem has been fixed in MB v6.00.b in the latest EDK 9.1i Service Pack, available at:

The first service pack containing the fix is EDK 9.1i Service Pack 1.

AR# 24999
Date 12/15/2012
Status Active
Type General Article