OpenCores
no use no use 1/1 no use no use
HDB3 encoding and decoding
by akshay2073 on May 6, 2012
akshay2073
Posts: 1
Joined: May 6, 2012
Last seen: Jul 2, 2012
hello everyone i needed the coding of HDB3 encoding and decoding using verilog as language .first i will tell wat is HDB3 Used in all levels of the European E-carrier system, the high density bipolar of order 3 (HDB3) code replaces any instance of 4 consecutive 0 bits with one of the patterns "000V" or "B00V". The choice is made to ensure that consecutive violations are of differing polarity, i.e. separated by an odd number of normal + or - marks.
HDB 3 coding of "0000"
Number of +/- bits
since last V Pattern Polarity
of last Pulse Coded
odd 000V + 000+
� 000�
even B00V + �00�
� +00+
These rules are applied on the code as it is being built from the original string. Everytime there are 4 consecutive zeros in the code they will be replaced by either 000�, 000+, +00+ or �00�. To determine which pattern to use, you have to count the number of pluses (+) and the number of minuses (�) since the last violation bit V that you used and subtract one from the other. If the result is an odd number then 000� or 000+ is used. If the result is an even number then +00+ or �00� is used. To determine which polarity to use you must look at the pulse preceding the four zeros. If 000V form must be used then V simply copies the polarity of last pulse, if B00V form must be used then B and V chosen will have the opposite polarity of the last pulse.

Summary of HDB3 encoding rules
Transmitted Data HDB3 Encoded Pattern
0 0
1 Alternate Mark Inversion (AMI)
0000 000V (three 0's and a violation)
0000 0000 B00V B00V
Example 1 of HDB3 encoding
The pattern of bits
" 1 0 0 0 0 1 1 0 "
encoded in HDB3 is
" + 0 0 0 V � + 0 "
(the corresponding encoding using AMI is " + 0 0 0 0 � + "). Example 2 of HDB3 encoding
The pattern of bits
" 1 0 1 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 "
encoded in HDB3 is " + 0 � 0 0 0 V 0 + � B 0 0 V � + B 0 0 V 0 0 " which is:
" + 0 � 0 0 0 � 0 + � + 0 0 + � + � 0 0 � 0 0 "
(the corresponding encoding using AMI is " + 0 � 0 0 0 0 0 + � 0 0 0 0 + � 0 0 0 0 0 0 ")
Example 3 of HDB3 encoding
The pattern of bits
" 1 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 0 1 0 0 0 0"
encoded in HDB3 is "+ 0 � 0 0 0 V + 0 0 0 V � + B 0 0 V + � + 0 0 0 V � + � + B 0 0 V + 0 � B 0 0 V " which is:
" + 0 � 0 0 0 � + 0 0 0 + � + � 0 0 � + � + 0 0 0 + � + � + � 0 0 � + 0 � + 0 0 + "
(the corresponding encoding using AMI is " + 0 � 0 0 0 0 + 0 0 0 0 � + 0 0 0 0 � + � 0 0 0 0 + � + � 0 0 0 0 + 0 � 0 0 0 0 ")
no use no use 1/1 no use no use
© copyright 1999-2026 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.