39
Communication and Networking Assignment hamza hafeez 5/15/20 BCS 6th

qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

Communication and Networking

Assignment

hamza hafeez 5/15/20 BCS 6th

djkfdjdskjf

Page 2: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

Name Muhammad HamzaClass BCS 6th

Subject Communication and Networking

Date 17/05/2020

Page 3: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

Q.NO.1. Explain Morse code, ASCII code and EBCDIC code?

Ans.

(1). ASCII CodeASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation of a character such as 'a' or '@' or an action of some sort. ASCII was developed a long time ago and now the non-printing characters are rarely used for their original purpose. Below is the ASCII character table and this includes descriptions of the first 32 non-printing characters. ASCII was actually designed for use with teletypes and so the descriptions are somewhat obscure. If someone says they want your CV however in ASCII format, all this means is they want 'plain' text with no formatting such as tabs, bold or underscoring - the raw format that any computer can understand. This is usually so they can easily import the file into their own applications without issues.

Example:- Notepad.exe creates ASCII text, or in MS Word you can save a file as 'text only'

CONVERSION TO ASCII

Page 4: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

Binary------------ Decimal ------------ ASCII

Convert from binary to ASCII 100100110000011001101

First Convert to 7-bit Then to Decimal At last convert to ASCII

1001001 1000001 1001101

I A M

Table 1.1 26 25 24 23 2 2 2 1 20

64 32 16 8 4 2 1 1 0 0 1 0 0 1= 64 + 8 +1=73 1 0 0 0 0 0 1= 64 +1=65 1 0 0 1 1 0 1= 64 + 8 +4 +1= 77 ASCII 65=A 73=I 77=M

Page 5: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

Ans.

(2). Morse CodeMorse code is a method used in telecommunication to encode text characters as standardized sequences of two different signal durations, called dots and dashes or dits and dahs.[2][3] Morse code is named for Samuel Morse, an inventor of the telegraph.

The International Morse Code encodes the 26 English letters A through Z, some non-English letters, the Arabic numerals and a small set of punctuation and procedural signals (prosigns). There is no distinction between upper and lower case letters.[1] Each Morse code symbol is formed by a sequence of dots and dashes. The dot duration is the basic unit of time measurement in Morse code transmission. The duration of a dash is three times the duration of a dot. Each dot or dash within a character is followed by period of signal absence, called a space, equal to the dot duration. The letters of a word are separated by a space of duration equal to three dots, and the words are separated by a space equal to seven dots.[1] To increase the efficiency of encoding, Morse code was designed so that the length of each symbol is approximately inverse to the frequency of occurrence in text of the English language character that it represents. Thus the most common letter in English, the letter "E", has the shortest code: a single dot. Because the Morse code elements are specified by proportion rather than specific time durations, the code is usually transmitted at the highest rate that the receiver is capable of decoding. The Morse code transmission rate (speed) is specified in groups per minute, commonly referred to as words per minute.[4]

Morse code is usually transmitted by on-off keying of an information-carrying medium such as electric current, radio waves, visible light, or sound waves.[5][6] The current or wave is present during the time period of the dot or dash and absent during the time between dots and dashes.[7][8]

Morse code can be memorized, and Morse code signaling in a form perceptible to the human senses, such as sound waves or visible light, can be directly interpreted by persons trained in the skill.

Morse Table

Letter Morse NATO English American Italian German International

A *- Alfa Andrew Able Ancona Anton Amsterdam

B -*** Bravo Benjamin Baker Bologna Berta Baltimore

C -*-* Charlie Charlie Charlie Como Casar Casablanca

D -** Delta David Dog Domodossola Dora Denmark

E * Echo Edward Easy Empoli Emil Edision

Page 6: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

F **-* Foxtrot Fredrick Fox Firenze Friedrich Florida

G --* Golf George George Genova Gustav Gallipoli

H **** Hotel Harry How Hotel Heinrich Havana

I ** India Isaac Item Imola Ida Italy

