Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string seed = textBox1.Text;

            taps = textBox6.Text.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(n => Convert.ToInt32(n)).ToArray();
            LFSR lsfr = new LFSR(seed.Length, seed, taps);

            outputCiag = new StringBuilder();

            for (int i = 0; i <= Convert.ToInt32(textBox3.Text); i++)
            {
                gen(lsfr);
            }

            SaveData();
        }
Exemple #2
0
 private void gen(LFSR lsfr)
 {
     bool[] output;
     output = lsfr.Output;
     if (output[0] == true)
     {
         if (output[1] == true)
         {
             outputCiag.Append("1");
         }
         else
         {
             outputCiag.Append("0");
         }
     }
     else
     {
         lsfr.Shift();
         this.gen(lsfr);
     }
     lsfr.Shift();
 }