How can I encode 0000 to 11110 in 4B/5B encoding scheme
Asked Answered
H

1

7

4B/5B encoding

4B/5B ecoding

From the 4B/5B encoding scheme dataward 0000 in encoded to 11110 codeword similarly 0001 is encoded to 01001 etc.

Here the result of XOR operation between two codewords will be another valid codeword.

For example XOR of 11110 and 01001 is another codeword 10111 whose dataword is 1011.Here I have no problem.

Again, to avoid dc component NRZ-I line coding scheme is used. As a result there is not three consecutive Zero's in the output codewords. There is no more one heading and two tailing zero's in codewords. We have no worry about the number of one's in NRZ-I coding scheme.

But, how can I encode 0000 to 11110 or 0001 to 01001 and which algorithm I should apply for this encoding scheme.

I search google and study books too. But everywhere they are telling only the same thing but I did not get my answer.

Thanks in advance

Hecto answered 9/7, 2017 at 1:26 Comment(6)
I think this is better suited to StackExchange Electrical Engineering, not sure why you're looking for an algorithm, the encoding is a conversion tableTericaterina
You encode using a lookup table. There are only 16 table entries.Mekka
other 16 entries or codewords will remain unused and those codewords are called invalid codewords.Hecto
There are only 16 entries in the encoding table (0 to f). That is how you encode 4B5B, which is what you have asked. A decoding table would have 32 entries. Typically, this is done by the hardware with fixed tables in ROM, but if you want to do it in software, then you create the tables in your application.Mekka
thanks Ron Maupin for your answer.Hecto
Micho thanks you too.Hecto
I
7

Decimal Representation

To understand this mechanism properly we should consider all codewords’ decimal value. Observe the above table carefully I converted all binary value of your table to decimal form.

Now to avoid dc component during transmission we should consider only the codewords which don’t have more than one starting and two tailing zeros . So we get every two consecutive datawords are assigned to another two consecutive codewords.

Like this

(2,3) to (20,21),

(4,5) to (10,11)

(6,7) to (14,15)

(8,9) to (18,19)

(10,11) to (22,23)

(12, 13) to (26,27)

(14,15) to (28,29)

Exception

(0,1) to (30,9)

1 is assigned to 9 because all codewords from 0 to 8 (inclusive) are invalid because of having excessive zero . So first valid codeword 9 is assigned to 1. If all valid codewords are assigned consecutively then changing only one bit (single bit error) during transmission it will convert to next or previous codeword and this error will remain undetected.

We know that in block coding if a valid codeword is convert to another valid codeword during transmission as a result of error , it will remain undetected and this a limitation of block coding. So to avoid this these all valid codewords are not consecutively assigned with datawords.

Introrse answered 14/7, 2017 at 15:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.