J *--- Juliett Jack Jig I lunga Julius Jerusalem

K -*- Kilo King King Kursaal Kaufmann Kilogram

L *-** Lima Lucy Love Livorno Ludwig Liverpool

M -- Mike Mary Mike Milano Martha Madagascar

N -* November Nelli Nan Napoli Nordpol New York

O --- Oscar Oliver Oboe Otranto Otto Oslo

P *--* Papa Peter Peter Padova Paula Paris

Q --*- Quebec Queenie Queen Quarto Quelle Quebec

R *-* Romeo Robert Roger Roma Richard Roma

S *** Sierra Sugar Sugar Savona Samuel Santiago

T - Tango Tommy Tare Torino Theodor Tripoli

U **- Uniform Uncle Uncle Udine Ulrich Uppsala

V ***- Victor Victor Victor Venezia Viktor Valencia

W *-- Whiskey William William Washington Wilhelm Washington

X -**- X-ray Xmas X-ray Ics Xanthippe Xanthippe

Y -*-- Yankee Yellow Yoke York Ypsilon Yokohama

Z --** Zulu Zebra Zebra Zara Zeppelin Zurich

In Morse Code there also exist codes for numbers and puctuation:

Number Code Punctuation Code

1 *---- Period *-*-*-

Page 7: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

2 **--- Comma --**--

3 ***-- Colon ---***

4 ****- Question Mark **--**

5 ***** Apostrophe *----*

6 -**** Hyphen -****-

7 --*** Fraction Bar -**-*

8 ---** Parentheses -*--*-

9 ----* Quotation Marks *-**-*

0 -----

If the duration of a * (dot) is one unit then that of a - (dash) is three units. The space between the components of one character is one unit, between characters is three units and between words seven units. To indicate that a mistake has been made and for the reciever to delete the last word send: ******** (eight dots).

Example:-(1) H A M Z A

**** *- -- --** *-

S O R R Y

(2) *** ---- *-* *-* -*--

Page 8: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

Ans.

(3). EBCDICEBCDIC(pronounced "ebb see dick") is short for extended binary coded decimal interchange code is eight bits, or one byte, wide. This is a coding system used to represent characters-letters, numerals, punctuation marks, and other symbols in computerized text. A character is represented in EBCDIC by eight bit. EBCDIC mainly used on IBM mainframe and IBM midrange computer operating systems. Each byte consists of two nibbles, each four bits wide. The first four bits define the class of character, while the second nibble defines the specific character inside that class.

Explanation :-EBCDIC is different from, and incompatible with, the ASCII character set used by all other computers. The EBCDIC code allows for 256 different characters. For personal

computers, however, ASCII is the standard. If you want to move text between your computer and a mainframe, you can get a file conversion utility that will convert between EBCDIC and ASCII.

EBCDIC was adapted from the character codes used in IBM's pre electronic PUNCHED CARD machines, which made it less than ideal for modern computers. Among its many inconveniences were the use of non-contiguous codes for the alphabetic characters, and the absence of several punctuation characters such as the square brackets [] used by much modern software.

For example, setting the first nibble to all-ones,1111, defines the character as a number, and the second nibble defines which number is encoded. EBCDIC can code up to 256 different characters.

There have been six or more incompatible versions of EBCDIC, the latest of which do include all the ASCII characters, but also contain characters that are not supported in ASCII.

Page 9: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

EBCDIC Code Table

 

Dec Hex Code Dec Hex Code Dec Hex Code Dec Hex Code

