CSCI 4171/CSCI 6704 NETWORKS ASSIGNMENT NO.2 Date Given: October 8, 2013 Date Due: October 22, 2013 (11.59 p.m.)

peanutunderwearΛογισμικό & κατασκευή λογ/κού

7 Νοε 2013 (πριν από 3 χρόνια και 5 μήνες)

578 εμφανίσεις

CSCI 4171/CSCI 6704

NETWORKS

ASSIGNMENT NO.2

Date Given:
October 8, 2013

Date Due: October 22, 2013

(11.59 p.m.)



1.

<Data Encoding>
You are to write a program to understand the bandwidth requirements of NRZ
and Manchester encoding schemes. Your program sho
uld do the following:

a)

Read a text file consisting of alphanumeric characters, white spaces and punctuations.

b)

Convert the data into binary values using ASCII codes (
http://www.asciitable.com/
)

c)

Generate the NRZ and
Manchester waveforms for both. This can be either a graphical output or
as text output with dashes and vertical lines for signal level representations and transitions.

d)

Calculate the number of transitions (a transition is a jump in the waveform from

V to +
V or
vice versa.

(The number of transitions will give a rough estimate of the bandwidth requirement).



Use the following file to test your program:


News Item, October 8, 2013: “
After nearly five decades of
research to confirm their theory, Francois Engle
rt and Peter
Higgs were awarded the Nobel Prize for physics on Tuesday for
work that led to last year's discovery of the Higgs boson. The
Nobel Prize committee named the winners "for the theoretical
discovery of a mechanism that contributed to the understa
nding
of the origin of mass of subatomic particles," said Staffan
Normark, permanent secretary of the Royal Swedish Academy of
Sciences, at a news conference.



You may use Java, C, C++ or Python as your programming language.

Submit the source code and ans
wer to question (d) for the above test file. You need not show the
waveforms for the above test file.

However, submit outputs for a smaller test file (consisting of a few characters) to show how your
program generates the NRZ and Manchester encoding scheme
s.




2.

<Bit Stuffing>
Write a program that generates a data stream with bits stuffing. Recall that for bit
stuffing, an extra 0 bit is added after every five consecutive ones. Your program should do the
following:

a)

Read a text file consisting of alphanumeric

characters, white spaces and punctuations.

b)

Convert the data into binary values using ASCII codes (
http://www.asciitable.com/
)
.

c)

Generate the binary sequence after bit stuffing.

d)

Calculate the
stuffing
overhead
rat
io
(number of stuffed bits/total length of message in
bits).


Test your program for the same sample text file given in Question 1. You may use Java, C, C++ or
Python as your programming language.

Submit the source code, binary stream before bit stuffing, b
inary stream after bit stuffing and the
answer to question (d).


3.

<CRC question>

a)

Given a 12
-
bit sequence 110100111101 and a divisor of 1011, find the CRC and the transmitted
string.

b)

Given a remainder of 101, a transmitted data unit of 10110011101, and a di
visor of 1001, is there
an error in the data unit. Show all steps.

c)

Implement the sending and receiving CRC protocol by writing program routines
(functions/methods) for each of the following:

a.

Given a bit string, compute the CRC remainder and generate the bi
t string to be
transmitted.

b.

Given a bit string with CRC remainder appended, divide by G(x) and determine if
the message is error
-
free.

Use the codes in a test program, assuming values of G(x) and the input string, and demonstrate its
operation and error de
tection.

You can implement either the long division or the shift register version.