All Projects → 0 → msp430-rng

0 / msp430-rng

Licence: MIT license
Random (SLAA338) and pseudorandom (LCG) number generation.

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to msp430-rng

prvhash
PRVHASH - Pseudo-Random-Value Hash. Hash functions, PRNG with unlimited period, randomness extractor. (Codename Gradilac/Градилак)
Stars: ✭ 194 (+921.05%)
Mutual labels:  random, pseudorandom
xForth
Experimental Forth cross compiler for tiny devices
Stars: ✭ 53 (+178.95%)
Mutual labels:  microcontroller, msp430
jsrand
A seeded pseudo-random number generator for JavaScript.
Stars: ✭ 19 (+0%)
Mutual labels:  random, pseudorandom
rustBoot
rustBoot is a standalone bootloader written entirely in `Rust`, designed to run on anything from a microcontroller to a system on chip. It can be used to boot into bare-metal firmware or Linux.
Stars: ✭ 99 (+421.05%)
Mutual labels:  microcontroller
FsRandom
A purely-functional random number generator framework designed for F#
Stars: ✭ 51 (+168.42%)
Mutual labels:  random
WeightedRandomSelector
Very fast C# class for weighted random picking.
Stars: ✭ 117 (+515.79%)
Mutual labels:  random
rango
Random. Django. Rango. An introduction to using Python and Django to build a website.
Stars: ✭ 53 (+178.95%)
Mutual labels:  random
stm32f103xx
DEPRECATED
Stars: ✭ 31 (+63.16%)
Mutual labels:  microcontroller
XMC-for-Arduino
Integration of Infineon's XMC microcontrollers into the Arduino IDE.
Stars: ✭ 85 (+347.37%)
Mutual labels:  microcontroller
lrng
Linux Random Number Generator
Stars: ✭ 57 (+200%)
Mutual labels:  random
MlkPwgen
Secure random password generator for .NET and PowerShell
Stars: ✭ 57 (+200%)
Mutual labels:  random
Random-Number-Generator
A clean, simple random number generator for Android. Downloaded 180,000+ times and rated 2,000+ times on Google Play with 4.7+ average rating.
Stars: ✭ 30 (+57.89%)
Mutual labels:  random
tracy
gps + gprs tracker
Stars: ✭ 24 (+26.32%)
Mutual labels:  msp430
javascript-strong-password-generator
JavaScript Strong Password Generator: based on Jeff Atwood's Post "Password Rules Are Bullshit".
Stars: ✭ 21 (+10.53%)
Mutual labels:  random
this-is-your-life
An angular app character backstories based on the Xanathar's Guide to Everything 'This Is Your Life' tables.
Stars: ✭ 36 (+89.47%)
Mutual labels:  random
BluetoothHelper
Bluetooth helper Java class
Stars: ✭ 13 (-31.58%)
Mutual labels:  microcontroller
jRand
A Java library to generate random data for all sorts of things. Java random data faker
Stars: ✭ 27 (+42.11%)
Mutual labels:  random
nrf52-IR
Decoding and saving carrier modulated IR signals and sending modulated IR signals using NRF52 SoCs
Stars: ✭ 17 (-10.53%)
Mutual labels:  microcontroller
munix
🦠 µnix is a UNIX-like operating system
Stars: ✭ 57 (+200%)
Mutual labels:  microcontroller
alloc-cortex-m
A heap allocator for Cortex-M processors
Stars: ✭ 139 (+631.58%)
Mutual labels:  microcontroller

msp430-rng

Random and pseudorandom number generation for the MSP430, implemented in C.

Usage

  1. make rand
  2. #include "msp430-rng/rand.h"
  3. msp430-elf-gcc -o foo.elf foo.o rand.o

Generators

Random (rand())

Truly random number generator. Uses the time difference between the VLO and DCO, as outlined in SLAA338. It is self-contained, but it mucks about with clocks and timers, so it is only intended to be used very early on to generate the seed for a PRNG.

Pseudorandom (prand())

A very simple and fast PRNG implemented by a linear congruential generator with the following values:

  • modulus: 65536 (2^16)
  • multiplier: 49381
  • increment: 8643

Supported compilers

Currently only tested using the gcc msp430-elf cross-compiler (not mspgcc). Patches with modifications for other environments are welcome.

Tests

To run the tests, make test and run test.elf on your MSP430. They should take less than a minute to finish.

The test mechanism assumes that you are using a Launchpad, with LEDs on pins 0 and 6. While the tests are running, both LEDs are on; when the tests finish, one of the LEDs blinks (green: pass, red: fail).

Using mspdebug, it is easy to see which test is failing and possibly why:

prog test.elf
run
^C
md status 2
md sum_rand 2
md sum_prand 2

Monobit

An implementation of the Monobit algorithm outlined in section 2.1 of SP 800-22 Rev. 1a. Checks that the numbers of 0 and 1 bits in the produced values are equal to within a certain tolerance.

License

Provided under the terms of the MIT license. See LICENSE.txt for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].