Weigh Your Car With Paper

Sometimes a problem is more important than its solution. Humans love to solve mysteries and answer questions, but the most rewarding issues are the ones we find ourselves. Take [Surjan Singh], who wanted to see if he could calculate the weight of his Saab 96. Funny enough, he doesn’t have an automobile scale in his garage, so he had to concoct a workaround method. His solution is to multiply the pressure in his tires with their contact patch. Read on before you decide this is an imperfect idea.

He measures his tires with a quality gauge for the highest accuracy and pressurizes them equally. Our favorite part is how he measures the contact patch by sliding a couple of paper pieces from the sides until they stop and then measures the distance between them. He quickly realizes that the treads didn’t contact the floor evenly, so he measures them to get a better idea of the true contact area. Once he is satisfied, he performs his algebra and records the results, then drives to some public scales and has to pay for a weigh. His calculations are close, but he admits this could be an imprecise method due to an n-of-one, and that he didn’t account for the stiffness of the tire walls.

This was a fun thought experiment with real-world verification. If you’re one of those people who treats brainstorming like an Olympic sport, then you may enjoy the gedankenexperiment that is fractals.

Parsing Math In Python

Programming computers used to be harder. Don’t get us wrong — today, people tend to solve harder problems with computers, but the fundamental act of programming is easier. We have high-level languages, toolkits, and even help from our operating systems. Most people never have to figure out how to directly read from a disk drive, deblock the data into records, and perform multiplication using nothing but shifts and adds. While that’s a good thing, sometimes it is good to study the basics. That was [gnebehay’s] thought when his university studies were too high level, so he decided to write an arithmetic expression parser in Python. It came out in about 100 lines of code.

Interpreting math expressions is one of those things that seems simple until you get into it. The first problem is correctly lexing the input — a term that means splitting into tokens. For a human, it seems simple that 5-3 is three tokens, {5, -, and 3} and that’s easy to figure out. But what about 5+-3? That’s also three tokens: {5,+,-3}. Tricky.

Continue reading “Parsing Math In Python”

Intuition About Signals And Systems

Signals and systems theory is a tough topic. Terms like convolution and impulse response can be hard to understand on a visceral level and most books that talk about these things emphasize math over intuition. [Discretised] has a YouTube channel that already has several videos that promise to tackle these topics with “minimum maths, maximum intuition.” We particularly noticed the talks on convolution and impulse response.

We think that often math and intuition don’t always come together. It is one thing, for example, to know that E=I times R, and power is I times E, but it is another to realize that a half-watt transmitter delivers 5V into a 50╬ę load and that one watt will take just over 7V into that same load.

The example used is computing how much smoke you can expect to create by setting off fireworks. We presume the math models are notional since we imagine a real model would be pretty complex and involve things like wind data. But it still makes a nice example.

If you don’t know anything about the topic, these might not be the right ones to try to learn the basics. But we do applaud people sharing their intuition on these complex subjects.

Continue reading “Intuition About Signals And Systems”

Talking Head Teaches Laplace Transform

Most people who deal with electronics have heard of the Fourier transform. That mathematical process makes it possible for computers to analyze sound, video, and it also offers critical math insights for tasks ranging from pattern matching to frequency synthesis. The Laplace transform is less familiar, even though it is a generalization of the Fourier transform. [Steve Bruntun] has a good explanation of the math behind the Laplace transform in a recent video that you can see below.

There are many applications for the Laplace transform, including transforming types of differential equations. This comes up often in electronics where you have time-varying components like inductors and capacitors. Instead of having to solve a differential equation, you can perform a Laplace, solve using common algebra, and then do a reverse transform to get the right answer. This is similar to how logarithms can take a harder problem — multiplication — and change it into a simpler addition problem, but on a much larger scale.

Continue reading “Talking Head Teaches Laplace Transform”

Review: Calculator Kit Is Just A Few Hacks From Greatness

While most people are satisfied with a calculator application on their smartphone these days, there’s still something to be said for the old fashioned desk calculator. Maybe it’s the fact the batteries last long enough that you can’t remember the last time you changed them, or the feel of physical buttons under your fingers. It could even be the fact that it keeps your expensive smartphone from needing to sit out on the workbench. Whatever the reason, it’s not uncommon to see a real-life calculator (or two) wherever solder smoke tends to congregate.

Which is precisely the idea behind this DIY calculator kit. Available from the usual overseas retailers for about $15 USD, it has some hobbyist-oriented features such as the ability to decode resistor color bands, convert hexadecimal numbers, and calculate resistor values for driving LEDs. If you’re going to keep a knock-around calculator on your bench, why not build the thing yourself?

Given the dual nature of this product, a DIY electronics kit and a functional desk calculator for electronic hobbyists, it seems only appropriate to review both aspects of it individually. Which is good, since there may be more to this product than just the sum of its parts.

Continue reading “Review: Calculator Kit Is Just A Few Hacks From Greatness”

Implementing The Exponential Function

Ask ordinary software developers how to code an exponential function (that is, ex) and most will tell you to simply write an expression in their favorite high level language. But a significant slice of Hackaday readers will program tiny machines down to the bare metal or need more speed or precision than available with a customary implementation. [Pseduorandom] knows quite a few ways to do the calculation, and while it isn’t light reading for the math-phobic, it is an interesting tour.

The paper covers a variety of ways to calculate the function ranging from various Taylor series approximations, Lagrange interpolation, and Chebyshev interpolation. The paper is somewhat abstract, but there are Python and C++ examples to help make it concrete.

Continue reading “Implementing The Exponential Function”

Looking For Pi In The 8087 Math Coprocessor Chip

Even with ten fingers to work with, math can be hard. Microprocessors, with the silicon equivalent of just two fingers, can have an even harder time with calculations, often taking multiple machine cycles to figure out something as simple as pi. And so 40 years ago, Intel decided to give its fledgling microprocessors a break by introducing the 8087 floating-point coprocessor.

If you’ve ever wondered what was going on inside the 8087, wonder no more. [Ken Shirriff] has decapped an 8087 to reveal its inner structure, which turns out to be closely related to its function. After a quick tour of the general layout of the die, including locating the microcode engine and ROM, and a quick review of the NMOS architecture of the four-decade-old technology, [Ken] dug into the meat of the coprocessor and the reason it could speed up certain floating-point calculations by up to 100-fold. A generous portion of the complex die is devoted to a ROM that does nothing but store constants needed for its calculation algorithms. By carefully examining the pattern of NMOS transistors in the ROM area and making some educated guesses, he was able to see the binary representation of constants such as pi and the square root of two. There’s also an extensive series of arctangent and log2┬áconstants, used for the CORDIC algorithm, which reduces otherwise complex transcendental calculations to a few quick and easy bitwise shifts and adds.

[Ken] has popped the hood on a lot of chips before, finding butterflies in an op-amp and reverse-engineering a Sinclair scientific calculator. But there’s something about seeing constants hard-coded in silicon that really fascinates us.