Johan’s Applied Math projects

Projects that I built by myself

For these project, I conducted the research and development at home. As always, my father supervised the project and helped me with architecture and code reviews to keep it readable and maintainable. He also provided suggestions to organize the code
to make modules reusable and testable.

derived work
Building Math Hardware
This article shows some implementation of the math operations introduced in chapter 7 of the inquiry “How do computers do Math?” The combinational logic is described in the HDL Verilog 2001. «not public yet»

Johan’s Theoretical Math

I love math. Math proves the theorems about sciences such as physics and helps solve difficult problems. I envision problems in mathematical terms, and like to talk about it until I fall asleep. I love learning about math, because it is intuitive and forms the basis for many of my favorite sciences.

Learning

Mathcounts
AMC 10/12

Learning at home

I jumped ahead of the school curriculum, and spent much of the summer with my dad and learned about applications of calculus.

Euler’s Formula
Proof of Euler’s formula, identify and relation to trigonometry. «read more»
Laplace Transforms
Proof of Laplace transforms as used in my Electronics article «read more»
own work
Laplace in Mechanical Systems
Using Laplace transforms to solve mechanical ordinary differential equations «read more»
own work
Impedance
Introduces the formulas for Capacitor and Inductor impedance. «read more»
Evaluating Transfer Functions.
Evaluating transfer functions with impulse, unit step and sinusoidal input signals «read more»
own work
RC Low-pass Filter
Low-pass filters remove high frequency components from a signal. A single-pole passive RC filter consists of a resistor and capacitor in series. «read more»
own work
RLC Low-pass Filter
Filters can remove low and/or high frequencies from an electronic signal. They can be used to suppress unwanted frequencies such as background noise. This article shows the math and visualizes the poles in the
s-place, examines and visualizes the the step and frequency response. «read more»
own work
RLC Resonator
RLC circuits are resonant circuits, as the energy in the system “resonates” between the inductor and capacitor. We will examine the properties of a resonator consisting of series circuit of an inductor (L), capacitor
(C) and resistor (R), where the output is taken across the resistor. «read more»

Building Math Hardware

derived work
Primary school teaches our students methods for addition, subtraction, multiplication and division. Computer hardware implements similar methods and performs them with astounding speed. This enables applications such as computer vision, process control, encryption, hearing aids, video compression to dubious practices as high-frequency trading.

Introduction

This article describes how to build such hardware. In such, it is a sequel to the inquiry “How do Computers do Math?” that in chapter 7 introduced conceptual circuits using logic gates. We will model the various math operations using digital gates. Here we combine the gates into circuits and describe them using the Verilog Hardware Description Language (HDL). These Verilog HDL descriptions are compiled and mapped to a Field Programmable Gate Array (FPGA). Working knowledge of the Verilog HDL is assumed. To learn more about Verilog HDL, I recommend the book FPGA Prototyping with Verilog Examples, an online class or lecture slides. To help you get up to speed with the development boards, wrote Getting Started documents for two popular Altera and Xilinx boards. We aim to study algorithms to implement the algorithms in generic VLSI, and as such do will not use the highly optimized carry chain connections present on many FPGAs.

Hail to the FPGA

Let’s take this moment to honor the virtues of the FPGA. A FPGA can do many things at the same time and still respond immediately to input events. It is generally more complicated to create and debug the same logic in a FPGA compared to a microprocessor. Because of the challenges that FPGA development poses, many systems combine FPGAs and microprocessors to get the best of both worlds. For example, to recognize objects in a video stream, one would implement the pre-processing (noise removal, normalization, edge detection) in an FPGA, but the higher-level logic on a CPU or DSP. With a FPGA, you can put massive parallel structures in place. For example, an high-speed data stream can be distributed across the whole FPGA chip to be processed in parallel, instead of having a microprocessor deal with it sequentially. FPGAs can accelerate machine learning algorithms, video encoding, custom algorithms, compression, indexing and cryptography. By implements a soft microprocessor as part of the FPGA it can also handle high level protocols such as handle board management, protocol bridging and security tasks. [IEEExplore]

Content

The first chapter describes the demonstration setup. Remaining chapters implement the concepts introduced in the inquiry How do Computers do Math?.
  1. Introduction
  2. Demonstration
  3. Adder (and subtractor)
  4. Faster adder (and subtractor)
  5. Multiplier
  6. Faster multiplier
  7. Divider
  8. Square root
  9. Conclusion

Tools

The code examples were tested on an Altera “Cyclone IV E” FPGA using Quartus Prime 16.1. Earlier code iterations used a Xilinx “Spartan-6” with their ISE Design Suite. The Verilog descriptions should work equally well on other boards or environments. For debugging, we used gate level simulation. In the real world, a DSLogic Logic Analyzer proved valuable in diagnosing problems.

How do computers do math?

This inquiry answers the question “How do computers do math?”. What once started as an innocent question from a six year old, turned into this 9 page post.

After a short introduction, we dive down into solid-state chemistry from where we emerge traversing along Ohm’s law, semi-conductors, logic gates and combinational logic.

The first seven chapters answer of our inquiry. Chapter 5 and 6 are optional. The remaining chapters merely complete the discussion of logic gates.

  1. Introduction
  2. Electrical circuits
  3. Electronic circuits
  4. Diodes based logic
  5. Bipolar junction transistor (BJT) based logic
  6. Field effect transistor (FET) based logic
  7. Math operations using combinational logic
  8. Synchronous sequential logic
  9. Programmable logic
Copyright © 2018 Coert Vonk, All Rights Reserved