## Linear Feedback Shift Registers for the Uninitiated, Part VI: Sing Along with the Berlekamp-Massey Algorithm

October 18, 2017

The last two articles were on discrete logarithms in finite fields — in practical terms, how to take the state $S$ of an LFSR and its characteristic polynomial $p(x)$ and figure out how many shift steps are required to go from the state 000...001 to $S$. If we consider $S$ as a polynomial bit vector such that $S = x^k \bmod p(x)$, then this is equivalent to the task of figuring out $k$ from $S$ and $p(x)$.

This time we’re tackling something...

## Linear Feedback Shift Registers for the Uninitiated, Part V: Difficult Discrete Logarithms and Pollard's Kangaroo Method

October 1, 2017

Last time we talked about discrete logarithms which are easy when the group in question has an order which is a smooth number, namely the product of small prime factors. Just as a reminder, the goal here is to find $k$ if you are given some finite multiplicative group (or a finite field, since it has a multiplicative group) with elements $y$ and $g$, and you know you can express $y = g^k$ for some unknown integer $k$. The value $k$ is the discrete logarithm of $y$...

## Linear Feedback Shift Registers for the Uninitiated, Part IV: Easy Discrete Logarithms and the Silver-Pohlig-Hellman Algorithm

September 16, 2017

Last time we talked about the multiplicative inverse in finite fields, which is rather boring and mundane, and has an easy solution with Blankinship’s algorithm.

Discrete logarithms, on the other hand, are much more interesting, and this article covers only the tip of the iceberg.

What is a Discrete Logarithm, Anyway?

Regular logarithms are something that you’re probably familiar with: let’s say you have some number $y = b^x$ and you know $y$ and $b$ but...

## Linear Feedback Shift Registers for the Uninitiated, Part III: Multiplicative Inverse, and Blankinship's Algorithm

September 9, 2017

Last time we talked about basic arithmetic operations in the finite field $GF(2)[x]/p(x)$ — addition, multiplication, raising to a power, shift-left and shift-right — as well as how to determine whether a polynomial $p(x)$ is primitive. If a polynomial $p(x)$ is primitive, it can be used to define an LFSR with coefficients that correspond to the 1 terms in $p(x)$, that has maximal length of $2^N-1$, covering all bit patterns except the all-zero...

## Tenderfoot: Embedded Software and Firmware Specialties

Once upon a time (seven years ago) I answered a question on Stack Overflow. Then Stephane suggested I turn that answer into a blog post. Great idea! This post dives deeper into the original question: “Is it possible to fragment this field (embedded software and firmware) into sub-fields?”

This post represents a detailed and updated response to my original Stack Overflow answer. I hope this post provides guidance and useful information to the “tenderfoots” in the...

## Linear Feedback Shift Registers for the Uninitiated, Part II: libgf2 and Primitive Polynomials

July 17, 2017

Last time, we looked at the basics of LFSRs and finite fields formed by the quotient ring $GF(2)[x]/p(x)$.

LFSRs can be described by a list of binary coefficients, sometimes referred as the polynomial, since they correspond directly to the characteristic polynomial of the quotient ring.

Today we’re going to look at how to perform certain practical calculations in these finite fields. I maintain a Python library on bitbucket called...

## Linear Feedback Shift Registers for the Uninitiated, Part I: Ex-Pralite Monks and Finite Fields

July 3, 20171 comment

Later there will be, I hope, some people who will find it to their advantage to decipher all this mess.

— Évariste Galois, May 29, 1832

I was going to call this short series of articles “LFSRs for Dummies”, but thought better of it. What is a linear feedback shift register? If you want the short answer, the Wikipedia article is a decent introduction. But these articles are aimed at those of you who want a little bit deeper mathematical understanding,...

## How to Succeed in Motor Control: Olaus Magnus, Donald Rumsfeld, and YouTube

December 12, 2016

Almost four years ago, I had this insight — we were doing it wrong! Most of the application notes on motor control were about the core algorithms: various six-step or field-oriented control methods, with Park and Clarke transforms, sensorless estimators, and whatnot. It was kind of like a driving school would be, if they taught you how the accelerator and brake pedal worked, and how the four-stroke Otto cycle works in internal combustion engines, and handed you a written...

## Scorchers, Part 1: Tools and Burn Rate

This is a short article about one aspect of purchasing, for engineers.

