Search This Blog

Saturday, March 15, 2014

Hex to Decimal to Binary to Gray Code Converter Tool





I expanded the little windows/linux PC Java widget I made to decode bits while programming JTAG registers.  It was proving very useful.  Now it also includes Gray code.   This is a live tool that as soon as you enter a number in one format, it instantly updates the value in the others.   This saves a ton of time when you read a register and the individual bits are used set switches or report values and it is all glommed together into a big word.  A minimal amount of button clicking and typing decodes a hex value into it's bits, allows you to click one on or off, and tells you the new hex value.

I also added a big display of the hex and binary at the top.  Now this wastes a bit of screen space so it might get canned.  The tool is getting a bit big.

I used the rules here:
http://www.electrical4u.com/gray-code-binary-to-gray-code-and-that-to-binary-conversion/

I checked it against this gray code converter (which only goes one way)
http://www.miniwebtool.com/gray-code-to-binary-converter/?graycode=0001001010011000

I've tested it pretty thoroughly and it seems to be totally solid.

Download the executable java here:
https://drive.google.com/file/d/0B2Qrk8yU95oCTTNPd2RTWnB5UjA/edit?usp=sharing

All you have to do is doubleclick on the .jar file and it will run on your computer if you have java jre installed!  Most everybody does, but in case you don't you have to download from here:  https://www.java.com/en/download/

Complete source files in netbeans are also here:
https://drive.google.com/file/d/0B2Qrk8yU95oCbF9TTlMtV21oYnM/edit?usp=sharing


No comments:

Post a Comment