# Error Correcting Code Generator Circuit Implementation with XOR gates

I am supposed to implement the logic circuit of an ECC Generator. The circuit itself has 8 Data bits (D1-D8) as inputs and as outputs it generates a 13-bit vector, which is the hamming code (with parity bits P0-P4) that protect the Data bits.

Therefore, we have:

P1 P2 D1 P3 D2 D3 D4 P4 D5 D6 D7 D8

P1 = XOR(3 5 7 9 11)

How would I implement P1 in a circuit with XOR gates to begin with?

If I feed inputs 3 5 7 9 11 into a XOR gate, will it indeed give me the result of the parity bit 1 (P1)?

This is the schema of the ECC Generator:

Thank you so much!!!

• Yes, "XOR(a, b, c, d)" indicates an XOR gate with 4 inputs. If your xor gates have fewer inputs you should work out how to combine them to make an equivalent to a 5-input XOR. Hint: it's very simple to do. Nov 3, 2015 at 0:08
• How is it possible to have inputs 9 and 11, when D has a range from 1 to 8? The term XOR(3 5 7 9 11) is not valid. a) 3 does not indicate it's D3. b) If XOR is a 5-input function, each input value should be delimited by ,. Nov 3, 2015 at 6:23

This question is quite open ended but ECC was fun to explain to my other friends back in college so where we go. Firstly, a correction: This produces a 12bit number, not a 13bit one. Data bits 0-7 and parity bits 0-3. Your schematic is wrong and would never work.

"If I feed inputs 3 5 7 9 11 into an XOR gate, will it indeed give me the result of the parity bit 1 (P1)?" Yes. That xor gate must have 5 inputs but yes. Also you shouldn't feed the outputs 3,5,7,9,11 of your circuit to the input so please refer to the equation as P1= D0 XOR D1 XOR D3 XOR D4 XOR D6.

If you don't have an XOR gate with 5 inputs then you'll need to ask a new question telling us what you actually have to work with.

• While the original Hamming code for an 8 bit number produces a 12 bit code, many people prefer SECDED which, for an 8 bit number, requires a 13 bit code, such as an extended Hamming code. The schematic looks fine to me. May 6, 2016 at 16:53