CPE 462 VHDL: Simulation and Synthesis



Similar documents
Office of Liquor Gaming and Regulation Random Number Generators Minimum Technical Requirements Version 1.4

12. A B C A B C A B C 1 A B C A B C A B C JK-FF NETr

THE INTEL RANDOM NUMBER GENERATOR

if-then else : 2-1 mux mux: process (A, B, Select) begin if (select= 1 ) then Z <= A; else Z <= B; end if; end process;

The Mathematics of Gambling

Network Security. Chapter 6 Random Number Generation. Prof. Dr.-Ing. Georg Carle

EC313 - VHDL State Machine Example

Network Security. Chapter 6 Random Number Generation

VGA video signal generation

Hardware Implementation of the Stone Metamorphic Cipher

Digital Design with VHDL

CNC FOR EDM MACHINE TOOL HARDWARE STRUCTURE. Ioan Lemeni

Digital Electronics Detailed Outline

VHDL GUIDELINES FOR SYNTHESIS

INTRODUCTION TO DIGITAL SYSTEMS. IMPLEMENTATION: MODULES (ICs) AND NETWORKS IMPLEMENTATION OF ALGORITHMS IN HARDWARE

ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process)

Finite State Machine Design and VHDL Coding Techniques

Modeling a GPS Receiver Using SystemC

Digital Systems Design. VGA Video Display Generation

Two Binary Algorithms for Calculating the Jacobi Symbol and a Fast Systolic Implementation in Hardware

LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER

Lab 11. Simulations. The Concept

DAC Digital To Analog Converter

Random number generator

DDS. 16-bit Direct Digital Synthesizer / Periodic waveform generator Rev Key Design Features. Block Diagram. Generic Parameters.

Using Xilinx ISE for VHDL Based Design

An Example VHDL Application for the TM-4

State Machines in VHDL

EE552. Advanced Logic Design and Switching Theory. Metastability. Ashirwad Bahukhandi. (Ashirwad Bahukhandi)

Guru Ghasidas Vishwavidyalaya, Bilaspur (C.G.) Institute of Technology. Electronics & Communication Engineering. B.

Learning Outcomes. Simple CPU Operation and Buses. Composition of a CPU. A simple CPU design

Sprites in Block ROM

Using Retrocausal Practice Effects to Predict On-Line Roulette Spins. Michael S. Franklin & Jonathan Schooler UCSB, Department of Psychology.

Side Channel Analysis and Embedded Systems Impact and Countermeasures

MA 1125 Lecture 14 - Expected Values. Friday, February 28, Objectives: Introduce expected values.

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

VARIANCE REDUCTION TECHNIQUES FOR IMPLICIT MONTE CARLO SIMULATIONS

Abstract. Cycle Domain Simulator for Phase-Locked Loops

Lenguaje VHDL. Diseño de sistemas digitales secuenciales

One Time Pad Encryption The unbreakable encryption method

ISSCC 2003 / SESSION 13 / 40Gb/s COMMUNICATION ICS / PAPER 13.7

Synchronization of sampling in distributed signal processing systems

Lecture 25: Money Management Steven Skiena. skiena

Harmonics and Noise in Photovoltaic (PV) Inverter and the Mitigation Strategies

The Monte Carlo method is a statistical STAN ULAM, JOHN VON NEUMANN, and the MONTE CARLO METHOD. by Roger Eckhardt

Clocking. Figure by MIT OCW Spring /18/05 L06 Clocks 1

Glitch Free Frequency Shifting Simplifies Timing Design in Consumer Applications

Making Accurate Voltage Noise and Current Noise Measurements on Operational Amplifiers Down to 0.1Hz

AMS 5 CHANCE VARIABILITY

Conversion Between Analog and Digital Signals

In this example the length of the vector is determined by D length and used for the index variable.

Section 3. Sensor to ADC Design Example

In the situations that we will encounter, we may generally calculate the probability of an event

Area 3: Analog and Digital Electronics. D.A. Johns

Asynchronous & Synchronous Reset Design Techniques - Part Deux

Computer Networks and Internets, 5e Chapter 6 Information Sources and Signals. Introduction

Content Map For Career & Technology

Lecture 11: Sequential Circuit Design

Upon completion of unit 1.1, students will be able to

Quartus II Introduction for VHDL Users

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

1. Oscilloscope is basically a graph-displaying device-it draws a graph of an electrical signal.

Lab 11 Digital Dice. Figure Digital Dice Circuit on NI ELVIS II Workstation

Betting systems: how not to lose your money gambling

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

Bingo and Casino Equipment Technical Requirements

Monday January 19th 2015 Title: "Transmathematics - a survey of recent results on division by zero" Facilitator: TheNumberNullity / James Anderson, UK

Security Policy: Key Management Facility Crypto Card (KMF CC)

Combining the ADS1202 with an FPGA Digital Filter for Current Measurement in Motor Control Applications

