11# Example Chapter16_08 (advanced level)
2+
23## Generate and Display 128-bit Random Prime Numbers
34
45This advanced example uses a self-made pseudo-random electronic
@@ -34,7 +35,7 @@ from Newhaven Display International. The display
3435is 40 characters in width by 4 lines and is, in fact,
3536controlled as two individual displays packed together.
3637
37- The realease version of this software is intended to run on our target
38+ The release version of this software is intended to run on our target
3839with the 8-bit microcontroller, as shown below.
3940On this system, it takes approximately $15~ \text{s}$ on average
4041to find each single new pseudo-random 128-bit prime.
@@ -51,10 +52,10 @@ project uses
5152[ Boost.Multiprecision] ( https://www.boost.org/doc/libs/1_82_0/libs/multiprecision/doc/html/index.html )
5253for its 128-bit integer representation and independent primality testing.
5354
54- This advanced example's software running on an 8-bit micrcocontroller
55+ This advanced example's software running on an 8-bit microcontroller
5556exhibits a fascinating combination of elementary electronics,
5657real-time C++ object-oriented and template programming,
57- and the inate elegance and beauty of pure mathematics.
58+ and the innate elegance and beauty of pure mathematics.
5859
5960## Hardware Setup
6061
@@ -71,7 +72,7 @@ of the breadboard. The $12~\text{V}$ supply (center left) stems from a classic L
7172voltage regulator, from which TTL $+5~ \text{V}$ (upper left) is also derived for
7273the MCU and logic power rail.
7374
74- ![ ] ( ./images/board16_08.jpg )
75+ ![ View of hardware setup ] ( ./images/board16_08.jpg )
7576
7677In this particular image,
7778the system has accumulated a few hundred pseudo-random prime
@@ -83,21 +84,20 @@ with the prime number theorem.
8384The electronic subcircuit used for creating the random digitized noise
8485is sketched below.
8586
86- ![ ] ( ./images/circuit16_08.svg )
87+ ![ Schematic view of the random noise generator subcircuit ] ( ./images/circuit16_08.png )
8788
8889The oscilloscope image below shows a small snapshot
8990of the random digitized noise from this circuit.
9091The square-wave-like pulses result from digitizing the random signal
9192above/below $0~ \text{V}$. This is done with an op-amp and rudimentary logic,
9293as shown in the circuit.
9394
94- ![ ] ( ./images/signal16_08.jpg )
95+ ![ View of the generated noise on oscilloscope ] ( ./images/signal16_08.jpg )
9596
9697## Deep Connection to the Prime Number Theorem
9798
9899Recall the prime counting function
99- previously encountered in Example Chapter03_02
100- [ here] ( https://github.com/ckormanyos/real-time-cpp/tree/master/examples/chapter03_02#prime-counting-function ) .
100+ previously encountered in Example [ Chapter03_02] ( https://github.com/ckormanyos/real-time-cpp/tree/master/examples/chapter03_02#prime-counting-function ) .
101101The prime number theorem known from mathematical number theory
102102postulates that the prime counting function $\pi(x)$ for large $x$
103103asymptotically and approximately approaches
148148\left(\frac{2}{3}\right)~{\approx}~\frac{1}{24}\text{,}
149149$$
150150
151- which is around $4\\ %$.
151+ which is around $4\% $.
152152
153153Sect. 16.8 in the book runs through
154154the related, intriguing mathematics in great detail.
0 commit comments