128 80 160 A0 192 C0 { 224 E0 \

129 81 a 161 A1 ~ 193 C1 A 225 E1

130 82 b 162 A2 s 194 C2 B 226 E2 S

131 83 c 163 A3 t 195 C3 C 227 E3 T

132 84 d 164 A4 u 196 C4 D 228 E4 U

133 85 e 165 A5 v 197 C5 E 229 E5 V

134 86 f 166 A6 w 198 C6 F 230 E6 W

135 87 g 167 A7 x 199 C7 G 231 E7 X

136 88 h 168 A8 y 200 C8 H 232 E8 Y

137 89 i 169 A9 z 201 C9 I 233 E9 Z

138 8A 170 AA 202 CA 234 EA

139 8B 171 AB 203 CB 235 EB

140 8C 172 AC 204 CC 236 EC

141 8D 173 AD 205 CD 237 ED

142 8E 174 AE 206 CE 238 EE

143 8F 175 AF 207 CF 239 EF

144 90 176 B0 208 D0 } 240 F0 0

145 91 j 177 B1 209 D1 J 241 F1 1

146 92 k 178 B2 210 D2 K 242 F2 2

147 93 l 179 B3 211 D3 L 243 F3 3

Page 10: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

148 94 m 180 B4 212 D4 M 244 F4 4

149 95 n 181 B5 213 D5 N 245 F5 5

150 96 o 182 B6 214 D6 O 246 F6 6

151 97 p 183 B7 215 D7 P 247 F7 7

152 98 q 184 B8 216 D8 Q 248 F8 8

153 99 r 185 B9 217 D9 R 249 F9 9

154 9A 186 BA 218 DA 250 FA

155 9B 187 BB 219 DB 251 FB

156 9C 188 BC 220 DC 252 FC

157 9D 189 BD 221 DD 253 FD

158 9E 190 BE 222 DE 254 FE

159 9F 191 BF 223 DF 255 FF

Note: Values are based off of 0-255 scale. Some COBOL functions require a 1-256 scale; add 1 for offset.

About Dinesh Thakur

Dinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP

certifications. Dinesh authors the hugely popular Computer Notes blog. Where he

writes how-to guides around Computer fundamental , computer software, Computer

programming, and web apps. For any type of query or something that you think is missing,

please feel free to Contact us.

Q.NO.2. Explain Hamming Code for error correction?

Page 11: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

Ans. Hamming Code for error CorrectionIt is nice to be able to detect that a transmission error occurred. It would be nicer to be able to find and correct the error. There are several schemes to do this. A standard one is calling Hamming code.Hamming code is a set of error-correction codes that can be used to detect and correct the errors that can occur when the data is moved or stored from the sender to the receiver. It is technique developed by R.W. Hamming for error correction. Redundant bits –Redundant bits are extra binary bits that are generated and added to the information-carrying bits of data transfer to ensure that no bits were lost during the data transfer.The number of redundant bits can be calculated using the following formula:

2^r ≥ m + r + 1

where, r = redundant bit, m = data bit

Suppose the number of data bits is 7, then the number of redundant bits can be calculated using:= 2^4 ≥ 7 + 4 + 1Thus, the number of redundant bits= 4Parity bits –A parity bit is a bit appended to a data of binary bits to ensure that the total number of 1’s in the data is even or odd. Parity bits are used for error detection. There are two types of parity bits:

1. Even parity bit:In the case of even parity, for a given set of bits, the number of 1’s are counted. If that count is odd, the parity bit value is set to 1, making the total count of occurrences of 1’s an even number. If the total number of 1’s in a given set of bits is already even, the parity bit’s value is 0.

2. Odd Parity bit –In the case of odd parity, for a given set of bits, the number of 1’s are counted. If that count is even, the parity bit value is set to 1, making the total count of occurrences of 1’s an odd number. If the total number of 1’s in a given set of bits is already odd, the parity bit’s value is 0.

Page 12: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

26. Give the Hamming code for the data bits 1010110 using EVEN parity.

Page 13: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation
Page 14: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation
Page 15: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

General Algorithm of Hamming code –The Hamming Code is simply the use of extra parity bits to allow the identification of an error.

1. Write the bit positions starting from 1 in binary form (1, 10, 11, 100, etc).

2. All the bit positions that are a power of 2 are marked as parity bits (1, 2, 4, 8, etc).

