5.3   PSEUDORANDOM NUMBER GENERATION

Random numbers can be very useful in simulation and testing digital circuits. Here we will use these numbers in testing the parallel adder described earlier. The term pseudorandom is used because the process is in fact completely predictable. The linear feedback shift register (LFSR) method is a particularly simple one, which can generate a sequence of length 2n – 1 for a register n bits long, provided it has the correct feedback connections. Figure 5–20 shows a 4-bit LFSR that can generate a sequence of length 15, not including the all-Is state, which is a lock-up state—once entered, the register will stay in this state indefinitely. Table 5–2 shows the feedback connections to produce a maximal length sequence for various register lengths.

Get Field-Programmable Gate Arrays: Reconfigurable Logic for Rapid Prototyping and Implementation of Digital Systems now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.