## Linear Feedback Shift Registers for the Uninitiated, Part IX: Decimation, Trace Parity, and Cyclotomic Cosets

Last time we looked at matrix methods and how they can be used to analyze two important aspects of LFSRs:

- time shifts
- state recovery from LFSR output

In both cases we were able to use a finite field or bitwise approach to arrive at the same result as a matrix-based approach. The matrix approach is more expensive in terms of execution time and memory storage, but in some cases is conceptually simpler.

This article will be covering some concepts that are useful for studying the...

## Linear Feedback Shift Registers for the Uninitiated, Part VIII: Matrix Methods and State Recovery

Last time we looked at a dsPIC implementation of LFSR updates. Now we’re going to go back to basics and look at some matrix methods, which is the third approach to represent LFSRs that I mentioned in Part I. And we’re going to explore the problem of converting from LFSR output to LFSR state.

Matrices: Beloved Historical DregsElwyn Berlekamp’s 1966 paper Non-Binary BCH Encoding covers some work on

## Linear Feedback Shift Registers for the Uninitiated, Part VII: LFSR Implementations, Idiomatic C, and Compiler Explorer

The last four articles were on algorithms used to compute with finite fields and shift registers:

- multiplicative inverse
- discrete logarithm
- determining characteristic polynomial from the LFSR output

Today we’re going to come back down to earth and show how to implement LFSR updates on a microcontroller. We’ll also talk a little bit about something called “idiomatic C” and a neat online tool for experimenting with the C compiler.

## Lazy Properties in Python Using Descriptors

This is a bit of a side tangent from my normal at-least-vaguely-embedded-related articles, but I wanted to share a moment of enlightenment I had recently about descriptors in Python. The easiest way to explain a descriptor is a way to outsource attribute lookup and modification.

Python has a bunch of “magic” methods that are hooks into various object-oriented mechanisms that let you do all sorts of ridiculously clever things. Whether or not they’re a good idea is another...

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

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

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

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

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

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 called libgf2,...

## 3D printing for embedded development

Used mostly for creating little plastic objects, the desktop 3D printer is not an obvious addition to the embedded developer's toolbox. However, if you're looking for more reasons to get one, or already have one that's mostly gathering dust, here are a couple of embedded-related ways to get more value out of it.

## Basic hand tools for electronics assembly

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

## Supply Chain Games: What Have We Learned From the Great Semiconductor Shortage of 2021? (Part 1)

So by now I’m sure you’ve heard about the semiconductor shortage of 2021. For a few complicated reasons, demand is greater than supply, and not everybody who wants to buy integrated circuits can do so. Today we’re going to try to answer some hard questions:

- Why are we in the middle of a semiconductor shortage?
- Why is it taking so long to get my [insert part number here]?
- Did this shortage suddenly sneak up on everybody? If not, what were the signs, and why...

## Reading and Understanding Profitability Metrics from Financial Statements

Whoa! That has got to be the most serious-minded title I’ve ever written. Profitability Metrics from Financial Statements, indeed. I’m still writing Part 2 of my Supply Chain Games article, and I was about to mention something about whether a company is profitable, when I realized something that didn’t quite fit into the flow of things, so I thought I’d handle it separately: how are you supposed to know what I mean, when I say a company is profitable? And how am I...

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

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 called libgf2,...

## Supply Chain Games: What Have We Learned From the Great Semiconductor Shortage of 2021? (Part 4)

Today we’re going to look at what’s been going on this past year in the chip shortage, particularly in the automotive markets. I’m going to share some recent events and statements that may shed some light on what’s been happening.

In Part Three we went through a deep dive on some aspects of Moore’s Law, the semiconductor foundries, and semiconductor economics, and we looked at the game Supply Chain Idle. We touched on a couple of important points about the...

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

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...

## Getting Started With CUDA C on an Nvidia Jetson: A Meaningful Algorithm

In this blog post, I demonstrate a use case and corresponding GPU implementation where meaningful performance gains are realized and observed. Specifically, I implement a "blurring" algorithm on a large 1000x1000 pixel image. I show that the GPU-based implementation is 1000x faster than the CPU-based implementation.

## Linear Feedback Shift Registers for the Uninitiated, Part XI: Pseudorandom Number Generation

Last time we looked at the use of LFSRs in counters and position encoders.

This time we’re going to look at pseudorandom number generation, and why you may — or may not — want to use LFSRs for this purpose.

But first — an aside:

Science Fair 1983When I was in fourth grade, my father bought a Timex/Sinclair 1000. This was one of several personal computers introduced in 1982, along with the Commodore 64. The...

## 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...

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

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...

## Supply Chain Games: What Have We Learned From the Great Semiconductor Shortage of 2021? (Part 4)

Today we’re going to look at what’s been going on this past year in the chip shortage, particularly in the automotive markets. I’m going to share some recent events and statements that may shed some light on what’s been happening.

In Part Three we went through a deep dive on some aspects of Moore’s Law, the semiconductor foundries, and semiconductor economics, and we looked at the game Supply Chain Idle. We touched on a couple of important points about the...

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

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...

## Supply Chain Games: What Have We Learned From the Great Semiconductor Shortage of 2021? (Part 1)

So by now I’m sure you’ve heard about the semiconductor shortage of 2021. For a few complicated reasons, demand is greater than supply, and not everybody who wants to buy integrated circuits can do so. Today we’re going to try to answer some hard questions:

- Why are we in the middle of a semiconductor shortage?
- Why is it taking so long to get my [insert part number here]?
- Did this shortage suddenly sneak up on everybody? If not, what were the signs, and why...

## Supply Chain Games: What Have We Learned From the Great Semiconductor Shortage of 2021? (Part 5)

In this article we’re going to take a look at cycle time, queues, and inventory. Cycle time is a manufacturing term — for anything, not just semiconductors — meaning how long it takes for an individual product to make its way through a manufacturing process, from start to finish. We’re going to try to understand how long it takes to manufacture semiconductors. In particular, we’re going to try to answer these questions:

- How long does it take...

## Oh Robot My Robot

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...

## Linear Feedback Shift Registers for the Uninitiated, Part X: Counters and Encoders

Last time we looked at LFSR output decimation and the computation of trace parity.

Today we are starting to look in detail at some applications of LFSRs, namely counters and encoders.

CountersI mentioned counters briefly in the article on easy discrete logarithms. The idea here is that the propagation delay in an LFSR is smaller than in a counter, since the logic to compute the next LFSR state is simpler than in an ordinary counter. All you need to construct an LFSR is

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

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...

## A Wish for Things That Work

As the end of the year approaches, I become introspective. This year I am frustrated by bad user interfaces in software.

Actually, every year, throughout the year, I am frustrated by bad user interfaces in software. And yet here it is, the end of 2017, and things aren’t getting much better! Argh!

I wrote about this sort of thing a bit back in 2011 (“Complexity in Consumer Electronics Considered Harmful”) but I think it’s time to revisit the topic. So I’m...