3. All the other bit positions are marked as data bits.4. Each data bit is included in a unique set of parity bits, as determined

its bit position in binary form.a. Parity bit 1 covers all the bits positions whose binary representation includes a 1 in the least significantposition (1, 3, 5, 7, 9, 11, etc).b. Parity bit 2 covers all the bits positions whose binary representation includes a 1 in the second position fromthe least significant bit (2, 3, 6, 7, 10, 11, etc).c. Parity bit 4 covers all the bits positions whose binary representation includes a 1 in the third position fromthe least significant bit (4–7, 12–15, 20–23, etc).Hamming code is a set of error-correction codes that can be used to detect and correct the errors that can occur when the data is moved or stored from the sender to the receiver. It is technique developed by R.W. Hamming for error correction.

5. Redundant bits –6. Redundant bits are extra binary bits that are generated and

added to the information-carrying bits of data transfer to ensure that no bits were lost during the data transfer.The number of redundant bits can be calculated using the following formula:

7.8.9. 2^r ≥ m + r + 1 10. where, r = redundant bit, m = data bit11. Suppose the number of data bits is 7, then the number of

redundant bits can be calculated using:= 2^4 ≥ 7 + 4 + 1Thus, the number of redundant bits= 4

12. Even parity bit:In the case of even parity, for a given set of bits, the number of 1’s are counted. If that count is odd, the parity bit value is set to 1, making the total count of occurrences of 1’s an even number. If the total number of 1’s in a given set of bits is already even, the parity bit’s value is 0.

13. Odd Parity bit –In the case of odd parity, for a given set of bits, the number of

Page 16: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

1’s are counted. If that count is even, the parity bit value is set to 1, making the total count of occurrences of 1’s an odd number. If the total number of 1’s in a given set of bits is already odd, the parity bit’s value is 0.

14. Since we check for even parity set a parity bit to 1 if the total number of ones in the positions it checks isodd.

15. Set a parity bit to 0 if the total number of ones in the positions it checks is even.

Page 17: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

16.

17. Determining the position of redundant bits –These redundancy bits are placed at the positions which correspond to the power of 2.As in the above example:

18. The number of data bits = 719. The number of redundant bits = 420. The total number of bits = 11

Page 18: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

21. The redundant bits are placed at positions corresponding to power of 2- 1, 2, 4, and 8

22.

23. Suppose the data to be transmitted is 1011001, the bits will be placed as follows:

24.25. Determining the Parity bits –26.27.28. R1 bit is calculated using parity check at all the bits

positions whose binary representation includes a 1 in the least significant position.

29. R1: bits 1, 3, 5, 7, 9, 1130.

31. To find the redundant bit R1, we check for even parity. Since the total number of 1’s in all the bit positions corresponding to R1 is an even number the value of R1 (parity bit’s value) = 0

Page 19: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

32. R2 bit is calculated using parity check at all the bits positions whose binary representation includes a 1 in the second position from the least significant bit.

33. R2: bits 2,3,6,7,10,1134.

35. To find the redundant bit R2, we check for even parity. Since the total number of 1’s in all the bit positions corresponding to R2 is odd the value of R2(parity bit’s value)=1

36. R4 bit is calculated using parity check at all the bits positions whose binary representation includes a 1 in the third position from the least significant bit.

37. R4: bits 4, 5, 6, 7

38.39. To find the redundant bit R4, we check for even parity.

Since the total number of 1’s in all the bit positions corresponding to R4 is odd the value of R4(parity bit’s value) = 1

40. R8 bit is calculated using parity check at all the bits positions whose binary representation includes a 1 in the fourth position from the least significant bit.

41. R8: bit 8,9,10,11

Page 20: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

42.

43.44.45. To find the redundant bit R8, we check for even parity.

Since the total number of 1’s in all the bit positions corresponding to R8 is an even number the value of R8(parity bit’s value)=0.

46. Thus, the data transferred is:47.