I had an engineering manager once — I’ll leave his real name out of it, but let’s call him Barney — who had a catchy response to the question “Can I buy XYZ?”, where XYZ was some piece of test equipment, like an oscilloscope or multimeter. Barney said, “Get what you need, need what you get.” We used purchase orders, which when I started in 1996 were these quaint forms on...

## Margin Call: Fermi Problems, Highway Horrors, Black Swans, and Why You Should Worry About When You Should Worry

December 6, 20151 comment

“Reports that say that something hasn’t happened are always interesting to me, because as we know, there are known knowns; there are things we know that we know. There are known unknowns; that is to say, there are things that we now know we don’t know. But there are also unknown unknowns — there are things we do not know we don’t know.” — Donald Rumsfeld, February 2002

Today’s topic is engineering margin.

XKCD had a what-if column involving Fermi...

## My Love-Hate Relationship with Stack Overflow: Arthur S., Arthur T., and the Soup Nazi

Warning: In the interest of maintaining a coherent stream of consciousness, I’m lowering the setting on my profanity filter for this post. Just wanted to let you know ahead of time.

I’ve been a user of Stack Overflow since December of 2008. And I say “user” both in the software sense, and in the drug-addict sense. I’m Jason S, user #44330, and I’m a programming addict. (Hi, Jason S.) The Gravatar, in case you were wondering, is a screen...

## Levitating Globe Teardown, Part 2

Part 1 of this article was really more of an extended (and cynical) product review.  In this part of the article, I actually take things apart (sometimes a bit more suddenly than I meant to) and show you some innards.First the globe.  I knew there was a magnet in there someplace, because it's obviously plastic and it also attracts metal.  I had intended to gently part the globe at the glue bond along the equator.  I started by trying to gently flex the thing on my work...

## Basic hand tools for electronics assembly

Though the software tools vary with different microcontrollers, many hardware tools are the same.

If you are working on larger robotic or automotive systems, you will need a 3/8" and 1/2" drive socket set. There are occasions when even larger drive socket sets are needed. For small robots and taking things apart, the 1/4" drive socket set is useful. The sizes usually range from 5/32" to 9/16" and 4mm to 15mm.  You will need both shallow and deep sockets, both standard and...

## How to Include MathJax Equations in SVG With Less Than 100 Lines of JavaScript!

Today’s short and tangential note is an account of how I dug myself out of Documentation Despair. I’ve been working on some block diagrams. You know, this sort of thing, to describe feedback control systems:

And I had a problem. How do I draw diagrams like this?

I don’t have Visio and I don’t like Visio. I used to like Visio. But then it got Microsofted.

I can use MATLAB and Simulink, which are great for drawing block diagrams. Normally you use them to create a...

## Tenderfoot: Embedded Software and Firmware Specialties

Once upon a time (seven years ago) I answered a question on Stack Overflow. Then Stephane suggested I turn that answer into a blog post. Great idea! This post dives deeper into the original question: “Is it possible to fragment this field (embedded software and firmware) into sub-fields?”

This post represents a detailed and updated response to my original Stack Overflow answer. I hope this post provides guidance and useful information to the “tenderfoots” in the...

## Oh Robot My Robot

June 26, 2015

Oh Robot! My Robot! You’ve broken off your nose! Your head is spinning round and round, your eye no longer glows, Each program after program tapped your golden memory, You used to have 12K, now there is none that I can see,  Under smoldering antennae,   Over long forgotten feet,    My sister used your last part:      The chip she tried to eat.

Oh Robot, My Robot, the remote controls—they call, The call—for...

## Levitating Globe Teardown, Part 1

I've been kicking some ideas around for a long time for a simple and inexpensive platform I could use for control systems experimentation for the beginner.  I want something that can be controlled easily in a basic fashion, yet that provides some depth: I want to be able to present ever-more challenging goals to the student, that can be attained by fancier control algorithms all on the same device.

I'm currently looking at magnetic levitation.  It's fun, it has the potential to be...

## Margin Call: Fermi Problems, Highway Horrors, Black Swans, and Why You Should Worry About When You Should Worry

December 6, 20151 comment

“Reports that say that something hasn’t happened are always interesting to me, because as we know, there are known knowns; there are things we know that we know. There are known unknowns; that is to say, there are things that we now know we don’t know. But there are also unknown unknowns — there are things we do not know we don’t know.” — Donald Rumsfeld, February 2002

Today’s topic is engineering margin.

XKCD had a what-if column involving Fermi...