Dr. Clincy Professor of CS Ch 2 Appendix: Codes for Data Recording and Transmission Dr. Clincy Professor of CS Dr. Clincy
Codes for Data Recording and Transmission i.e. i.e. 56 as 0011 1000 Computer Results Digital or Analog Signals i.e. i.e. “5” & “6” as 0000101 0000110 Computer Computer (Codec, Modem) Magnetic Flux reversals Codes (w/parity) Rx or Recording Medium Results to Code Encoding Computer Signal travelling across transport facility or bus Network Receiver or Magnetic Tape or Disk Data to Signal Encoding or Translation (A/A, A/D, D/A, D/D) To transmit data, pulses of “high” and “low” voltage are sent across communications media. To store data, changes are induced in the magnetic polarity of the recording medium. These polarity changes are called flux reversals. The period of time during which a bit is transmitted, or the area of magnetic storage within which a bit is stored is called a bit cell. Dr. Clincy
Data Vs Signal Fully explain the difference between signal and data before getting into the details Digital Transmission DATA SIGNAL D D A Analog Transmission A D Dr. Clincy Lecture 2
DIGITAL-TO-DIGITAL CONVERSION Can represent digital data by using digital signals. The conversion involves three techniques: line coding – converting bit sequences to signals block coding – adding redundancy for error detection scrambling – deals with the long zero-level pulse issue Line coding is always needed; Block coding and scrambling may or may not be needed. Lecture
Line coding and decoding At Tx - Digital data represented as codes is converted to a digital signal via an encoder At Rx – Digital signal is converted back to digital codes via a decoder
Signal element versus data element Data element - smallest entity representing info Signal element – shortest unit of a digital signal (carriers) r – is the ratio of # of data elements carried per signal element Example of adding extra signal elements for synchronization Example of increasing data rate Dr. Clincy
Data Rate Versus Signal Rate Data rate (or bit rate) - # of data elements (or bits) transmitted in 1 second – bits-per-second is the unit Signal rate (pulse rate or baud rate) - # of signal elements transmitted in 1 second – baud is the unit OBJECTIVE ALWAYS: increase data rate while decreasing signal rate – more “bang” for the “buck” Is it intuitive that if you had a data pattern of all 0s or 1s, it would effect the signal rate ? Therefore to relate data-rate with signal-rate, the pattern matters. Worst Case Scenario – we need the maximum signaling rate (alternating 1/0s) Best Case Scenario – we need the minimum signaling rate (all 1/0s) Focus on average case S = c x N x 1/r N – data rate (bps) c – case factor S - # of signal elements r – ratio of data to signal Dr. Clincy
Example A signal is carrying data in which one data element is encoded as one signal element ( r = 1). If the bit rate is 100 kbps, what is the average value of the baud rate if c is between 0 and 1? Solution We assume that the average value of c is 1/2 . The baud rate is then Dr. Clincy
Line coding scheme categories Dr. Clincy
D/D - Non-Return-to-Zero Code (NRZ) The simplest data recording and transmission code is the non-return-to-zero (NRZ) code. NRZ encodes 1 as “high” and 0 as “low.” The coding of OK (in ASCII) is shown below. The problem with NRZ code is that long strings of zeros and ones cause synchronization loss. Dr. Clincy
D/D - Non-Return-to-Zero-Invert Code (NRZI) The problem with NRZ code is that long strings of zeros and ones cause synchronization loss. Non-return-to-zero-invert (NRZI) reduces this synchronization loss by providing a transition (either low-to-high or high-to-low) for each binary 1. Dr. Clincy
D/D - Manchester Code Although NRZI prevents loss of synchronization over long strings of binary ones, NRZI coding does nothing to prevent synchronization loss within long strings of zeros. Manchester coding (also known as phase modulation) prevents this problem by encoding a binary one with an “up” transition and a binary zero with a “down” transition – or reversal of the phase (i.e starting point of the signal). Dr. Clincy
Frequency Modulation For many years, Manchester code was the dominant transmission code for local area networks. It is, however, wasteful of communications capacity because there is a transition on every bit cell. A more efficient coding method is based upon the frequency modulation (FM) code. In FM, a transition is provided at each cell boundary. Only cells containing binary ones have a mid-cell transition. Dr. Clincy
Frequency Modulation (Modified) FM requires a transition at each cell boundary. Modified FM (MFM) eliminates some of these transitions – thus, MFM is a more economical code. It provides a cell boundary transition only when adjacent cells contain zeros. An MFM cell containing a binary one has a transition in the middle as in regular FM. Dr. Clincy
Block coding concept The main challenge for data recording and trans-mission is how to retain synchronization without chewing up more resources than necessary. Block coding provides redundancy for synchronization and error detection Block coding changes a block of m bits into a block of n bits (where n>m) Block coding is also called mB/nB encoding
Using block coding 4B/5B with NRZ-I line coding scheme Fixes that PROBLEM of long stream of 0s Use 4B/5B to change the long stream of 0s prior to using NRZ-I For example, for 4B/5B encoding, 4-bit groups or replaced with 5-bit groups and those 5-bit groups are re-combined – NOTE: the 5-bit code could be completely different from the original 4-bit code
4B/5B mapping codes Because the 5-bit code has 25 = 32 codes, the extra codes can be used for control sequences and error detection For example, for 4B/5B encoding, 4-bit groups or replaced with 5-bit groups and those 5-bit groups are re-combined – NOTE: the 5-bit code could be completely different from the original 4-bit code
Run-Length Limited Run-length-limited, RLL, is a code specifically designed to reduce the number of consecutive ones and zeros. Some extra bits are inserted into the code. But even with these extra bits RLL is remarkably efficient. An RLL(d,k) code dictates a minimum of d and a maximum of k consecutive zeros between any pair of consecutive ones. RLL(2,7) had been the dominant disk storage coding method for many years. An RLL(2,7) code contains more bit cells than its corresponding ASCII or EBCDIC character. However, the coding method allows bit cells to be smaller, thus closer together, than in MFM or any other code. Dr. Clincy
Run-Length Limited The RLL(2,7) coding for OK is shown below, compared to MFM. The RLL code (bottom) contains 25% fewer transitions than the MFM code (top). A coding scheme that uses fewer magnetic transitions is more efficient than one with more magnetic transitions per character. Dr. Clincy