Academy
English한국어

14 / 24 · Concept

What follows the maximum value?

Calculate addition beyond the register width.

Learning goals

  • Calculate an addition that exceeds the stored width
  • Distinguish wrapping from saturation

Store only the bits that fit

Adding one to 11 mathematically gives 100. count stores only the low two bits, 00, so its next state is zero. This counter cycles through values zero to three.

A counter that stops at three needs an explicit condition. Declaring two bits does not automatically make it stop at its maximum.

CurrentPlus oneStored two bits
0000101
0101010
1001111
1110000

A new width needs new expectations

An unsigned N-bit counter represents zero through 2 to the power N minus one. A three-bit version wraps after seven. Check initialization, literal widths and expected waveforms along with the declaration.

First explain the original sequence 00 → 01 → 10 → 11 → 00. Then work on a copy, change the width and predict how the sequence will differ.

Try it yourself

A three-bit counter holds 110 with reset inactive. What are its next two values?

Read the explanation

111, then 000. The first edge reaches seven and the second wraps beyond the three-bit range.

Your choice applies to this browser. Change it any time using the footer.