bckurera's thoughts

Just another WordPress.com site

High Density Bipolar of order 3 (HDB3)

on May 1, 2012

Yesterday I got a call asking about HDB3 encoding. Since I am not memorizing everything under the sun I couldn’t answer at once but I learnt it in few minutes thanks to Google (referng to classic Tanenbaums’ Computer Networks book is much boring) and fulfill the need of my friend.

Encoding exercises are always very interesting and fun. If you are into IT, you should have gone through Data Communication & Network  module which is full of protocols. Being frank I hate that subject, I am not good at memorizing things and applying them, I am not a robot after all.

Following is what HDB3 is, ( I am noting the rest for my own reference if required later)

High Density Bipolar of order 3 (HDB3)


Algorithm

  1. Get the signal
  2. Convert it to Alternate Mark Inversion (AMI) form
  3. Look for 4 consecutive zeros and replace them with either 000V or B00V, Rule: If number of + and – at the left hand site of the consecutive 4 zeros is odd then use B00V else 000V
  4. If it is 000V then V polarity should be as same as the polarity of the preceding pulse of those 4 consecutive zeros. If it is B00V, B and V are in same polarity but opposite to the preceding pulse of those 4 consecutive zeros.

Examples:

101000000000010

AMI : +0-0000000000+0

+0-000V000000+0
+0-000-B00V00+0
+0-000-+00+00-0

Note :

  1. V is known as the violation bit.
  2. If the violation bit and the imidiate AMI bits’ polarity is similar then change the polarity of all AMI bits at the right hand side of the violation bit to their opposite polarity , keep this repeating for violation bits which satisfy the rule.
  3. As soon a 4 consecutive zeros is found convert it and proceed, because you have to count + and – for the next 4 consecutive zeros including the + and – on the last 4 consecutive zeros which you finished converting.

Example:

1100000000110000010

AMI : +-00000000+-00000+0

+-000V0000+-00000-0
+-000-B00V+-00000-0
+-000-+00++-00000-0
+-000-+00+-+00000+0
+-000-+00+-+B00V0+0
+-000-+00+-+-00-0+0

Note:

Note the change (in green) after the violation bit due to immediate AMI bit and violation bit are in same polarity. All AMI bits are changed to its'(compliment of the AMI bit at right hand side of the violation bit) opposite polarity.

Example :

1 0 1 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0

AMI : + 0 – 0 0 0 0 0 + – 0 0 0 0 + – 0 0 0 0 0 0

+ 0 – 0 0 0 V 0 + – 0 0 0 0 + – 0 0 0 0 0 0
+ 0 – 0 0 0 – 0 + – B 0 0 V + – 0 0 0 0 0 0
+0 – 0 0 0 – 0 + – + 0 0 + – + 0 0 0 V 0 0
+ 0 – 0 0 0 – 0 + – + 0 0 + – + – 0 0 – 0 0

Example :

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

AIM : + 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

+ 0 − 0 0 0 V + 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 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 0 V − + 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 0 0 − + − 0 0 0 0 + − + − 0 0 0 0 + 0 − 0 0 0 0
+ 0 − 0 0 0 – + 0 0 0 + − + B 0 0 V − + − 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 – + – + 0 0 0 0 – 0 + 0 0 0 0
+ 0 − 0 0 0 – + 0 0 0 + − + – 0 0 – + – + 0 0 0 + – + – + B 0 0 V – 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 0 0 – + 0 0 0 + − + – 0 0 – + – + 0 0 0 + – + – + – 0 0 – + 0 – B 0 0 V
+ 0 − 0 0 0 – + 0 0 0 + − + – 0 0 – + – + 0 0 0 + – + – + – 0 0 – + 0 – + 0 0 +

Reference : http://en.wikipedia.org/wiki/Modified_AMI_code#HDB3_.28European_E-carrier.29

Advertisements

Please add your valuable idea below, will make a discussion, thanks !

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: