Skip to main content

UniPolar Encoding

Unipolar encoding has 2 voltage states with one of the states being 0 volts. Since Unipolar line encoding has one of its states being 0 Volts, it is also called Return to Zero (RTZ). A common example of Unipolar line encoding is the logic levels used in computers and digital logic. A logic High (1) is represented by +5V and a logic Low (0) is represented by 0V.

Unipolar line encoding works well for inside machines where the signal path is short but is unsuitable for long distances due to the presence of stray capacitance in the transmission medium. On long transmission paths, the constant level shift from 0 volts to 5 volts causes the stray capacitance to charge up. There will be a "stray" capacitor effect between any two conductors that are in close proximity to each other. Parallel running cables or wires are very suspectible to stray capacitance.
If there is sufficient capacitance on the line and a sufficient stream of 1s, a DC voltage component will be added to the data stream. Instead of returning to 0 volts, it would only return to 2 or 3 volts! The receiving station may not recognize a digital low at voltage of 2 volts!
Unipolar line encoding can have synchronization problems between the transmitter and receiver's clock oscillator. The receiver's clock oscillator locks on to the transmitted signal's level shifts (logic changes from 0 to 1). If there is a long series of logical 1s or 0s in a row. There is no level shift for the receive oscillator to lock to. The receive oscillator's frequency may drift and become unsynchronized. It could lose track of where the receiver is supposed to sample the transmitted data!
Receive oscillator may drift during the period of all 1s


Below is an simulation for unipolar encoding in java.

SOURCE CODE:

 import java.util.Scanner;  
 public class Lowhigh {  
   public static void main(String[] args) {  
     String input = "";  
     String line1 = "";  
     String line2 = "";  
     String line3 = "";  
     int flag = 0, i;  
     Scanner inputs = new Scanner(System.in);  
     System.out.print("Enter the binary number :");  
     input = inputs.next();  
     for (i = 0; i < input.length(); i++) {  
       if (input.charAt(i) == '1') {  
         if (flag == 0) {  
           line1 += " ";  
           line2 += "|";  
           line3 += "|";  
           flag = 1;  
         }  
         line1 = line1 + " _ ";  
         line2 = line2 + "  ";  
         line3 = line3 + "  ";  
       } else {  
         if (flag == 1) {  
           line1 += " ";  
           line2 += "|";  
           line3 += "|";  
           flag = 0;  
         }  
         line1 = line1 + "  ";  
         line2 = line2 + "  ";  
         line3 = line3 + " _ ";  
       }  
     }  
     System.out.println(line1);  
     System.out.println(line2);  
     System.out.println(line3);  
   }  
 }  


Comments

Popular posts from this blog

Library Management System ( CPP coding ) :

Library Management System has been implemented as a C++ program. Complete program code is given below. Complete project is available on user request. User comments are welcome to notify any Bugs or to improve the further posts. :) Concepts used: Multilevel inheritance is used in this program. The files concepts were also used to store and retrieve the required data's for the login details, membership details and book details. Modules :   1. Login maintenance  2. Library maintenance  3. Book issue maintenance  4. Book return maintenance  LOGIN MAINTENANCE  Separate login for administrator, member and guest should be provided.  Should accept user name and password from the user.  Should compare the user name and password (case sensitive).  If the user name and password matches then the menu for the respective login should be displayed.  If the user name or password is incorrect it should display an error message.  If the user name

C++ Diamond Pattern

C++ program to print the diamond pattern using '#' symbols. In this program two for loops are used to print the pattern. The first loop prints the upper part to the diamond ( triangle part ). The second for loop prints the lower part of the diamond (an inverted triangle ) . By combining both of the triangles an diamond pattern structure is formed. PROGRAM CODE: #include<iostream> using namespace std; int main() { int i,j,k=1,s=6,l; for(i=0;i<5;i++,k-=2,s-=1) { for(l=s-1;l>=0;l--) cout<<' '; for(j=k;j<0;j++) cout<<"#"; cout<<endl; } k = 9; s = 0; for(i=0;i<5;i++,k-=2,s+=1) { for(l=s;l>=0;l--) cout<<' '; for(j=k;j>0;j--) cout<<"#"; cout<<endl; } return 0; } OUTPUT:            #         # # #      # # # # #    # # # # # # # # #