Line Coding Lab

Data Communication, Lecture 6. Type any bits and see them as a signal on the wire, under every line code, block code and scrambling rule from the lecture.

Each row: the same bits under a different line code · dashed lines = bit boundaries

Encode your bits

Conventions follow Forouzan: NRZ-L 0 = high; Manchester 0 = high→low; differential Manchester inverts at the start of a 0; AMI alternates the 1s; 2B1Q 00=−3, 01=−1, 10=+3, 11=+1.

Top: data in NRZ-I · bottom: after 4B/5B, in NRZ-I

4 bits in, 5 bits out

Longest run of 0s beforeLongest run of 0s afterOverhead25% (5 bits per 4)

No 5-bit code has more than one leading 0 or more than two trailing 0s, so the coded stream never has more than three 0s in a row. NRZ-I then always has a transition at least every 4 bits.

AMI (top), B8ZS (middle), HDB3 (bottom) · orange marks = V (violation) and B (bipolar) pulses

Replace long runs of 0s

B8ZS: eight 0s become 000VB0VB. HDB3: four 0s become 000V if the number of 1s since the last substitution is odd, or B00V if it is even. V repeats the previous pulse's polarity, breaking the AMI rule on purpose so the receiver can spot and undo it.