Maths & numbers

Signed addition overflow at a fixed width calculator

Show the mathematical sum and the wrapped result of fixed-width two’s complement addition.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Show the mathematical sum and the wrapped result of fixed-width two’s complement addition.

THE FORMULAWrap the sum modulo 2ʷ and interpret it in the signed range

A worked example

At width eight, 100+40 wraps from 140 to −116.

Good to know

Both operands must fit the selected width.

Read the result

Show the mathematical sum and the wrapped result of fixed-width two’s complement addition.

The primary result is labeled “Wrapped signed sum”. Keep the input definitions in view when comparing this result with another method.

Try a related calculation

Both operands must fit the selected width.

For a related exercise, try the greatest common divisor.

A few questions, answered

How can I check the default inputs by hand?

At width eight, 100+40 wraps from 140 to −116.

Which rule does this calculator apply?

Wrap the sum modulo 2ʷ and interpret it in the signed range

Find your calculator

Start typing to explore the library.