Hideo Okawara s Mixed Signal Lecture Series. DSP-Based Testing Fundamentals 46 Per-pin Signal Generator

LEVERAGING FPGA AND CPLD DIGITAL LOGIC TO IMPLEMENT ANALOG TO DIGITAL CONVERTERS

Step Response of RC Circuits

Introduction to Programmable Logic Devices. John Coughlan RAL Technology Department Detector & Electronics Division

CSCE 465 Computer & Network Security

Intelligent Heuristic Construction with Active Learning

VHDL programmering H2

Programmable Single-/Dual-/Triple- Tone Gong SAE 800

Measurement Study of Wuala, a Distributed Social Storage Service

Loop Bandwidth and Clock Data Recovery (CDR) in Oscilloscope Measurements. Application Note

APPLICATION NOTE. Efficient Shift Registers, LFSR Counters, and Long Pseudo- Random Sequence Generators. Introduction.

Network Security: Cryptography CS/SS G513 S.K. Sahay

Signal Processing in So.ware and Electric Field Sensing

Digital to Analog and Analog to Digital Conversion

MAS.836 HOW TO BIAS AN OP-AMP

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level

Electronics. Discrete assembly of an operational amplifier as a transistor circuit. LD Physics Leaflets P

Teaching the Importance of Data Correlation in Engineering Technology

Step : Create Dependency Graph for Data Path Step b: 8-way Addition? So, the data operations are: 8 multiplications one 8-way addition Balanced binary

DEVELOPMENT OF DEVICES AND METHODS FOR PHASE AND AC LINEARITY MEASUREMENTS IN DIGITIZERS

Probability. Sample space: all the possible outcomes of a probability experiment, i.e., the population of outcomes

AES (Rijndael) IP-Cores

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

Testing Low Power Designs with Power-Aware Test Manage Manufacturing Test Power Issues with DFTMAX and TetraMAX

Elementary Statistics and Inference. Elementary Statistics and Inference. 16 The Law of Averages (cont.) 22S:025 or 7P:025.

Solar Energy Conversion using MIAC. by Tharowat Mohamed Ali, May 2011

Evaluating AC Current Sensor Options for Power Delivery Systems

Windows Server Performance Monitoring

Transcription:

CPE 462 VHDL: Simulation and Synthesis Topic #09 - a) Introduction to random numbers in hardware

Fortuna was the goddess of fortune and personification of luck in Roman religion. She might bring good luck or bad: she could be represented as veiled and blind. Dürer's engraving of Fortuna (1502)

Three ways to generate random numbers Harvesting random signals in hardware Using a software algorithm based on a seed Using "random" macroscopic processes Why do we care about randomness? Secure communication, simulation of physical events, games,...

Random numbers generated by hardware

Hardware random number generator What is a Hardware random number generator? Is an apparatus that generates random numbers from a physical process. How can you create random numbers in hardware? Often based on microscopic phenomena that generate a lowlevel, statistically random "noise" signal, such as thermal noise, nuclear decay, the photoelectric effect or other quantum phenomena.

Intel Random Number Generator Johnson noise (or thermal noise), shot noise, and flicker noise are present in all resistors. They have electrically measurable characteristics and are the result of random electron and material behavior.

Intel Random Number Generator The Intel RNG primarily samples thermal noise by amplifying the voltage measured across undriven resistors. These measurements are correlated to local pseudorandom environmental characteristics, such as electromagentic radiation, temperature, and power supply fluctuations.

Intel Random Number Generator The Intel RNG significantly reduces the coupled component by subtracting the signals sampled from two adjacent resistors. Circuitry used for amplification or signal handling should preserve as many of the components of randomness as possible

How does it actually work? You have two oscillators: one very fast and one very slow. Thermal noise adjusts the frequency of the slower clock. The varying, noise-controlled slower clock is used to trigger measurements of the fast clock. Drift between the two clocks thus provides the source of random binary digits.

Von Neumann Corrector It cannot assure randomness in its output, however it will transform a biased random bit stream into an unbiased one. The initial random measurements are processed by a hardware corrector to produce a balanced distribution of 0 and 1 bits. A von Neumann corrector converts pairs of bits into output bits by converting the bit pair [0,1] into an output 1, converting [1,0] into an output 0, and outputting nothing for [0,0] or [1,1]. The corrector prevents imbalances in the fast clock s duty cycle from biasing the output.

Most of random number generators work the same way A hardware random number generator typically consists of: A transducer to convert some aspect of the physical phenomena to an electrical signal An amplifier and other electronic circuitry to increase the amplitude of the random fluctuations to a macroscopic level, Some type of analog to digital converter to convert the output into a digital number, often a simple binary digit 0 or 1. By repeatedly sampling the randomly varying signal, a series of random numbers is obtained.

Problems with hardware generated random numbers They are relatively slow They produce a limited number of random bits per second In order to increase the data rate, they are often used to generate the "seed" for a faster software generated random numbers, which then generates the output sequence

