Example #1
0
        public Dataword encode()
        {
            Dataword parity = calculateParity();

            Dataword codeword = concatenate(bufferedDWord, parity);

            return(codeword);
        }
Example #2
0
        private Dataword or(Dataword d2)
        {
            Debug.Assert(datawordLength == d2.datawordLength);
            bool[] result_bits = new bool[datawordLength];

            for (int i = 0; i < datawordLength; i++)
            {
                result_bits[i] = bits[i] || d2.getBits()[i];
            }

            string result_data = bitsToString(result_bits);

            Dataword result = new Dataword(result_data, datawordLength);

            return(result);
        }
Example #3
0
 //dummy return value at the moment
 private Dataword concatenate(Dataword d1, Dataword d2)
 {
     return(d1);
 }
Example #4
0
        //Dummy parity at the moment
        private Dataword calculateParity()
        {
            Dataword parity = new Dataword("1", parityLength);

            return(parity);
        }
Example #5
0
 //Stores the dataword we want to encode internally in the encoder. To bear resemblance to a hardware implementation
 public void bufferDataword(Dataword dword)
 {
     this.bufferedDWord = dword;
 }