Packed Binary Coded Decimal Simulation

written by Teresa Carrigan


Run model in your browser


Top

EXTENDING THE MODEL

Allow the user to input a starting decimal number.

Modify so that the packed BCD bit pattern is generated first, and then conversion to decimal is demonstrated.

Modify the model to demonstrate zoned-decimal coding.

Top

NETLOGO FEATURES

Instead of converting each decimal digit to binary every time we process a digit, the different characters and bit patterns are stored in lists once. When we process a character from the decimal number, the lookup procedure simply uses "set n position what from-list report item n to-list"

Top

RELATED MODELS


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.