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 5-5. Serial Output from the Pseudo-Random 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 5-6. Comparison of the First 50 Binary Bits from a PRBS with Bits 255-305 Fundamentals of Digital Electronics 5-4 National Instruments Corporation Lab 5 Pseudo-Random Number Generators 8-Bit Pseudo-Random Number Generator
The addition of an analog-to-digital converter allows the parallel outputs of the pseudo-random 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 three-digit display and chart on the front panel. Figure 5-7. Numeric Output from an 8-Bit 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 8-bit PRNG. Note how the DAC displays the numerical values of the Boolean parallel outputs. Figure 5-8. LabVIEW Program for the 8-Bit PRNG with Chart Output National Instruments Corporation 5-5 Fundamentals of Digital Electronics Lab 5 Pseudo-Random Number Generators The chart format conveniently displays the analog sequence. Over the short range (10-30) 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 2N-1 cycles. Amplifiers like digital gates may have short-term memory, but not long-term 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 7-bit ASCII codes yield an 8-bit digital number. Banking machines, electronic door locks, and computer passwords all use ASCII data and some form of encryption to preserve security. The 8-bit 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 8-bit 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 5-9. Boolean Array Representation of the 8-Bit Binary Pattern of the First Eight Numbers of an 8-Bit 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 5-6 National Instruments Corporation Lab 5 Pseudo-Random 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 (6-bit PRNG) PRBS0.vi (8-bit pseudo-random bit sequencer) PRBS.vi (8-bit PRBS with serial output on chart) PRNG.vi (8-bit PRNG with chart output) PRNG7.vi (8-bit PRNG with array outputs) DAC8.vi (8-bit DAC subVI) National Instruments Corporation 5-7 Fundamentals of Digital Electronics Lab 5 Pseudo-Random Number Generators Notes Fundamentals of Digital Electronics 5-8 National Instruments Corporation Lab 6 JK Master-Slave Flip-Flop
One of the most important clocked logic devices is the master-slave JK flip-flop. Unlike the D-latch, 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