XOR Calculator

The XOR Calculator applet is used to XOR together two data values of up to 256-bits (64 hex digits). It also calculates the hamming weight (number of 1's) in the result.

Using the XOR Calculator

The XORcalc.html page is used to access the XOR Calculator. To use the calculator fill in the two Input Data values, each up to 64 hexadecimal digits long, and then press the XOR button to compute and display the result. If there is an error in the supplied values, an error message will be displayed in red.


Installing the XOR Calculator on your own System

You can install the XOR Calculator on your own system by uploading the following files, and saving them all in the same directory:

XORcalc.html (1kb)
the HTML file used to run the applet
XORcalc.jar (38kb)
the Java JAR file containing the code for the program, which is loaded by XORcalc.html.

Then open your local saved copy of XORcalc.html in your favorite (Java enabled) web browser. You may need to install a suitable Java v1.4 plugin for your browser - this is available from the J2SE Java distributions, which are included in the useful programs area for this course (CD only). You will need to copy/link the appropriate browser plugin file from the J2SE installation area to the plugin directory for your browser and restart it.

If you want to look under the hood, the sources are available in the jarfile. Copy it onto your system, extract files with "jar xvf XORcalc.jar", and look at the README file for more information. A Unix Makefile for building the sources using the Java SDK is included. The source code is written for clarity, not for efficiency!


Authorship & Copyright

The XOR Calculator applet was written by Lawrie Brown from ADFA, Canberra Australia. Lawrie's code is Copyright © 2008 by Lawrie Brown. Permission to reuse this code as desired is granted, provided due acknowledgement is given of the author and source of the original code.


[Back to Programs]
Lawrie Brown / 8 Feb 2008