C++ Program: Make a program that would demonstrate the concept of Line Coding: Polar NRZ: Remember: if next bit is 1, there is inversion if next bit is 0, no inversion neg – means the signal is in the negative axis pos – means the signal is in the positive axis inv – means there is inversion no inv – means there is no inversion a. initially high (starts with positive, inverse is negative) Input: 1 1 1 0 0 1 0 1 1 0 0 0 Output: inv neg inv pos inv neg no inv neg no inv neg inv pos no inv pos inv neg inv pos no inv pos no inv pos no inv pos b. initially low (starts with negative, inverse is positive) Input: 1 1 1 0 0 1 0 1 1 0 0 0 Output: inv pos inv neg inv pos no inv pos no inv pos inv neg no inv neg inv pos inv neg no inv neg no inv neg no inv neg The logic here is when input is 1, next inputted 1 will be inverse of that, for example: 1 1 0 0 1 if initially high that means neg, pos, pos, pos, neg
C++ Program:
Make a program that would demonstrate the concept of Line Coding:
- Polar NRZ: Remember:
- if next bit is 1, there is inversion
- if next bit is 0, no inversion
neg – means the signal is in the negative axis
pos – means the signal is in the positive axis
inv – means there is inversion
no inv – means there is no inversion
a. initially high (starts with positive, inverse is negative)
Input: |
1 |
1 |
1 |
0 |
0 |
1 |
0 |
1 |
1 |
0 |
0 |
0 |
Output: |
inv neg
|
inv pos
|
inv neg
|
no inv neg
|
no inv neg
|
inv pos
|
no inv pos
|
inv neg
|
inv pos
|
no inv pos
|
no inv pos
|
no inv pos
|
b. initially low (starts with negative, inverse is positive)
Input: |
1 |
1 |
1 |
0 |
0 |
1 |
0 |
1 |
1 |
0 |
0 |
0 |
Output: |
inv pos
|
inv neg
|
inv pos
|
no inv pos
|
no inv pos
|
inv neg
|
no inv neg
|
inv pos
|
inv neg
|
no inv neg
|
no inv neg
|
no inv neg
|
The logic here is when input is 1, next inputted 1 will be inverse of that, for example:
1 1 0 0 1
if initially high that means neg, pos, pos, pos, neg
Step by step
Solved in 2 steps