public Dataword encode() { Dataword parity = calculateParity(); Dataword codeword = concatenate(bufferedDWord, parity); return(codeword); }
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); }
//dummy return value at the moment private Dataword concatenate(Dataword d1, Dataword d2) { return(d1); }
//Dummy parity at the moment private Dataword calculateParity() { Dataword parity = new Dataword("1", parityLength); return(parity); }
//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; }