Homework 3 Solution
Homework 3 Solution
Assignment #3 Solutions
1. Question 1:
Develop algorithms for generating each of the codes shown in slide 29 of the Session 3 slide
deck on Data Encoding and Transmission from NRZ-L.
(a) NRZL
For i = 1 to input_length
If input(i) is zero; output(i) = “+”
Else output(i) = “-“
(b) NRZI
For i = 1 to input_length
If input(i) is one {
If output(i-1) is “+”; output(i) = “-“
Else output = “+”
} else output(i) = output(i-1)
For i = 1 to input_length
If input(i) is one {
If previous is “-“; output(i) = “+”; previous = “+”
Else output(i) = “-“; previous = “-“
} else output(i) = “neutral”
(d) Pseudo Ternary
For i = 1 to input_length
If input(i) is zero {
If previous = “-“; output(i) = “+”; previous = “+”
Else output(i) = “-”; previous = “-”
} else output(i) = “neutral”
(e) Manchester
For i = 1 to input_length
If input(i) is zero; output(2*i-1) = “+”; output(2*i) = “-“
Else output(2*i-1) = “-“; output(2*i) = “+”
For i = 2 to input_length
If input(i) is one; output(2*i-1) = output(2*i-2); output(2*i) = output(2*i-3)
Else output(2*i-1) = output(2*i-3); output(2*i) = output(2*i-2)
2. Question 2:
Enhanced NRZ (E-NRZ) is used for high-density recording on magnetic tape. It separates
the NRZ-L data stream into 7-bit words, inverts bits 2, 3, 6, and 7, and adds a parity bit to
each word. In this case, the parity bit is chosen to make the total number of 1s in the 8-bit
word an odd count. Explain the advantages and disadvantages of E-NRZ over NRZ-L.
Answer:
4. Question 4:
Consider a stream of binary data that consists of a long sequence of 1s followed by a zero
followed by a long string of 1s and the same assumptions as in Problem 3 above. Draw the
waveform for this sequence using:
(a) NRZ-L
(b) Bipolar-AMI
(c) Pseudoternary
Answer: