Binary Counter

written by Teresa Carrigan


Run model in your browser


Top

THINGS TO NOTICE

Watch the decimal equivalent monitors while you count. Notice that when the left-most bit is zero, they all agree, but when the left-most bit is one, they all disagree. Is that always the case? Can you find a case where the signed magnitude agrees with either one's complement or two's complement, but not the others?

Determine algebraic expressions between the different equivalents. One's complement and two's complement are easy.

What is the range of possible values for the different equivalents? Determine algebraic expressions for the ranges, in terms of the number of bits.

Top

THINGS TO TRY

Set the slow-motion to about .10 seconds (or slower) and press the increment button a few times. Watch the red arrow change bits, and notice when it decides no more bits need to be changed.

What happens when all the bits are one, and you increment again?

What happens to the decimal equivalents when all the bits except the left-most one are one, and you increment again?


Home

Applets on this website were written by Teresa Carrigan in 2004, for use in computer science courses at Blackburn College, with the exception of the Fireworks applet. The applets made with NetLogo require Java 1.4.1 or higher to run. The applets made with NetBeans require Java 1.4.2 or higher to run. Applets might not run on Windows 95 or Mac OS 8 or 9. You may obtain the latest Java plugin from Sun's Java site.