Counting in Other Number Bases

written by Teresa Carrigan


Run model in your browser


Top

WHAT IS IT?

This model demonstrates counting positive integers in any base from two to sixteen, and it also gives the decimal equivalent of each number as it counts. This demonstration will help you understand better how to count in various number bases.

Top

HOW IT WORKS

Each time the current number is incremented, the red arrow passes to the left. When it finds a digit that is one less than the base, it changes that digit to a 0 but continues to the left. When it finds a digit that is two or more less than the base, it changes adds one to that digit and then returns to the start position.

Each patch holding a digit has three variables. The place-value is the decimal amount that a 1 in that position would have. The right-most place value is 1, the next is (base), the third is (base) squared, etc. with each place-value the next power of (base). The digit-value is the digit showing in that position. The current-value of a patch will equal the place-value times the digit-value.

The decimal equivalent of the number is the sum of all the current-values of the patches. If you are familiar with different data representations, this is the unsigned representation.


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.