Algorithmically generated random numbers

Pseudo-random numbers generators (PRNG) Are software programs used in computers to generate "random" numbers. Use a deterministic algorithm to produce numerical sequences. Although sequences pass statistical pattern tests for randomness, by knowing the algorithm and the conditions used to initialize it, called the "seed", the output can be predicted. Because the sequence of numbers produced by a PRNG is predictable, data encrypted with pseudorandom numbers is potentially vulnerable to cryptanalysis.

Random Numbers vs Pseudo Random Numbers Hardware random number generators produce sequences of numbers that are not predictable, and therefore provide the greatest security. Pseudo-random numbers require a seed... so they are potentially unsafe. If I know the source code of the program, I can theoretically discover the seed of the random number... and predict the flow of a random process (such as pacman!)

Speaking of Pacman... This guy has a Pacman maze tattoo on his back.

Random numbers by macroscopic processes

Numbers generated from "random" macroscopic processes Generated from activities such as coin flipping, dice, roulette wheels and lottery machines. These macroscopic processes are deterministic under Newtonian mechanics However the output of a well-designed device like a roulette wheel cannot be predicted in practice, because it depends on the sensitive, micro-details of the initial conditions of each use. Edward Thorp (left) and Claude Shannon created the first wearable computer (1960) that was placed in a shoe that would suggest which octant to bet based on the speed of the roulette wheel.

If you are interested in gambling, betting and random numbers I recommend reading this book!

Parapsychology The Princeton Engineering Anomalies Research (PEAR) program was established at Princeton University in 1979. Their goal was to pursue rigorous scientific study of the interaction of human consciousness with physical devices. In other words, if I try really hard, can I mess up the outcome of a machine?

Can you turn on a green light? If you try really hard, can you change the color of a traffic light with the power of your mind?

Can operators skew random distributions of mechanical processes? http://www.princeton.edu/~pear/experiments.html For different mechanical devices they published a lot of data since 1986. Conclusions: Authors claim very small, but consistent across time and experimental designs, resulting in an overall statistical significance. On average, people can shift 2 3 events out of 10,000 from chance expectation! Opponents claim, only good data is being published (publication bias)

Closing of Princeton s PEAR lab Dealing with skew of random numbers was not enough. They also did research on remote viewing. Remote viewing (RV) is the practice of seeking impressions about a distant or unseen target using paranormal means. US government actually funded this type of research! http://www.remoteviewed.com Robert L. Park said of PEAR, "It s been an embarrassment to science, and I think an embarrassment for Princeton".

Pseudo random numbers in VHDL

We can create pseudo random numbers using a LFSR A shift register when clocked, advances the signal through the register from one bit to the next most-significant bit.

Linear feedback shift register (LFSR) A linear feedback shift register can be formed by performing XOR on the outputs of two or more of the flip-flops together and feeding those outputs back into the input of one of the flip-flops.

Pseudorandom Pattern Generation Linear feedback shift registers make extremely good pseudorandom pattern generators. When the outputs of the flip-flops are loaded with a seed value (anything except all 0s, which would cause the LFSR to produce all 0 patterns) and when the LFSR is clocked, it will generate a pseudorandom pattern of 1s and 0s. Note that the only signal necessary to generate the test patterns is the clock.

Maximal-length LFSR A maximal-length LFSR produces the maximum number of PRPG patterns possible and has a pattern count equal to 2n 1, where n is the number of register elements in the LFSR. It produces patterns that have an approximately equal number of 1s and 0s and have an equal number of runs of 1s and 0s. 4-bit Maximal-Length LFSR

Maximal-length LFSR 16 bit Maximal LFSR Because there is no way to predict mathematically if an LFSR will be maximal length, Peterson and Weldon2 have compiled tables of maximal-length LFSRs to which designers may refer.

LIBRARY ieee; USE ieee.std_logic_1164.all; entity lfsr_block is port (clk,rst : in std_logic; seed : in std_logic_vector(2 downto 0); lfsr : out std_logic_vector(2 downto 0) ); end entity; Implementing a LFSR in VHDL architecture myarch of lfsr_block is begin --signal lfsr : std_logic_vector(14 downto 0); process(clk,rst) variable tmp_lfsr : std_logic_vector(2 downto 0); begin! if (rst='1') then tmp_lfsr := seed;! elsif (clk'event and clk='1') then!! tmp_lfsr :=(tmp_lfsr(1) xor tmp_lfsr(0)) & tmp_lfsr(2 downto 1);!! lfsr <= tmp_lfsr;! end if;! end process; end architecture;

Practical LFSR In a practical ASIC design, the user would create an LFSR that is much bigger than three bits to get a large number of pseudorandom patterns before the patterns repeated. However, there are some practical restrictions to the length of the LFSR. A 32-bit maximal-length LFSR would create over 4 billion patterns that, at a 16-MHz clock rate, would take almost 5 minutes to generate the whole pattern set.