48. Error detection and correction –Suppose in the above example the 6th bit is changed from 0 to 1 during data transmission, then it gives new parity values in the binary number:

Page 21: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

49.

‘50. The bits give the binary number as 0110 whose decimal

representation is 6. Thus, the bit 6 contains an error. To correct the error the 6th bit is changed from 1 to 0.

A Hamming code is a combination of 0s and 1s, but not all combinations of 0s and 1s are valid codes. The Hamming distance between two binary numbers of the same length is the number of positions in the numbers that have different values. For example, the Hamming distance between 1101 and 1000 is 1, since they differ in only one position. The Hamming distance between 1101 and 1011 is 2, since they differ in two positions.

Page 22: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

Q.NO.C. What is Bit Synchronization and Synchronous and Asynchronous transmission in Data Communication.

Ans. Bit Synchronization

Definition:- Bit Synchronization For synchronous transmission, data is not transferred byte-wise so there are no starter stop bits indicating the beginning or end of a character. Instead, there is a continuous stream of bits which have to be split up into bytes. Therefore the receiver has to sample the received data in the right instant and the sender's and receiver's clocks have to be kept in a synchronized state. As the main task lies in synchronizing sender's and receiver's clocks, bit synchronization is also called clock synchronization.4.2.1 Clock encoding The most self-evident way to accomplish clock synchronization is to send the clock signal to the receiver. This can be done by adding the signal of the local clock to the encoded signal of the bit stream resulting in a bipolar encoded signal which the receiver will have to interpret. By using this bipolar encoding, it is not necessary to create an additional transmission line just for the clock signal.Each bit span of the bipolar2 signal is dived in the middle by the signal shift of the clock. There are two possible values for each bit span: high-zero and low-zero, denoting logical one and logical zero. The received signal will contain enough information for the encoder as it can determine the length of a bit by the guaranteed signal change at the end of each bit and it can determine the literal value by distinguishing between a positive or negative signal in the first half of the bit time. In [halsall95 p. 104] there is a good example, describing bipolar clock encoding:2A bipolar signal is a signal that can have positive and negative polarity. For example a signal on a coaxial cable can be bipolar (positive or negative polarity of the measured voltage), but an optical signal cannot be bipolar as light can only be either on or off.Bit and Frame Synchronization

Page 23: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

As can be seen in Figure 14, “Bipolar Clock Encoding” signal of the transmitter clock is added to the bit stream that should be transmitted, the resulting signal is bipolar and contains a clock signal that can be extracted in order to encoding the bit stream. This way of clock encoding is also a return to zero encoding, as it requires a medium of capable of carrying bipolar encoded signals. This limitation can be overcome by using a Digital Phase Locked Loop (DPLL).4.2.2 Digital Phase-Locked Loop The main idea of a digital phase locked loop is that the receiver's clock is reasonably accurate, but should be resynchronized with the sender's clock whenever possible. Unlike the direct clock encoding, there is no direct transmission of the clock signal, but it is possible to extract clock information from the received data signal. It is important that there are enough bit transitions in the received data stream which indicate bit boundaries and make it possible to deduct the duration of a bit time as well as enabling the clock controller to reset the clock to a less diverged signal. This can be ensured by using a bit scrambler which removes long sequences of zeros or one's, but a more convenient way is to use an encoding scheme which ensures a sufficient number of bit transitions like the Manchester encoding. Assume a system structure like described in Figure 15, “Digital Phase-Locked Loop Structure (FMC)” where you have a digital clock which will have a sampling frequency that is at least 32 times as high as the bit rate of the incoming signal. This clock feeds its signal to the DPLL which also gets the received bit stream. The bit encoder encodes the bit stream and feeds it to the receiver's shift register where the serial to parallel transformation happens. The clock signal for this shift register comes from the DPLL.

Page 24: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

Figure 15. Digital Phase-Locked Loop Structure (FMC)

