This preview shows page 1. Sign up to view the full content.
Unformatted text preview: either 1 or 0 and then plotted on a LabVIEW chart. Here, the first 50 bits from PRBS.vi are displayed as a logic trace. Figure 55. Serial Output from the PseudoRandom Bit Sequencer Communication lasers are tested using PRBS waveforms. Sometimes a laser may lock up from a particular sequence of ones and zeros, or a bit level may be outside specifications. The laser output is detected by a photodiode, converted into a digital signal, and passed to one side of a digital comparator. At the same time, the PRBS driving sequence is passed to the other input of the comparator. Any errors in transmission or lockup can be flagged. It is now easy to verify that the bit sequence repeats exactly after 255 cycles. In PRBS2.vi, two charts display the sequence. By resetting the scale of the second chart from 255 to 305, you can observe the repetitive nature of the PRBS. Figure 56. Comparison of the First 50 Binary Bits from a PRBS with Bits 255305 Fundamentals of Digital Electronics 54 National Instruments Corporation Lab 5 PseudoRandom Number Generators 8Bit PseudoRandom Number Generator
The addition of an analogtodigital converter allows the parallel outputs of the pseudorandom number sequence to be converted into a numeric number. In a binary conversion, the parallel bits (Q1...Q8) are weighted as (1, 2, 4, 8, 16, 32, 64, and 128). In the following VI, the numeric values are displayed on a threedigit display and chart on the front panel. Figure 57. Numeric Output from an 8Bit PRNG Running PRNG.vi allows you to observe the PRNG sequence of numbers. All the numbers from 0 to 254 will be found in the PRNG sequence, and on closer inspection, each number will appear only once in the sequence. Does the sequence appear random? The following block diagram is the LabVIEW simulation of an 8bit PRNG. Note how the DAC displays the numerical values of the Boolean parallel outputs. Figure 58. LabVIEW Program for the 8Bit PRNG with Chart Output National Instruments Corporation 55 Fundamentals of Digital Electronics Lab 5 PseudoRandom Number Generators The chart format conveniently displays the analog sequence. Over the short range (1030) numbers, the output appears random and in fact is random from a mathematical perspective. As an analog output, it appears as white noise. The value of PRNG in audio testing is that the noise repeats after 2N1 cycles. Amplifiers like digital gates may have shortterm memory, but not longterm memory. The PRNG analog output is applied to the analog circuit under test. Its output is compared with the expected levels from the PRNG sequence. Any deviation (errors) can reveal problems with the circuit under test. Encryption of Digital Data
Most data communication takes the form of ASCII characters. The addition of a parity bit to 7bit ASCII codes yield an 8bit digital number. Banking machines, electronic door locks, and computer passwords all use ASCII data and some form of encryption to preserve security. The 8bit PRNG is a useful circuit for encryption of ASCII data. All cases thus far have used the LabVIEW default initialization of the shift register to start the PRNG sequence. In fact, the sequence can begin at any initial value except the disallowed state (11111111). Suppose the initial value was (01111010), or 122 in numeric, or $7A in HEX, or the character "z" in ASCII. The PRNG sequence is just offset by this value, but the sequence repeats itself in the usual way, repeating after 255 cycles. Below is a Boolean array representation of 8bit PRNG values starting at some index (7) and the next six values. Note that after 255 cycles plus this index (7 + 255 = 262), the sequences are identical, hence predictable. Figure 59. Boolean Array Representation of the 8Bit Binary Pattern of the First Eight Numbers of an 8Bit PRNG with the Patterns for Loops 262 to 268 Suppose a PIN or password is used to form a unique numeric code number, N. The PRNG is initialized by an ASCII character, and the PRNG converts this input character into an encrypted character by clocking the PRNG ahead N cycles. When completed, the parallel outputs contain the encrypted character. In the above example, if the PIN number was 257, the character "z" would be encrypted as "X." For each character in a message, a new Fundamentals of Digital Electronics 56 National Instruments Corporation Lab 5 PseudoRandom Number Generators character is formed. The receiver knows the encryption algorithm, and with the PIN, the original message can be deciphered. Lab 5 Library VIs (Listed in the Order Presented) 6PRNG.vi (6bit PRNG) PRBS0.vi (8bit pseudorandom bit sequencer) PRBS.vi (8bit PRBS with serial output on chart) PRNG.vi (8bit PRNG with chart output) PRNG7.vi (8bit PRNG with array outputs) DAC8.vi (8bit DAC subVI) National Instruments Corporation 57 Fundamentals of Digital Electronics Lab 5 PseudoRandom Number Generators Notes Fundamentals of Digital Electronics 58 National Instruments Corporation Lab 6 JK MasterSlave FlipFlop
One of the most important clocked logic devices is the masterslave JK flipflop. Unlike the Dlatch, which has memory only until another clock pulse co...
View
Full
Document
This note was uploaded on 12/01/2009 for the course S ss taught by Professor S during the Spring '09 term at Universidad Autonoma de Nuevo Leon  School of Business.
 Spring '09
 s

Click to edit the document details