hades.utils
Class LFSR32

java.lang.Object
  extended byhades.utils.LFSR32

public class LFSR32
extends java.lang.Object

a 32-bit linear feedback shift register based on the (31 3 0) polynom. This class provides all methods to realize LFSR-based pseudorandom pattern generators and signature analyzers. The polynom used in this class is "hardcoded" and cannot be changed easily.


Constructor Summary
LFSR32()
           
 
Method Summary
 void clock()
          calculate the next state of the LFSR32 register.
 int getValue()
           
static void main(java.lang.String[] argv)
          simple LFSR32 selftest.
static void msg(java.lang.String s)
          print the specified string to stdout
 void normal_clock()
          calculate a new value for this LFSR32, based on the "normal" hardware solution with individual XOR taps.
 void setValue(int value)
           
 void signature_clock(int input_value)
          calculate a new value for this LFSR32, based on the "normal" clock method with individual XOR taps.
static void usage()
          print the usage message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LFSR32

public LFSR32()
Method Detail

setValue

public void setValue(int value)

getValue

public int getValue()

clock

public void clock()
calculate the next state of the LFSR32 register. We use the "software" realization based on one parallel XOR to generate a new LFSR32 value. See Numerical Recipes for details of the algorithm.


normal_clock

public void normal_clock()
calculate a new value for this LFSR32, based on the "normal" hardware solution with individual XOR taps. As our polynom has just 3 taps, this is quite fast.


signature_clock

public void signature_clock(int input_value)
calculate a new value for this LFSR32, based on the "normal" clock method with individual XOR taps. However, we first do a parallel XOR with input_value for signature analysis.


msg

public static void msg(java.lang.String s)
print the specified string to stdout


usage

public static void usage()
print the usage message


main

public static void main(java.lang.String[] argv)
simple LFSR32 selftest.