The digital phase locked loop has two inputs. The first input is the system clock which provides a signal to the DPLL in a well defined frequency. The other input is the received bit stream, where every bit has at least one bit transition from 0 to 1 or from 1 to 0. This bit transition is either after around 16 clock signals, at the end of a bit time, in which case it will be ignored or after around 32 clock signals, in which it marks the middle of a bit time (for Manchester encoding) and will always occur. If the clocks are in synchronism, there will be 32 clock signals between two bit middles. The DPLL will feed its next signal after exactly 32 clock signals to the shift register.

Page 25: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

The figure above uses Manchester encoding to encode the transmitter's clock signal in the bit stream without adding additional polarity to the transferred signal. The clock signal can be extracted nonetheless by using a digital phase-locked loop.But if there are more than 32 clock signals, say 34, it means that the clock is two clock cycles ahead. In this case the digital phase-locked loop will shorten the span until sending the next signal to the shift register by two clock signals and will feed the next signal after just 30 clock signals to the shift register. The same procedure applies if there are less than 32 clock signals time span between to bits. The signaling span will be adjusted by waiting two clock cycles longer for giving the next impulse to the shift register, adding the delay to a total of 34 clock signals.

In this example, there are only eight clock ticks for one bit time. The shaded area in the next diagram marks the time span in which a signal transition from high to low or vice versa is expected. This is the time where the DPLL adjusts the clock signal.Figure 17. Manchester-encoded signal

Page 26: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

.3 Conclusion.In this section we have shown some more sophisticated encoding schemes that have one major feature: they allow self-synchronizing communication through the use of Digital Phase Locked Loops which will detect time dispersion and correct it. There are different other possibilities to ensure synchronization by sending a clock signal or by ensuring enough transitions between high and low value in each bit sequence.

(1) A synchronizationAsynchronous data transmission is used whenever character or byte based data hasto be transferred in irregular intervals. A common example for this are the signals froma computer keyboard. The user types at irregular intervals and the keyboard encodeseach hit into a sequence of bits of a defined length.This character is transferred to the main unit where the pulse of incoming signals isinterpreted as a sequence of bytes which are afterwards interpreted as a certain typedkey code or key-combination.The Problem. How does the receiver of the signal know when a byte starts and

Page 27: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

when it ends? This can be done by certain bit patterns indicating the start and end ofa byte or character.Before we come to this kind of character-length-synchronization we will cover thedifferent bit encoding schemes. Afterwards we will explain the nature and use of startand stop bits.Example 2. Application of Asynchronous Data Transmission:UARTThe most common application of asynchronous data transmission are UniversalAsynchronous Receivers/Transmitters (UARTs). It is an computer component that isused in the serial communication subsystem, for example in serial ports or internalmodems.The Universal Asynchronous Transmitter will transmit bytes in a serialized way bysending bit by bit to the receiver. At the receiver side, a Universal Asynchronous Receiver will receive the single bits and return full bytes.

3.1 Return to Zero SignalingThe most obvious variant of bit signaling is called return to zero signaling or pulsesignaling. As said before, some media on the physical layer do not only support highand low values but also positive and negative values. A signal may be represented bya positive high, negative high or low value of voltage, amplitude or phase shift. Returnto zero signaling essentially means that a logic 1 is represented by a positive high value,a logical 0 is represented by a negative value. After the transmission, a low or no signalis sent, in other words the signal returns to zero.1-18 Communication Networks SeminarBit and Frame SynchronizationExample 3. Return to Zero Signaling with different modulationsLet there be a byte with the bit sequence of 10110001. For frequency modulationthis means that there will be a frequency of 500 Hz for a high value (logical true) anda frequency of 250 Hz for a low value (logical false). Please note Figure 8, “Return toZero Encoding (Voltage)” for an illustration of the example.

Page 28: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

Figure 8. Return to Zero Encoding (Voltage)For amplitude shift keying there will be a high voltage of 3 Volts for true and novoltage for false. The figure below will illustrate this example.

