Smallest Legal Base Simulation

written by Teresa Carrigan



Top

WHAT IS IT?

This model determines the smallest legal base for a random digit pattern. The quiz will test your understanding of this concept.

Top

HOW IT WORKS

The arrow passes through the digits from one side to the other, remembering the largest digit it finds. The digit pattern will be legal in all bases that are larger than the largest digit found, so the smallest legal base is one more than that largest digit.

Top

HOW TO USE IT

The setup button creates a random digit pattern.

The slow-motion slider is an easy way to adjust the speed of the display. Set it to zero if you want to show the final result as quickly as possible. 0.3 is a good setting for most purposes.

The go button does all remaining steps, at a speed determined by the slow-motion slider. This is useful when you do not need to take notes between each step, or do not wish to press the step button several times to get an answer. If you want to pause the demonstration, simply click the go button a second time and it will stop after it finishes the current step. You may then click go a third time to resume.

The quiz button will generate a random digit pattern, and ask you to determine the smallest legal base.

The show-again button starts the exact problem from the beginning. You may then click either the step button or the go button to see the same demonstration.

Top

THINGS TO NOTICE

The smallest legal base is always one more than the largest digit found in the digit pattern. If that digit is A, B, C, D, E or F, then the digit is converted to its decimal equivalent first. For example, if a digit pattern contains an F, then the smallest legal base would be 16, because F represents the decimal number 15.

Top

THINGS TO TRY

Set slow-motion to 0.3, click setup, and then click go.

Click setup, and then determine on paper what the answer would be. Click go to check your answer.

Top

EXTENDING THE MODEL

Modify the model to show fixed point representation; that is, specify a given number of digits to the right of the decimal place.

Allow the user to input a starting digit pattern.

Top

NETLOGO FEATURES

Extensive use is made of "ask patches with".

"other-digit-here" is used by the arrow to check the value of each digit.

Top

RELATED MODELS

Top

CREDITS AND REFERENCES

This model was written by Teresa W. Carrigan, 2004.

Permission to use, modify or redistribute this model is hereby granted, provided that both of the following requirements are followed:

  1. this copyright notice is included.
  2. this model will not be redistributed for profit without permission from Teresa Carrigan.
Contact Teresa Carrigan for appropriate licenses for redistribution for profit.

To refer to this model in academic publications, please use: Carrigan, T. (2004). Smallest Legal Base Simulation model. Blackburn College, Carlinville, IL.

In other publications, please use: Copyright 2004 by Teresa W. Carrigan. All rights reserved.

Top

FOR MORE INFORMATION

For more information, see one of the following textbooks:
  1. Null, L. and Lobur, J. Essentials of Computer Organization and Architecture, First Edition, Jones and Bartlett, page 38.
  2. Dale, N. and Lewis, J. Computer Science Illuminated Second Edition, Jones and Bartlett, page 38.


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.