Coding Practice

Data Communication Problem Solution

1. Write a C program that takes a classless IP address as input and displays it in binary, the number of network and host address depending on number represented after the backslash

Sample Input: 10.15.15.1/24
Sample Output:
IP in binary: 00001010.00001111.00001111.00000001
Network Address: 16777214
Hosts Address: 254

2. Write a C program that takes a classful IP address as input and displays it in binary, identifies its class from the first binary octet and the number of network and host address depending on the class

Sample Input:10.15.15.1
Sample Output:
IP in binary: 00001010.00001111.00001111.00000001
Class: A
Network Address: 254
Hosts Address: 16777214

3. Write a C/JAVA program to implement CRC. The program will take a sequence of binary data bits, and a divider as input. And gives the resultant data with CRC as output. (Where, divider < binary data bits)

Sample Input:
Data: 10110
Divider: 1101

Sample Output:
Modified data: 10110000
Data Send: 10110101
CRC bit: 101

4. Write a program that choose Even parity / Odd parity according to user choose. And accordingly performs Even parity / Odd parity process

Example 1:
Enter 1 for Even parity and 2 for Odd parity.
Input: 1

Even parity:
Input:
Data: 110110
Output:
modified data: 1101100
Parity bit: 0

Example 2:
Enter 1 for Even parity and 2 for Odd parity.
Input: 2

Odd parity:
Input:
Data: 1101101
Output:
Modified data: 11011010
Parity bit: 0

5. Write a program that construct an Even parity Hamming code

Example-1:
Input: 10111010100101
Output: 
Mod data: 1111011110101000101
Number of parity bits: 5

Example-2:
Input: 101100
Output: 
Mod data: 0110011000
Number of parity bits: 4

6. Write a program to calculate the MINIMUM HAMMING DISTANCE for a given set of binary data taken as input. The first line of input is an integer, i (0<i<10) which mentions the number of inputs to be taken

Sample Input:
    Number of inputs: 3
    10110
    01110
    11001
    Sample Output:
    Minimum hamming distance, (C1, C2) = 2

7. Write a program to find Hamming Distance

No comments:

Post a Comment

Change Theme
X