Figure 9. Return to Zero Encoding (Abstract)As return to zero signaling relies on the availability of three signal states it may notbe available for every medium and keying scheme.

3.2 Non-Return to Zero SignalingNon-return to zero (NRZ) code means that the signal will not be zero when datatransmission is completed.This requirement is dealt with by defining the following simple encoding scheme: alogical one is encoded as a low value, a logical zero is encoded as a high value.Example 4. Non-Return to Zero Encoding for Amplitude ShiftModulation

Figure 10. Encoding with NRZAs you can see in Section 3.2, “Non-Return to Zero Signaling” [20], the signal willnot return to line idle, even when only 0-bits are transmitted. A long series of logicalones will result in a long time span without any transition of amplitude or frequency.The example above shows the main problem that Return to Zero and Non-Returnto Zero encodings share. For certain protocols, where long sequences of zeros or ones

Page 29: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

are transmitted, there will be long sequences without any change in signal. As the receiver's clocks has no way to synchronize, they will run out of sync and sampling of theincoming signal will lead to wrong results because the receiver will fail to identify thebit boundaries.Non-Return to Zero encoding and its derivatives should be used only when it can beguaranteed that the higher level protocols will not result in long sequences of identicalbits. This behavior can be guaranteed for asynchronous transmission with start andstop bits, but not for synchronous transmission.This limitations can be overcome by using the Manchester encoding, which we willcover in the next section.

(2) Synchronization

According to [halsall95 p. 102] synchronous data transmission is characterized bythe fact that the senders and the receivers clock have to be put into synchronism inorder to successfully transfer and decode data.This requirement is fulfilled by using special encoding schemes that are a bit morecomplex than the NRZ-encoding variants described in the previous section.There are also ways to keep the clocks of two systems in synchronism, with- orwithout directly sending the clock signal.4.1 Manchester-EncodingThe limiting factor at the physical layer is the fact that the clocks used for determiningbit boundaries are never equally fast. This will lead for every encoding scheme whichmay create long sequences of equal signal values to an aberration of the two clock andthus to bit errors when interpreting the signal.Principle of operation. Manchester Signaling means that every bit is representedby a change of value from high to low or low to high. The change of value happensexactly at the middle of the time span persevered for that bit. This makes determiningthe start and end of every bit very easy.The following encoding convention has been accepted for the Manchester Encoding:

Logic Data true false

Physical Signaltransition from low to hightransition from high to low

1-22 Communication Networks SeminarBit and Frame SynchronizationExample 5. Encoding with Manchester SignalingIn this example the bit sequence 00110001 should be encoded. Figure 12, “Signal

Page 30: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

Values for Manchester Encoding” will show the signal-value-curve for this example.

Figure 12. Signal Values for Manchester EncodingIf you compare Manchester Code with Non-Return to Zero encoding or variants, youwill notice that for a given signaling rate only half of the bit rate can be achieved, asone bit requires two signal elements, one high and one low.The Manchester Encoding is used in Ethernet networks.Differential Manchester Encoding. This variant of the Manchester Signalingscheme also uses a transition in the middle of the bit for synchronization, but the representation of each bit depends on the signaling of the previous bit. If a 0-bit should beencoded, there will be a transition at the start of the bit and in the middle of the bit. If a1-bit is encoded there will be only a transition in the middle of the bit.

Page 31: qurtuba.edu.pk  · Web viewASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation

Figure 13. Differential Manchester Encoding SchemeFigure 13, “Differential Manchester Encoding Scheme” shows the encoding of thesame bits as in Example 5, “Encoding with Manchester Signaling”. The DifferentialManchester Encoding variant is used for Token Ring networks.4 SYNCHRONOUS DATA TRANSMISSIONCommunication Networks Seminar 1-23Table 3. Differential Manchester Encoding Schemeprevious signal logical 0 logical 1

high-low high-low low-high

low-high low-high high-low

Submitted To Sir Sajid RehmanSubmitted By Muhammad Hamza