Hard to believe that I am still at this but as I mentioned in the last post about a week ago I'd keep messing with this. Yes this started out as something to do on the weekend, just a passing idea and now I can't stop. I have fallen in love with my excel spreadsheet and the "statistical quagmire" my sawtooth idea has turned into. Anyway on to the latest developments...

What I have come up with is a modification of the initial Sawtooth idea. HERE is the first idea so if you have not read that post this one probably wont make any sense (if any of this can make sense). So from here on out I'll assume that my faithful readers have been keeping up with what I have been doing and I'll jump right in with a picture. (You can click on it to see it in detail)

This is very similar to what I was doing in the first post. I changed the math a little by using the same modulus (257) for both the Saw Forward and the Saw Reverse parts that you can see in the Excel rows 10, 11, 13 and 14 in the picture above. The same thing is going on below on rows 19, 20, 22 and 24. As in the first spreadsheet (origional post) the same exact mathematical functions are goin on in the 'upper' and the 'lower' part of the picture. The significant part that I changed was I got rid of one Saw Forward and one Saw Reverse function and replaced it with 2 'layers' of a Pseudo-Hadamard Transform. I decided to do this because I wasn't getting the diffusion that I wanted with just three layers, iterations or rounds (whatever you call 'em) of the Sawtooth idea.

Anyway at first glance this looks to be much better. I still am not sure what (if anything) I am going to do with this when (if) I am ever finished but it is fun... The PHT part is being done mod 257 as well by the way. So if you take a look again at the picture you can see that on row 9 there is a blue Input row with seven 0's and one number 2 in it. If you compare that to row 18 there are also seven 0's and a number 1. Up at the top of the picture there is a box where there is the I' * I" and you can see the binary Exclusive OR of the inputs which are all mostly 0's with just a couple of 1's. That is because 2 (00000010) exclusive OR'd with 1 (00000001) is 3 (00000011). The numbers under all the 0's are the number of 1' in each number (or the number of different bits) And below that is another similar box with O' * O" with a bunch more binary numbers. That box is showing the difference between the outputs (rows 16 and 25 in the spreadsheet). What I am getting at here is in the picture the difference of the inputs is 2 bits and the difference of the outputs is a bunch of bits (38 to be exact) spread out all over the place. That is what I want.

So to repeat the same experiments that I did in the previous posts I ran a "walking 1" input bit difference through all 64 input bits with 8 different input values giving me a total of 512 outputs. The first input values were all 0's and the second input values all 255 woth the remaining 6 random numbers. Go back to THIS post if this doesn't make sense and to get the source code for Visual Basic for Excel that does the walking 1.

As in the other posts I created a chart to show the number of output bits that changed per byte with one input bit flipped through all the input values:

# Bits Diff | Totals | |||||||||

2 | 5 | 4 | 1 | 2 | 3 | 1 | 2 | 8 | 20 | |

25 | 7 | 23 | 11 | 21 | 16 | 18 | 19 | 7 | 140 | |

59 | 39 | 54 | 54 | 70 | 83 | 63 | 69 | 6 | 491 | |

98 | 93 | 135 | 117 | 87 | 142 | 110 | 155 | 5 | 937 | |

137 | 112 | 176 | 143 | 148 | 155 | 134 | 164 | 4 | 1169 | |

106 | 112 | 72 | 134 | 149 | 113 | 116 | 63 | 3 | 865 | |

85 | 111 | 48 | 52 | 35 | 0 | 70 | 40 | 2 | 441 | |

0 | 32 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 32 | |

0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |

That is a confusing chart! Well not really confusing... if you look at the green 1 on the left hand side (under the 32) and follow that row across you see a green 0 and a green 1. What that is saying is that one byte had 0 bits different for a total of one time, and that one byte was the second from the left. Now go to the row above that with the 32 in it. That row is saying that there were 32 bytes that had only 1 bits different for a total of 32 times and they too were all the second bytes from the left. You can go up the rows and see how many bytes had bits different, the number of bits different, which bytes they were and the total number of bytes...etc... you get the idea. The thing I wanted to point out is unlike the same charts in the previous posts there are much fewer unchanged bytes - one in fact. Also in looking at the Totals column mostly there were bytes that had 4 bits different (1196 of them) and the distribution is weighted toward 8 bits changing and not 0 bits changing.

Wow that is a huge waste of my time doing this but it is fun and like I said I have fallen in love with my Excel spreadsheet. I don't like the fact that the 1 bit change 32 times and the 0 bit change 1 time were in the same byte location. I'll figure out why that is happening and also the distribution by # of bits change by byte location isn't as smooth as I would like or expect. Something isn't working right. Enough of this for now.

I have another exciting electronic project brewing in the garage so stay tuned.

## No comments:

## Post a Comment