Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

Signed addition in Nios II

Altera_Forum
Honored Contributor II
1,503 Views

Hi all, 

I need to add two numbers in Nios II. 

For that i simply add two numbers in Nios II C program. 

I have assigned the maximum possible 32 bit positive value .i.e. 0x7FFFFFFF in both. 

What i expect is the result should saturate to 0x7FFFFFFF as in the case of micro controllers. 

But the Nios II does not do like that.What can be the reason for that?
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
576 Views

The result doesn't saturate but Nios overflows and set the overflow status. 

AFAIK this is the normal behaviour on other microprocessors, too. I have worked with a few uP which could saturate the result instead of generating an overflow, but this was always an option you had to explicitly enable.
0 Kudos
Reply