Run-Length-Limited Encoding Simulation
written by Teresa Carrigan
- WHAT IS IT?
- How it works
- How to use it
- Things to notice
- Things to try
- Extending the model
- NetLogo features
- Related models
- Credits and References
- For more information
- Download the model
WHAT IS IT?
This model demonstrates the Run-Length-Limited encoding method. RLL is designed to limit the number of consecutive zeroes, and is frequently used to store data on magnetic disks.
HOW IT WORKS
A random bit pattern is generated, from seven to ten bits long. This is the data that we want to store on the magnetic disk.Starting from the left-most bit, we find a bit pattern (two to four bits) that has an RLL encoding. 10 becomes 0100, 11 becomes 1000, 000 becomes 000100, 010 becomes 100100, 011 becomes 001000, 0010 becomes 00100100, and 0011 becomes 00001000. This is repeated until the entire data bit pattern is encoded.
The RLL encoding of the data is then sent to the magnetic disk using NRZI transmission encoding. For each bit sent, both a synchronization clock pulse and the transmission waveform are displayed.
HOW TO USE IT
The setup button generates a random bit pattern, and initializes variables for the chosen encoding.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 step button demonstrates the next step of the method, and then stops so you can take notes. The first few steps find the next set of data bits that can be encoded into an RLL bit pattern. Once the full message is encoded, each step processes the next bit of the encoded message. Taking notes after each step is useful when you are first learning RLL or NRZI.
The go button processes the remaining bits, 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 sixteen 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 show-again button starts the exact same data bit pattern from the beginning.
THINGS TO NOTICE
Some encoding schemes are prone to loss of synchronization due to too many time slices at the same voltage level. What is the greatest number of time slices that can be produced by RLL-encoding?If the average voltage is not zero, then there is a DC component to the signal. This can cause signal distortion and possibly even damage equipment. Does RLL have this problem?
A magnetic disk can store more bits per inch if there are fewer transitions between high and low signal (positive and negative magnetic charge). How many transitions does RLL usually have, compared to other encoding schemes?
THINGS TO TRY
Set slow-motion to 0.3 and then click go.Click setup. Attempt one step at a time on paper, and then click the step button to check that you did that the step correctly.
EXTENDING THE MODEL
Allow the user to input a starting bit pattern.Modify so that the signal is generated first, and then translated into the original data bits.
NETLOGO FEATURES
Extensive use is made of NetLogo commands substring and member? in translating the original data bit pattern to the RLL encoded bit pattern.
RELATED MODELS
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:
Contact Teresa Carrigan for appropriate licenses for redistribution for profit.
- this copyright notice is included.
- this model will not be redistributed for profit without permission from Teresa Carrigan.
To refer to this model in academic publications, please use: Carrigan, T. (2004). Run-Length-Limited Encoding Simulation Blackburn College, Carlinville, IL.
In other publications, please use: Copyright 2004 by Teresa W. Carrigan. All rights reserved.
FOR MORE INFORMATION
For more information on Run-Length-Limited Encoding, see:
- Null, L. and Lobur, J. Essentials of Computer Organization and Architecture, First Edition, Jones and Bartlett, pages 71-73.
HomeApplets 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.