Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
930 Views

Signed addition in Nios II

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
Highlighted
Valued Contributor III
3 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