ByteToDecimal is a program designed to help students practice converting eight-bit (one byte) binary numbers to decimal values. This is a simple bare-bones Python console application - it runs in a DOS window as opposed to a GUI environment.
- Generates random eight-bit (one byte) binary numbers.
- User can set the number of bits which should be set to a value of "1" (from 1 to 8).
- Displays correct answer after user enters his/her answer.
- Percentage of correct answers is displayed.
- Percentage statistics can be reset.
ByteToDecimal was written in Python 3.1.
When prompted for the decimal equivalent of the binary value, enter one of the following:
- the equivalent decimal value.
- 'n' to generate a new byte.
- 'o' to change the number of ones in the binary value and generate a new binary value.
- 'c' to reset the statistics.
- 'q' to quit.
The source code can be viewed in a browser or any text editor.
The source code can be run directly if Python 3.x is installed on your computer, but the file extension will need to be changed from ".python" to ".py". Python can be downloaded from www.python.org.
ByteToDecimal.python (4 KB)