In the 4B/5B encoding scheme, every 4 bits of data are encoded in a 5-...
Answer is (C)
It says we have 5 bit codeword such that "it can't have two consecutive zeros in first and second bit" and
also" can't have two consecutive zeros in last two bits.
Code word with first two bits zero = 0|0|x|x|x| =8
Code word with last two bits zero = |x|x|x|0|0| =8
Code word with first and last two bits zero = 0|0|x|0|0| =2
Code word with first OR last two bits zero = 8+8-2=14
Therefore possible codewords =32-14 =18
View all questions of this test
In the 4B/5B encoding scheme, every 4 bits of data are encoded in a 5-...
The possible codewords should not have 00xxx or xxx00
=> Total possible combinations of 5 bits – for (00xxx or xxx00)+ (00*00) {as 00*00 is subtracted twice once each from both cases}
=> 232 – (8+8) +2 = 18
In the 4B/5B encoding scheme, every 4 bits of data are encoded in a 5-...
Explanation:
To generate the 4B/5B codewords, we need to consider the possible combinations of 4 bits of data and ensure that the resulting 5-bit codeword meets the requirements of having at most 1 leading and at most 1 trailing zero.
Possible combinations of 4 bits:
There are 2^4 = 16 possible combinations of 4 bits. These combinations range from 0000 to 1111.
Encoding scheme:
In the 4B/5B encoding scheme, each 4-bit combination is encoded into a unique 5-bit codeword. Let's analyze the possible codewords for each 4-bit combination:
1. 0000: This combination has 2 trailing zeros, which is not allowed. Therefore, it is not a valid codeword.
2. 0001: This combination has 3 trailing zeros, which is not allowed. Therefore, it is not a valid codeword.
3. 0010: This combination has 2 trailing zeros, which is not allowed. Therefore, it is not a valid codeword.
4. 0011: This combination has 1 trailing zero, which is allowed. Therefore, it is a valid codeword.
5. 0100: This combination has 2 trailing zeros, which is not allowed. Therefore, it is not a valid codeword.
6. 0101: This combination has 1 trailing zero, which is allowed. Therefore, it is a valid codeword.
7. 0110: This combination has 1 trailing zero, which is allowed. Therefore, it is a valid codeword.
8. 0111: This combination has 0 trailing zeros, which is allowed. Therefore, it is a valid codeword.
9. 1000: This combination has 1 leading zero, which is allowed. Therefore, it is a valid codeword.
10. 1001: This combination has 1 leading zero and 1 trailing zero, which is allowed. Therefore, it is a valid codeword.
11. 1010: This combination has 1 leading zero and 1 trailing zero, which is allowed. Therefore, it is a valid codeword.
12. 1011: This combination has 1 leading zero and 1 trailing zero, which is allowed. Therefore, it is a valid codeword.
13. 1100: This combination has 1 leading zero and 2 trailing zeros, which is not allowed. Therefore, it is not a valid codeword.
14. 1101: This combination has 1 leading zero and 1 trailing zero, which is allowed. Therefore, it is a valid codeword.
15. 1110: This combination has 1 leading zero and 1 trailing zero, which is allowed. Therefore, it is a valid codeword.
16. 1111: This combination has 1 leading zero and 2 trailing zeros, which is not allowed. Therefore, it is not a valid codeword.
Total number of valid codewords:
From the analysis above, we can see that there are 9 valid codewords out of the 16 possible combinations of 4 bits. Therefore, the total number of valid codewords is 9.
Therefore