Linear Feedback Shift Registers for the Uninitiated, Part V: Difficult Discrete Logarithms and Pollard's Kangaroo Method
Most discrete-log problems are hopeless by brute force, but clever algorithms cut that cost to feasible levels. This installment walks through baby-step giant-step, Pollard’s rho and kangaroo methods, and how Silver-Pohlig-Hellman and index calculus leverage group structure to speed attacks on GF(2^n) fields. Jason Sachs includes Python examples, heuristics, and complexity nuggets so you can see when each method is practical.
Linear Feedback Shift Registers for the Uninitiated, Part IV: Easy Discrete Logarithms and the Silver-Pohlig-Hellman Algorithm
Discrete logarithms can be either trivial or infeasible depending on how group elements are represented, and Jason Sachs shows a practical route when they are intentionally easy. This article walks through using LFSRs as fast counters, why a smooth group order matters, and how the Silver-Pohlig-Hellman algorithm plus the Chinese Remainder Theorem recovers exponents in GF(2) with small prime factors.
Linear Feedback Shift Registers for the Uninitiated, Part III: Multiplicative Inverse, and Blankinship's Algorithm
Jason Sachs walks through Blankinship's constant-space variant of the Extended Euclidean Algorithm and shows how to compute multiplicative inverses both modulo an integer and in GF(2)[x]. The article uses clear numeric and polynomial examples, Python snippets, and an LFSR finite-field example to show how the algorithm yields Bézout coefficients and inverses useful for discrete-log tricks and cryptographic contexts. Readers get a practical recipe for inverse computation.
Linear Feedback Shift Registers for the Uninitiated, Part II: libgf2 and Primitive Polynomials
Jason Sachs digs into practical finite-field arithmetic for LFSRs, using his libgf2 Python library as the hands-on guide. He shows how to test whether a polynomial is primitive, why that matters for maximal-length sequences, and how the library implements addition, multiplication, exponentiation, and shifts over GF(2). The post is both a math refresher and a code walkthrough for engineers who want to compute with LFSRs instead of just talk about them.
Linear Feedback Shift Registers for the Uninitiated, Part I: Ex-Pralite Monks and Finite Fields
Jason Sachs demystifies linear feedback shift registers with a practical, bitwise view and the algebra that explains why they work. Readable examples compare Fibonacci and Galois implementations, show a simple software implementation, and reveal the correspondence between N-bit Galois LFSRs and GF(2^N) so you can pick taps and reason about maximal-length pseudorandom sequences.
Ten Little Algorithms, Part 6: Green’s Theorem and Swept-Area Detection
Jason shows how Green's Theorem becomes a practical, low-cost method to detect real-time rotation from two orthogonal sensors by accumulating swept area. The post derives a compact discrete integrator S[n] = S[n-1] + (x[n]*(y[n]-y[n-1]) - y[n]*(x[n]-x[n-1]))/2, compares integer and floating implementations, and analyzes noise scaling and sampling rate tradeoffs. Includes Python demos and threshold guidance.
Donald Knuth Is the Root of All Premature Optimization
Knuth's famous line "premature optimization is the root of all evil" has turned into a blunt rule on forums, Jason Sachs argues, and that overuse masks important nuance. He walks through concrete embedded examples, from dsPIC33E floating-point timings to an ROI analysis in the Kittens Game and a continuous optimization toy problem, to show when to measure, when to speculate, and why profilers can mislead.
Zebras Hate You For No Reason: Why Amdahl's Law is Misleading in a World of Cats (And Maybe in Ours Too)
Amdahl’s Law is a useful warning, but Jason Sachs argues it can be misleading if you stop at the equation. Using the Kittens Game as a playful model, he shows how Gustafson’s perspective, positive feedback loops, and system-level synergy can turn modest component speedups into big real-world wins. The article closes with concrete embedded-systems examples like ISR timing and developer productivity.
The Other Kind of Bypass Capacitor
Most engineers treat bypass capacitors as supply decoupling, but Jason Sachs digs into the other kind: a capacitor placed in the feedback path to tame unpredictable high-frequency plant behavior. He walks through real examples, Bode plots, and a simple RC model to show how the cap forces unity-gain feedback at high frequency, stabilizing switching regulators and wideband amplifiers while revealing the speed versus stability tradeoff.
How to Succeed in Motor Control: Olaus Magnus, Donald Rumsfeld, and YouTube
Jason Sachs turned frustration with algorithm-heavy motor-control app notes into a practical MASTERs class, now available on YouTube. He walks through building a fifteen-minute field-oriented control refresher, the hazards teams commonly miss, and the months of prep required to make a polished technical lecture. Read for a candid behind-the-scenes look at teaching motor control to engineers and tips you can apply to your next drive project.
Ten Little Algorithms, Part 1: Russian Peasant Multiplication
Jason Sachs revisits a centuries-old multiplication trick and shows why it still matters. He lays out Russian Peasant Multiplication with simple Python code, then reveals how the same shift-and-add pattern maps to GF(2) polynomial arithmetic and to exponentiation by squaring. The post mixes historical context with practical bitwise techniques that are useful for embedded and low-level math work.
Linear Feedback Shift Registers for the Uninitiated, Part III: Multiplicative Inverse, and Blankinship's Algorithm
Jason Sachs walks through Blankinship's constant-space variant of the Extended Euclidean Algorithm and shows how to compute multiplicative inverses both modulo an integer and in GF(2)[x]. The article uses clear numeric and polynomial examples, Python snippets, and an LFSR finite-field example to show how the algorithm yields Bézout coefficients and inverses useful for discrete-log tricks and cryptographic contexts. Readers get a practical recipe for inverse computation.
Lost Secrets of the H-Bridge, Part III: Practical Issues of Inductor and Capacitor Ripple Current
Jason Sachs cuts through the math to show what ripple current actually does to H-bridge hardware. He explains why peak current is the limiting factor for inductors, why capacitor ESR usually dominates DC-link voltage ripple, and how center-aligned PWM and duty selection reduce harmonics and ripple. Read this if you want practical rules of thumb and calculation templates for real power-electronics designs.
The Other Kind of Bypass Capacitor
Most engineers treat bypass capacitors as supply decoupling, but Jason Sachs digs into the other kind: a capacitor placed in the feedback path to tame unpredictable high-frequency plant behavior. He walks through real examples, Bode plots, and a simple RC model to show how the cap forces unity-gain feedback at high frequency, stabilizing switching regulators and wideband amplifiers while revealing the speed versus stability tradeoff.
Oscilloscope Dreams
Jason Sachs walks through practical oscilloscope buying criteria for embedded engineers, focusing on bandwidth, channel count, hi-res acquisition, and probing. He explains why mixed-signal scopes and hi-res mode matter, when a 100 MHz scope is sufficient and when to keep a higher-bandwidth instrument, and how probe grounding and waveform export can ruin measurements. Real-world brand notes and try-before-you-buy advice round out the guidance.
In Memoriam: Frederick P. Brooks, Jr. and The Mythical Man-Month
Fred Brooks’ The Mythical Man-Month is still a surprisingly sharp guide to software projects, and Jason Sachs shows why it matters even more than its old mainframe setting suggests. He revisits Brooks’ ideas on surgical teams, conceptual integrity, throwaway prototypes, and schedule estimation, then maps them to modern embedded and software engineering realities. The result is a tribute, a book review, and a practical reminder that roles, architecture, and testing still make or break delivery.
Lost Secrets of the H-Bridge, Part I: Ripple Current in Inductive Loads
Jason Sachs digs into what PWM switching actually does to current in an H-bridge with an inductive load, and why that ripple matters for motors and power converters. He derives closed-form ripple formulas, shows how to compute a reference current I_R0 = VDC·T/L, and uses Python and sympy to plot and verify results. Read it for practical rules to halve ripple and raise its frequency.
Linear Feedback Shift Registers for the Uninitiated, Part VI: Sing Along with the Berlekamp-Massey Algorithm
Jason Sachs breaks down the Berlekamp-Massey algorithm and shows how to recover an LFSR's minimal connection polynomial from a stream of output bits. The article mixes intuition, worked examples, and Python code to demonstrate the update rule, visual debugging tables, and when the solution is unique. Expect practical implementation notes, a complexity discussion, and a libgf2 example you can run in an IPython notebook.
Isolated Sigma-Delta Modulators, Rah Rah Rah!
Analog isolation can blow up DAQ budgets, but isolated sigma-delta modulators let you send a single 1-bit stream and a clock across the barrier, keeping costs down. Jason walks through Avago, TI, and Analog Devices parts, explains sigma-delta noise shaping in plain terms, and calls out the real engineering work: converting a 10–20 MHz bitstream into usable samples with sinc/CIC decimators or FPGA filtering.
Important Programming Concepts (Even on Embedded Systems) Part IV: Singletons
Singletons are convenient but often a modularity killer, especially in embedded firmware. Jason Sachs walks through the many faces of singletons, from static members and globals to hardware registers and user-visible application singletons, and shows practical ways to avoid tight coupling. Read this for concrete embedded examples and pragmatic fixes like passing state explicitly, using interfaces or factories, and isolating unavoidable globals in a HAL.
Lessons Learned from Embedded Code Reviews (Including Some Surprises)
Jason Sachs recounts a round of motor-controller code reviews and the practical lessons his team learned about quality and tooling. He explains how a simple "ready for review" checklist and automated style checks kept meetings focused on substantive issues, and why choosing the right review tool matters after discovering lost comments in Stash. Read for concrete tips on process, subgit mirroring, vera++, and Upsource.
Someday We’ll Find It, The Kelvin Connection
Low-ohm measurements will fool your multimeter unless you use Kelvin connections. Jason Sachs walks through four-wire sensing using a current-limited supply and two DMMs, explains thermoelectric and connector-related errors, and shows why schematics and PCB layout must reflect Kelvin sense pads to avoid subtle measurement and circuit problems.
The CRC Wild Goose Chase: PPP Does What?!?!?!
Jason Sachs walks through a CRC rabbit hole and explains why ambiguous CRC names and incomplete specs lead to subtle protocol bugs. He demonstrates how XMODEM and KERMIT variants with a zero initial value can miss dropped leading-zero bytes, praises the X.25 standard for providing test vectors and a clear CRC16 definition, and warns that RFCs that ship only sample code are a poor substitute for a proper specification.
Signal Processing Contest in Python (PREVIEW): The Worst Encoder in the World
Jason Sachs previews a hands-on Python contest to find the best velocity estimator for a noisy, low-cost quadrature encoder. The post explains the Estimator API, submission constraints, and a 5 second, 10 kHz evaluation harness that uses a simulated "Lucky Wheel" encoder with realistic manufacturing timing errors. Jason also includes a simple baseline estimator and discusses the practical tradeoff between noise reduction and phase lag in velocity estimation.
First-Order Systems: The Happy Family
Jason Sachs takes the modest topic of first-order systems and makes it useful, showing how RC filters behave in both time and frequency domains and why they all share the same shape. He steps through step, ramp, and sinusoidal responses, explains poles, zeros, and Bode behavior, and uses Python plots to make tracking error and the role of tau easy to visualize.
Donald Knuth Is the Root of All Premature Optimization
Knuth's famous line "premature optimization is the root of all evil" has turned into a blunt rule on forums, Jason Sachs argues, and that overuse masks important nuance. He walks through concrete embedded examples, from dsPIC33E floating-point timings to an ROI analysis in the Kittens Game and a continuous optimization toy problem, to show when to measure, when to speculate, and why profilers can mislead.
Real-time clocks: Does anybody really know what time it is?
Most RTC chips still expose calendar fields rather than seconds-since-epoch, forcing embedded engineers to write ugly conversion code. Jason Sachs makes the case for offset encoding, subseconds, and an explicit snapshot feature to simplify interval math, raise precision, and avoid rare timing bugs. Read this practical take on RTC trade-offs and a short wishlist for chip makers.
Ten Little Algorithms, Part 6: Green’s Theorem and Swept-Area Detection
Jason shows how Green's Theorem becomes a practical, low-cost method to detect real-time rotation from two orthogonal sensors by accumulating swept area. The post derives a compact discrete integrator S[n] = S[n-1] + (x[n]*(y[n]-y[n-1]) - y[n]*(x[n]-x[n-1]))/2, compares integer and floating implementations, and analyzes noise scaling and sampling rate tradeoffs. Includes Python demos and threshold guidance.
Important Programming Concepts (Even on Embedded Systems) Part III: Volatility
Jason Sachs takes volatility out of the basement and into practical embedded programming. He shows why data that can change outside your thread of control breaks assumptions, how the volatile qualifier in C/C++ and Java affects compiler and CPU behavior, and when to prefer shadow registers, locks, or proper concurrency libraries instead of ad hoc volatile usage.
Bad Hash Functions and Other Stories: Trapped in a Cage of Irresponsibility and Garden Rakes
A tiny filename decision in MATLAB's publish() can silently swap rendered equations, and Jason Sachs shows why that matters. He reproduces the bug, walks through hash-function basics and collision math, and contrasts safe and unsafe caching strategies. The piece then broadens into practical lessons about software fringes, legacy constraints, and the usability traps that leave engineers repeatedly stumbling over avoidable design choices.







