<< Chapter_9_Conclusion

Index of HTML Docs

APPENDIX_B_Store.cpp >>

 

 

APPENDIX A

TABLES FOR ICON GENERATION

 

NOTE: The code used to generate the values in these tables is included in this Appendix A. The code simulates the input/output of a transform generator and so is useful as a tool to show the transform of specific input strings. But the tool cannot be used in practice as an actual transform generator, because it processes the binary numbers as though they were arrays of integers; it is inherently far too slow to be useful as part of an operative transform generator.

 

Table Element

Value

Table Element

Value

0000

0000000000000000

1000

1111011100110010

0001

1010010100110011

1001

0101001000000001

0010

1110111101010101

1010

0001100001100111

0011

0100101001100110

1011

1011110101010100

0100

0111101110011001

1100

1000110010101011

0101

1101111010101010

1101

0010100110011000

0110

1001010011001100

1110

0110001111111110

0111

0011000111111111

1111

1100011011001101

Table A-1. Transform Look-up Table

 

Table Element

Value

Table Element

Value

0000

0000000000000000

1000

1011010111101101

0001

0100101101010111

1001

1111111010111010

0010

1001011010101110

1010

0010001101000011

0011

1101110111111001

1011

0110100000010100

0100

1000100001101111

1100

1101001011010111

0101

1100001100111000

1101

0011110110000010

0110

0001111011000001

1110

1010101100101100

0111

0101010110010110

1111

1110000001111011

Table A-2. Shifted Transform Look-Up Table

 

Table Element

Value

Table Element

Value

0000

0000000000000000

1000

1110001110000100

0001

1100111011101001

1001

0010110101101101

0010

0011100011100001

1010

1101101101100101

0011

1111011000001000

1011

0001010110001100

0100

0111000111000010

1100

1011001001000110

0101

1011111100101011

1101

0101110010101111

0110

0100100100100011

1110

1010101010100111

0111

1000011111001010

1111

0110010001001110

Table A-3. Double Shifted Transform Look-Up Table

 

Table Element

Value

Table Element

Value

0000

0000000000000000

1000

0101101110111110

0001

0110001000111011

1001

0011100110000101

0010

1100010001110110

1010

1001111111001000

0011

1010011001001101

1011

11111011110011

0100

0010110111011111

1100

0111011001100001

0101

0100111111100100

1101

0001010001011010

0110

1110100110101001

1110

1011001000010111

0111

1000101110110010

1111

1101000000101100

Table A-4. Triple-Shifted Transform Look-Up Table

 

Table Element

Value

Table Element

Value

0000

0000

1000

1101

0001

1001

1001

0100

0010

1000

1010

0101

0011

0001

1011

1100

0100

1011

1100

0110

0101

0010

1101

1111

0110

0011

1110

1110

0111

1010

1111

0111

Table A-5. Reverse Transform Look-Up Table

 

 


Mod 2 Division Tool:

 

## Written in KornShell93

input_string=$1;

polynomial=11010010100110011;       # Change this to the polynomial you desire.

show_calculations=FALSE;    # If TRUE, will show all calculations leading to transform

 

integer input_length=${#input_string};

integer polynomial_length=${#polynomial};

 

## A little bit of idiot checking

if (( input_length < polynomial_length ))

then

   print "Input length can't be less than polynomial length; exiting.";

   exit;

fi

 

# Initialize arrays and zero string and underline string

integer dividend_array;

integer polynomial_array;

zero_string="";

underline_string="";

integer transform_array;

 

for (( i=0; i <= polynomial_length - 1; i++ ))

do

   dividend_array[i]=${input_string:i:1};

   polynomial_array[i]=${polynomial:i:1};

   zero_string=${zero_string}0;

   underline_string=${underline_string}_;

done

 

#initialize ip (input pointer) and offset

offset="";

integer ip;       # Points to last character put into the dividend array

                  # Later, will point to next character to put into it

(( ip = polynomial_length - 1 ));

 

 

###############  FUNCTIONS START HERE  ###################

 

function char_xor

{

if (( $1 == $2 ))

then

   print 0;

else

   print 1;

fi

}  #end function char_xor

 

 

function create_transform

{

subtractor=$1;

for (( j=0; j <= polynomial_length - 2; j++ ))

do

   transform_array[j]=$(char_xor ${dividend_array[j+1]} ${subtractor:j+1:1});

done

}   # end function create_transform

 

function create_dividend

{

for (( i=0; i <= polynomial_length - 2; i++ ))

do

   dividend_array[i]=transform_array[i];

done

dividend_array[polynomial_length-1]=${input_string:ip:1};

}  # end function create_dividend

 

function print_dividend

{

dividend_string="";

for (( i=0; i <= polynomial_length - 1; i++ ))

do

   dividend_string=${dividend_string}${dividend_array[i]};

done

print "$offset$dividend_string";

}   # end function print_dividend

 

 

###############  MAIN STARTS HERE  ###########################3

 

if [[ $show_calculations = TRUE ]]

then

   print "$input_string";

fi

 

while :

do

   if (( dividend_array[0] == 0 ));

   then

      subtractor_string=$zero_string;

   else

      subtractor_string=$polynomial;

   fi

 

   if [[ $show_calculations = TRUE ]]

   then

      print "$offset$subtractor_string";

      print "$offset$underline_string";

   fi

 

   create_transform $subtractor_string;

 

   offset=${offset}" ";

 

   if (( ip == input_length - 1 ))

   then

      break;

   else

      (( ip++ ));

      create_dividend;

      if [[ $show_calculations = TRUE ]]

      then

         print_dividend;

      fi

   fi

done

 

transform_string="";

for (( i=0; i <= polynomial_length - 2; i++ ))

do

   transform_string=${transform_string}${transform_array[i]};

done

 

if [[ $show_calculations = TRUE ]]

then

   print "$offset$transform_string";

fi

 

ft=$transform_string;         # ft for "final transform"

oput="";

for (( i=0; i <= polynomial_length - 1; i = i + 4 ))

do

   oput=${oput}${ft:i:4}" ";

done

print "Transform for $input_string is:   $oput";

 

 

Driver for Mod 2 Division Tool

# This tool calls the Mod 2 Division Tool multiple times so that we output with

# one command all the values that are needed in Tables A-1 through A-4.

 

for repeat in standard single double triple

do

   if [[ $repeat = standard ]]

   then

      tail="";

   elif [[ $repeat = single ]]

   then

      tail=0000;

   elif [[ $repeat = double ]]

   then

      tail=00000000;

   else

      tail=000000000000;

   fi

 

   sixteen_zeroes=0000000000000000;

 

   for two_variants in 0 1

   do

      for eight_variants in 000 001 010 011 100 101 110 111

      do

 

 

         mod2division $two_variants$eight_variants$tail$sixteen_zeroes;

 

 

      done

   done

done

 

 

<< Chapter_9_Conclusion

Index of HTML Docs

APPENDIX_B_Store.cpp >>