コード例 #1
0
        public Dataword encode()
        {
            Dataword parity = calculateParity();

            Dataword codeword = concatenate(bufferedDWord, parity);

            return(codeword);
        }
コード例 #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);
        }
コード例 #3
0
 //dummy return value at the moment
 private Dataword concatenate(Dataword d1, Dataword d2)
 {
     return(d1);
 }
コード例 #4
0
        //Dummy parity at the moment
        private Dataword calculateParity()
        {
            Dataword parity = new Dataword("1", parityLength);

            return(parity);
        }
コード例 #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;
 }