diff --git a/README.md b/README.md
index 583ee0fe48ba8370501a350272c5ed39734e5a52..f3715964d711184fdd8044d8aba7e2d9ca3c1c7c 100644
--- a/README.md
+++ b/README.md
@@ -61,6 +61,7 @@ for (i,t) = enumerate(0:h:duration)
 end
 ```
 
+
 Often one finds the need to implement a stateful controller, i.e., a function
 that has a memory or state. To this end, the function [`sysfilter`](@ref) is
 provided. This function is used to implement control loops where a signal is
diff --git a/src/LabProcesses.jl b/src/LabProcesses.jl
index 028f96e8d4962bcc321507be532ef45a0e53e14f..a2277f380f08e592d5d3ac9bf85e4d9daa8490f0 100644
--- a/src/LabProcesses.jl
+++ b/src/LabProcesses.jl
@@ -9,6 +9,7 @@ include("interface_documentation.jl")
 include("interface_implementations/ballandbeam.jl")
 
 include("utilities.jl")
+include("reference_generators.jl")
 include("controllers.jl")
 
 end # module
diff --git a/src/reference_generators.jl b/src/reference_generators.jl
new file mode 100644
index 0000000000000000000000000000000000000000..bdc22b87a4b58b46e9a96983d554710a28879718
--- /dev/null
+++ b/src/reference_generators.jl
@@ -0,0 +1,19 @@
+export PRBSGenerator
+
+#PRBS
+"""
+    r = PRBSGenerator(state = 1)
+Generates a pseudo-random binary sequence. Call like `random_input = r()`.
+"""
+mutable struct PRBSGenerator
+    state::Int
+end
+
+PRBSGenerator() = PRBSGenerator(Int(1))
+
+function (r::PRBSGenerator)(args...)
+    state = r.state
+    bit   = ((state >> 0) ⊻ (state >> 2) ⊻ (state >> 3) ⊻ (state >> 5) ) & 1
+    r.state = (state >> 1) | (bit << 15)
+    bit
+end
diff --git a/test/runtests.jl b/test/runtests.jl
index 84d5bdeec29bcae4e642f2d23eed8ffe36dbec62..51d3ce3b5a5818288f4b05eb6305a4420d6e03ca 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -1,5 +1,8 @@
 using LabProcesses
 using Base.Test
 
-# write your own tests here
-@test 1 == 2
+# Reference generators
+r = PRBSGenerator(Int(1))
+seq = [r() for i = 1:10]
+@test all(seq .==  [0, 0, 1, 0, 0, 1, 1, 0, 0, 1])
+foreach(r,1:10_000)