0

In a logic circuit, I have an 8-bit data vector that is fed into an ECC IC which I am supposed to develop the logic for and that contains a vector of 5 Parity Bits. My first step to develop the logic (with logic gates, XOR), is to figure out which parity bit is going to check for which Data bits (since they are interlaced). I am using even parity, and following general hamming code rules (a parity bit in every 2^n ), I get the following sequence of output:

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

Following the General Hamming Algorithm:

For each parity bit, Position 1,2,4,8,16 and so on... (Powers of 2), we skip for the first position n (n-1) and we check 1 bit, then we skip another one, the check another one, etc... we repeat the same process for the other bits, but this time checking/skipping every 2^n, where n is the position they occupy in the output array (P1 P2 D1 P3 D2 D3 D4 P4 D5 D6 D7 D8 P5)

Following that convention, I get:

P1 Checks data bits -> XOR(3 5 7 9 10 12) P2 Checks data bits -> XOR(3 6 7 10 11) P3 Checks data bits -> XOR(5 6 10 11 12) P4 Checks data bits -> XOR(9 10 11)

Am I right? The thing that confuses me is that if I should start checking counting the parity bit as one of the 2^n bits that are supposed to be checked, or 1 bit after that specific parity bit. Pretty much sums up to if it is inclusive or not.

Thank you for your help in advance!

Cheers!

Cesar A
  • 663
  • 1
  • 7
  • 10

1 Answers1

0

You can follow this sheme. The bits marked in each row must sum up to 0 (mod 2) in other words for the marked positions in each row the number of set bits must be even.

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

I don't understand why you have P5 in the scheme.

Henry
  • 42,982
  • 7
  • 68
  • 84
  • Got it! Do you happen to know how to implement that logic with XOR gates? Or at least could you give me a hint? The logic I am referring to is P1 = XOR(3, 5, 7 ,9, 11) – Cesar A Oct 31 '15 at 22:31
  • Not sure what you are asking: feed the inputs 3,5,7,9,11 into the XOR gate and out comes the result P1. – Henry Nov 01 '15 at 07:13
  • Is it as easy as that? So if I feed all inputs (3 5 7 9 11) for P1 into an XOR gate, will it give me the result of P1? What is the logic of the XOR gate with multiple outputs? – Cesar A Nov 02 '15 at 23:43
  • What do you mean with multiple outputs? An XOR gate has just one output. But we are getting more and more off topic. – Henry Nov 03 '15 at 05:28