over 2 years ago

## GSoC #7: Overflow Modes

Comparing to round modes I introduced in the last post, overflow modes are rather simple.

There are only 3 overflow modes in cfelton's _resize.py: saturate, ring, and wrap.

saturate means that if overflow occurs, the value will remain maximum (minimum if underflow).

ring and wrap behaves the same. If overflow occurs, it then builds up from minimum. Similarly, if underflow occurs, it goes down from maximum. For binary implementation, it is just reserve the last bits in its width.

We can see clearly in the original implementation: