










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











By Jason Agne Jwo-Shiun Yang ECE 445, SENIOR DESIGN PROJECT SPRING 2007 TA: Bob Schoonover April 31, 2007 Project No. 40
Random number generation is an essential step in many cryptography applications, as well as uses ranging from simulations to video games. Computer algorithms to “estimate” random numbers are the common source of random numbers. A quantum random number generator would circumvent the need for algorithms and always result it a random number due to quantum principles. Current attempts at quantum random number generation do not exceed a generation rate of 10MHz. Using a time between pulses rather than a pulse or no-pulse scheme, we attempt to build a faster Quantum Random Number Generator. ii
Random numbers are needed primarily for encryption purposes, but the practical uses of random numbers also extend to simulations that require a random element and video games. Many of the random numbers used today are generated by programmed algorithms. Particularly in situations where security is at stake, this can prove to be an insufficient source, as all one needs to do is to figure out the algorithm in order to render the encryption obsolete. Quantum random number generation is an idea that has been around for some time. Quantum random number generation relies on the inherent uncertainties of quantum principle to generate random numbers. This removes the implementation of algorithms, thus making it impossible to “crack” a code. However, until now, quantum random number generation has been limited in function, and thus in use, by the low speeds of the process. The common model for a quantum random number generator is to pass photons, one at a time, through a medium that has a 50% probability of transmission^1 (Error: Reference source not found). If a photon is passed, the quantum random number generator will put out a high, or a ‘1,’ otherwise, it will put out a ‘0.’ The limiting factor of this model is primarily the emission of a single photon. It is impossible to control the emission a single photon, from any system. Usually, a regular source of photons is used, and a barrier is placed between the source and the medium (Error: Reference source not found). This barrier will have a certain time-dependent probability associated with emitting a photon, depending on the intensity of the source, and the distance from it. The intensity of the source and the absorption factor of the barrier can be adjusted as needed. The idea of this is to establish a specific time frame for which one, and only one, photon has a very high probability of passing. If more than one passes, it nullifies the 50% chance of a single photon passing the medium, by which the random bit is determined^2. If no photons pass, of course, it also nullifies the 50% chance. It is, thus, very important to not only increase the absorption or reflection of the barrier such that the probability is very small that it passes more than one photon over a given time, but also to increase your allotted detection time to encompass a time frame that yields a high probability of one single photon passing the barrier. (^1) Usually a beam splitter is used. (^2) I.E. it becomes a 75% chance that the next bit will be a 1. Figure 1: A beam splitter that divides the input of an incoming beam evenly will have a 50% chance of passing a single photon. As each photon is emitted, the detector determines whether or not it has passed through the beam splitter, yielding a logic high for that clock cycle if so, and a logic low if not.
These timing uncertainties are a significant restraint for using quantum devices for random number generation. However, for our project, rather than circumventing all of that, we exploited it. We used the inherent randomness associated with the passage of photons through a barrier and used that for our random number (Error: Reference source not found). The idea (proposed by Professor Kwiat) is to detect when a photon is passed through a barrier, record the time, and then detect when a second photon is passed. The time difference between the passage of these two photons is a random number. We use an analog-to-digital converter to make a digital representation of that time difference. At this point we have a random number; however, the probability distribution of these time differences is not uniform. To be considered a purely random source each possibility must have an equal probability of occurrence. So we then implement a ‘hashing’ function in an attempt to adjust biased inputs. This project has been going on for three semesters. The input to the laser was a project from the Spring of 2006. The time-to-digital converter (TDC) was a project from the Fall of 2007. Our goal was to bring these together and create a hashing function. This was done using a Xilinx®^ Spartan™-3 FPGA. The FPGA was coded to operate in three stages. The first is initialization. In this stage we load the TDC with the appropriate parameters needed to suit our needs. The second is the setting of the parameters of the hashing function. This is done in the FPGA and determines how the information being passed from the TDC is to be altered, in the effort of making the final output more uniform. The third stage is simply the running of the device. This takes the signal from the TDC and converts it into a uniform distribution of outputs. Figure 2: With a barrier added, we can experience the one photon “at a time” that allows us to represent the passage of single photons through a beam splitter as discreete digits. It is important to know that while the single photons depicted in this drawing are equally spaced in space, and thus in time, that is not reality. Our device depends on them not being equally spaced, in fact. Figure 3: A more accurate representation of what the barrier passes. The spatial differences drawn correspond to time differences (as the speed of light is constant). If one could measure the time difference, they would have several bits of random numbers.
The TDC-GPX had a significant advantage in speed and resolution, but required many external peripherals (Error: Reference source not found) to maintain its function. In addition, it required initialization when power was turned on, before operation. The initialization was a part of our project. Figure 4: A picture of the TDC-GPX with all attached periphials Figure 5: The schematics for the required periphial maintainance of the TDC GPX
Our method of design consisted of three steps. The first was to create the TDC loading program. The second was to create the Hashing function, and the final step was to bring the two together (Figure 6). Unfortunately, complications arose. It turns out the TDC output is not compatible with the FPGA’s inputs. A design could be made to convert the outputs from the TDC into logic the FPGA understands, but that would be another project in and of itself. We assumed outputs from the TDC and began working on the hashing function second. The signal coming from the TDC must go through four phases in order to produce a uniform distribution. The first is the exponential debiaser. This attempted to reduce the amount of an exponential bias a distribution may have. The second is the time bins. In this phase, each signal received from the exponential debiaser translated into an appropriate random output. Each possible output had a range of inputs associated with it, and each time bin corresponded to each possible output. The range of the time bins could be adjusted to reduce or increase the number of inputs associated with the corresponding output. This led to the third phase which was to devise a way to adjust the ranges of these time bins. The fourth phase was to display a running sum of the contents of these time bins, to check the function of our hashing program. 2.1 TDC Loader The TDC Loader (Appendix D) was accomplished in three primary states. The states occurred in this order:
these increased in count, we displayed approximately 10 orders of magnitude lower than what was counted on the mux, this gave us an idea of the distribution of rates. The interface is the tool used to make adjustments to the bin and exponential settings. There are three main states of the interface: Load, Display, and Standby. Display is what displays how the bins are accumulating. Standby displays nothing. Load is the state used to make adjustment. The load state has two more sub-states. These states are for selecting to load the exponential debiaser term or load the bins. The bin sub-state has four consecutive sub-states in addition to it. The first selects the bin number to modify. The second retrieves information about that bin. The third allows the user to modify the bin range. The fourth stores the bin information back in the bin’s register.
3.1 TDC Loader The TDC loader was a series of write operations to the TDC registers. A total of eight registers, each 28 bits wide. Before writing at all, the power up reset must be enabled. This was a low-active input that simply reset the TDC. Figure 7: The state machine for the loading of the TDC-GPX. The Write operation was looped a total of 8 times – one for each register to be written to. Figure 8: The timing requirements to write into the registers of the TDC-GPX
Data in – this is the data taken from the TDC Low bin – this is the value of the low point of each bin. Flag – indicates whether or not the data in has been fit Write enable – determines whether the range for each bin can be rewritten. Range – if the write is enabled, this input will determine what the new range will be Bin ID – works in conjunction with the write enable to determine if it is the correct bin The outputs are simply the modified, or unmodified, versions of the Flag, Low bin, and Data in. The operation of each bin occurs in five steps. The first is to add the range to the value given as the Low Bin. The value of Low Bin, in conjunction with the value given when the range is added, determines the limits to which we make our comparison. In addition to being used for comparison, the value of the upper limit of this range is also passed along to the next bin’s Low Bin input. The comparison is made and if the data from the TDC is found to be within the range, a logic High is passed to a Mux. The Mux passes either the data from the data in or the Bin ID of that bin. It will pass the Bin ID when two conditions are met: The flag must be zero and the comparison must be true. In all other cases, it passes the data given from Data in to the next bin’s Data in. When a comparison is true, the flag is also set to indicate, to the remaining bins, that the correct bin has already been found. This bin number will now cascade through the remaining bins and eventually become an output. When this flag is set, all remaining bins will pass the value passed to Data in, from the previous bin, regardless of whether or not the comparison is true. 3.4 Monitor/Interface The monitor and interface is combined into one section, as the states are related. This module also brings the other three sections together (Error: Reference source not found). Figure 9: A schematic representation of each bin.
The start portion contained all of the states involved in the initialization of the registers. The Operate state contained the exponential and bin modules, in conjunction with the read operations for the TDC. These states were traversed through by a series of switches. The Operate state has already been discussed in detail, as has the start state. The remaining states are somewhat self-explanatory, but it would not hurt to go over them briefly. When all switches were low, we were in the standby state. One switch corresponded to moving to the operate state, and another to moving to the load state. If both switches were high, we returned to standby. When in the load state, you could choose to load either a bin or the exponential. This was determined by another switch. When in the exponential adjustment state, you simply adjusted the value exactly as it was in memory. When adjusting the bin, however, a few steps needed to be taken beforehand. The first state you enter when you decide to alter a bin is the bin select state. This allows the user to select which bin to adjust. Once that is selected, another switch is thrown. The machine then retrieves the bin information from the selected bin and displays it on the seven segment mux. Once that is finished, it immediately goes into the adjust state for this bin. The user may now adjust the bin as needed. To store the bin in memory, it was determined that the next state should be the standby state. If you deselect the switch that allowed you to write into a bin, it will not write the value you had changed. This is to prevent ‘accidental’ changes and to allow the user an easy way to reset the value, in case a mistake was made. Figure 10: The state diagram of the Monitor/Interface
The cost for this project was very minimal. All of the materials required were provided for us by previous semesters. There was only labor considerations. At about $65/hr, and an average of 3 hours per day spent on this, excluding weekends, this comes out to 12 weeks. 12x65x3x2 = $4680.
Our reigning triumph was that we did get a signal from the TDC. The hashing function was not entirely necessary, as the inputs could be adjusted to make the distribution more uniform. Moreover, a hashing function could be better written with a computer program, rather than an FPGA – it would be both more efficient and a great deal more reliable. The FPGA was suitable for initializing the TDC, and could be used for retrieving information from it, but it is hardly an efficient device for hashing. The output from the TDC also uses “amp logic,” that is to say it does not have a 5V logic high when it is meant to be read as “high.” Instead, it has a .3mA signal to represent a high, and 0mA when it is low. This could be hooked up with a simple series of transistor inverting amplifiers, for speed in translation from amp logic to TTL logic. The output from the TDC will be inverted, in that case, but that will only result in a reflection in the distribution about the midpoint – the output will still be random. The function of the hasher we designed would be no different, except that the exponential function would need to be modified to account for the fact that higher numbers would have a larger probability of occurrence. However, even this is not necessary, as a simple inversion could take place directly at the inputs from the TDC, as programmed. We say it is not “necessary,” however we do not recommend using the FPGA any more than we already are. Adjusting what we already have is preferred over adding to it.