<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Gal on Shane&apos;s Personal Blog</title><description>Recent content in Gal on Shane&apos;s Personal Blog</description><link>https://shanechang.com/tags/gal/</link><language>en-us</language><lastBuildDate>Sun, 06 Sep 2026 00:00:00 GMT</lastBuildDate><atom:link href="https://shanechang.com/tags/gal/index.xml" rel="self" type="application/rss+xml"/><item><title>One Wire, Four Decades: How GALs, FPGAs, and Custom Chips Split the Same Job</title><link>https://shanechang.com/p/one-wire-four-decades-gal-fpga-asic/</link><guid isPermaLink="true">https://shanechang.com/p/one-wire-four-decades-gal-fpga-asic/</guid><description>&lt;img src=&quot;https://shanechang.com/_astro/cover.yp2TV8m5_Z1Apj6M.webp&quot; alt=&quot;Featured image of post One Wire, Four Decades: How GALs, FPGAs, and Custom Chips Split the Same Job&quot; /&gt;&lt;h2 id=&quot;a-wire-that-says-you&quot;&gt;A wire that says “you”&lt;/h2&gt;
&lt;p&gt;It is 1985, and there is an engineer at a workbench losing an afternoon to the least glamorous problem in computing.&lt;/p&gt;
&lt;p&gt;Her board is simple enough to describe in a sentence. A processor in the middle. A memory chip on the left holding the program. Another on the right holding whatever the program is currently thinking about. Wires between them, in parallel, so that when the processor announces an address, &lt;em&gt;both&lt;/em&gt; chips hear it at exactly the same moment.&lt;/p&gt;
&lt;p&gt;Which is the problem. Both of them heard it. Only one of them was being spoken to.&lt;/p&gt;
&lt;p&gt;So somebody has to sit between the processor and the memory and tap the correct chip on the shoulder. The rule is not complicated. She could say it out loud in one breath: &lt;em&gt;if the address is in the upper half of memory, and the processor is asking to read, wake up the chip on the left.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;One sentence. One signal. That’s the entire job.&lt;/p&gt;
&lt;p&gt;And in 1985, building that one sentence costs her a corner of the board.&lt;/p&gt;
&lt;h2 id=&quot;the-sea-of-little-chips&quot;&gt;The sea of little chips&lt;/h2&gt;
&lt;p&gt;Look at a circuit board from that era and you’ll notice something odd once you know to look for it. Past the big, important, expensive components — the processor, the memory, the thing the board is famously &lt;em&gt;for&lt;/em&gt; — there is a scattering of small identical black rectangles with fourteen legs each. A dozen of them. Sometimes thirty.&lt;/p&gt;
&lt;p&gt;None of them do anything you would put on the box. They are the 7400 series, and each one contains a few of the simplest possible operations. One chip holds four AND gates. Another holds four ORs. Another holds six inverters, whose entire life’s work is turning a high signal into a low one.&lt;/p&gt;
&lt;p&gt;To build her one-sentence rule, she needs a few gates from this chip and a couple from that one and an inverter from a third. Every one of them is a physical object. Each needs a footprint on the board, a path routed to it, solder on twenty-eight joints, and a small continuous sip of power for as long as the machine is switched on. Engineers called this stuff &lt;em&gt;glue logic&lt;/em&gt; — the connective tissue holding the interesting parts together — and it is telling that the name is faintly dismissive. Nobody was proud of it. It was overhead you paid because the alternative was nothing.&lt;/p&gt;
&lt;p&gt;The real cost, though, wasn’t board space. It was what happened when she got the sentence wrong.&lt;/p&gt;
&lt;p&gt;Because the sentence is now made of copper. It exists as a physical path etched into the board, and changing it means changing the board. So she takes a hobby knife, finds the trace that shouldn’t be there, and cuts it — a small deliberate act of vandalism against something that took six weeks and a factory to produce. Then she solders a wire across the top of the board to the place the signal should have gone instead. In the trade this is a &lt;em&gt;bodge wire&lt;/em&gt;, and a board carrying two or three of them looks exactly like what it is: a patient, stitched up, walking around with the scar showing.&lt;/p&gt;
&lt;p&gt;Every logic mistake was a physical wound. That is the world the next chip walked into.&lt;/p&gt;
&lt;h2 id=&quot;the-chip-that-hasnt-decided-yet&quot;&gt;The chip that hasn’t decided yet&lt;/h2&gt;
&lt;p&gt;It looks like nothing. Twenty legs, a black body, about the size of your thumbnail. Today you can buy one for less than a dollar.&lt;/p&gt;
&lt;p&gt;Inside a GAL — Generic Array Logic — there is a grid of connections, and at every intersection of that grid, a fuse. Not blown, not set, not anything yet. The chip leaves the factory having decided nothing at all about what it does. It is a page of blank staff paper. Whether it ends up decoding addresses or generating a clock or sitting between two chips translating one protocol to another is not a fact about the chip. It’s a fact about what you tell it.&lt;/p&gt;
&lt;p&gt;And you tell it in text. Not with a soldering iron — with a line that looks like this:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light-default github-dark-default&quot; style=&quot;background-color:#ffffff;--shiki-dark-bg:#0d1117;color:#1f2328;--shiki-dark:#e6edf3; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;/RAMS = /MREQ * A15&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Which is the same sentence she said out loud at the workbench, written in a form a machine can consume. &lt;em&gt;Pull the RAM’s select line low when the processor is talking to memory and the top address bit is high.&lt;/em&gt; You compile it, push the resulting pattern into the chip through a programmer, drop it in its socket, and the sentence is now true.&lt;/p&gt;
&lt;p&gt;The chip count falls off a cliff. One builder restoring a 68000 machine replaced his entire discrete address decoder with a single GAL and deleted &lt;strong&gt;eight chips&lt;/strong&gt; from the board — space, power, solder joints, and a bug in the original decoder, all gone at once. A PDP-11 single-board project found six TTL chips simply never needed to be installed. And the GALs were &lt;em&gt;faster&lt;/em&gt; than the parts they replaced, propagating a signal in about fifteen nanoseconds where the older logic dawdled.&lt;/p&gt;
&lt;p&gt;But the number that mattered wasn’t eight. It was this: the fuses are erasable.&lt;/p&gt;
&lt;p&gt;Get the logic wrong now and there is no knife. There is no wire soldered across the board, no scar, no six-week wait. You pull the chip, rewrite one line, reprogram it, and put it back. The mistake costs seconds.&lt;/p&gt;
&lt;p&gt;Something quietly enormous happened there, and it’s worth naming plainly, because everything that follows is a variation on it: &lt;strong&gt;the shape of the hardware stopped being decided at the factory.&lt;/strong&gt; It got postponed, and handed to the person holding the board.&lt;/p&gt;
&lt;p&gt;That’s it. That’s the whole idea. Everything after this is the same idea with more zeroes.&lt;/p&gt;
&lt;h2 id=&quot;the-same-idea-grown-until-its-frightening&quot;&gt;The same idea, grown until it’s frightening&lt;/h2&gt;
&lt;p&gt;So postpone more.&lt;/p&gt;
&lt;p&gt;Don’t stop at one small sentence of logic. Put down thousands of tiny blank logic elements, arrange them in a grid across the whole chip, and — this is the part that matters — leave the &lt;em&gt;wiring between them&lt;/em&gt; undecided too. Not just blank gates. A blank city, with blank streets.&lt;/p&gt;
&lt;p&gt;That’s an FPGA: a Field-Programmable Gate Array. Field-programmable, meaning the decision happens out in the world, after the chip has been manufactured, packaged, sold, shipped, and soldered down. Instead of the GAL’s handful of fuses, there are millions of switches, and they’re set by a file — a &lt;em&gt;bitstream&lt;/em&gt; — loaded in at power-up from a small flash chip sitting next to it.&lt;/p&gt;
&lt;p&gt;Which produces a genuinely strange property. Cut the power and an FPGA forgets everything. It reverts to a blank field. Every single time the machine turns on, the chip has to be told again what it is.&lt;/p&gt;
&lt;p&gt;And the thing you can tell it is no longer one sentence. It’s an entire signal processing pipeline, or a video encoder, or a network switch, or — routinely — a working processor, because a processor is only a very large arrangement of gates and there is nothing stopping you from arranging them.&lt;/p&gt;
&lt;p&gt;The reason anyone pays for this isn’t size, though. It’s &lt;em&gt;shape&lt;/em&gt;. A normal processor is brilliant and fundamentally single-file: it does one thing, then the next thing, then the next, very fast. An FPGA doesn’t do things in order, because it isn’t running instructions. It has been physically arranged into the answer. Every part of it operates at once, because every part of it is a separate piece of circuitry that exists simultaneously. When you need to do the same operation to ten thousand incoming values in the same instant, you don’t want a faster reader. You want ten thousand hands.&lt;/p&gt;
&lt;h3 id=&quot;a-concrete-case-140-million-miles-away&quot;&gt;A concrete case, 140 million miles away&lt;/h3&gt;
&lt;p&gt;In February 2021, NASA’s Perseverance rover fell through the Martian atmosphere with a camera pointed at the ground, comparing what it saw against a map stored onboard, working out where it was and whether the ground below was survivable. It had seconds. Nobody on Earth could help — the round-trip radio delay is longer than the entire descent.&lt;/p&gt;
&lt;p&gt;The rover’s main flight computer, a radiation-hardened processor built to survive space rather than to be quick, needs about &lt;strong&gt;180 seconds&lt;/strong&gt; to process a pair of stereo images. The FPGA card sitting beside it does the same work in about &lt;strong&gt;1.5 seconds&lt;/strong&gt;. That gap is the difference between a landing system and a very expensive rock.&lt;/p&gt;
&lt;p&gt;Then comes the part that makes the whole idea click.&lt;/p&gt;
&lt;p&gt;After the rover was safely down, the descent was over. The landing logic had done its job and would never be needed again. So they reprogrammed the chip. The same physical silicon that had guided Perseverance through the sky was rearranged, on the surface of another planet, into a system that helps it look at the terrain ahead and decide where to drive.&lt;/p&gt;
&lt;p&gt;One chip. Two completely different machines. The second one didn’t exist until after the first one had finished.&lt;/p&gt;
&lt;p&gt;That is the workbench engineer’s erasable fuse, carried to its absolute conclusion.&lt;/p&gt;
&lt;h2 id=&quot;and-yet-the-phone-in-your-pocket-does-none-of-this&quot;&gt;And yet the phone in your pocket does none of this&lt;/h2&gt;
&lt;p&gt;Here’s the turn.&lt;/p&gt;
&lt;p&gt;Take that same humble job — &lt;em&gt;wake up the right chip&lt;/em&gt; — and go looking for it inside a modern phone. It’s in there. Some equivalent of that 1985 sentence is being evaluated billions of times a second in the device you’re probably reading this on.&lt;/p&gt;
&lt;p&gt;It is not in a GAL. It is not in an FPGA. It is etched permanently into a custom chip, decided once, at a factory, and it will never change for as long as the phone exists.&lt;/p&gt;
&lt;p&gt;That chip is an ASIC — an Application-Specific Integrated Circuit — and by every measure we’ve used so far it’s the &lt;em&gt;worst&lt;/em&gt; option. Zero flexibility. A logic error isn’t a bodge wire or a rewrite, it’s a recall. The design is frozen years before the product ships.&lt;/p&gt;
&lt;p&gt;And it costs about two dollars to make.&lt;/p&gt;
&lt;p&gt;So why isn’t everything an ASIC? If permanent silicon is that cheap, why did anyone ever bother with a chip that forgets itself every time you unplug it?&lt;/p&gt;
&lt;h2 id=&quot;the-number-hiding-behind-the-two-dollars&quot;&gt;The number hiding behind the two dollars&lt;/h2&gt;
&lt;p&gt;Because the two dollars is only the price of the &lt;em&gt;next&lt;/em&gt; one.&lt;/p&gt;
&lt;p&gt;Before a single ASIC exists, someone has to design it, verify it exhaustively, license the building blocks, and — the brutal part — manufacture a set of photomasks, the physical stencils used to print the pattern onto silicon. At a modern process node a mask set alone runs somewhere in the region of ten to forty million dollars. Full design programs at the leading edge get quoted in the hundreds of millions, though it’s worth saying honestly that those headline figures are contested; several chip startups have reportedly gotten advanced-node designs done for a small fraction of them. The exact number is genuinely arguable. The shape of it isn’t.&lt;/p&gt;
&lt;p&gt;Engineers have a name for money like this, and it’s the most useful piece of vocabulary in this entire post: &lt;strong&gt;NRE&lt;/strong&gt;, for Non-Recurring Engineering. It’s the cost you pay &lt;em&gt;once&lt;/em&gt;, before anything exists, regardless of whether you go on to build one unit or a billion.&lt;/p&gt;
&lt;p&gt;The rest of the industry stops being confusing the moment you hold NRE and per-unit cost in your head at the same time:&lt;/p&gt;





























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;Cost before unit one&lt;/th&gt;&lt;th&gt;Cost per unit&lt;/th&gt;&lt;th&gt;Flexible after shipping?&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Loose gates / GAL&lt;/td&gt;&lt;td&gt;Essentially nothing&lt;/td&gt;&lt;td&gt;Cents&lt;/td&gt;&lt;td&gt;Yes, trivially&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;FPGA&lt;/td&gt;&lt;td&gt;Engineering time only&lt;/td&gt;&lt;td&gt;$20 to $20,000 — forever&lt;/td&gt;&lt;td&gt;Yes, even remotely&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Custom silicon (ASIC)&lt;/td&gt;&lt;td&gt;Millions to hundreds of millions&lt;/td&gt;&lt;td&gt;A couple of dollars&lt;/td&gt;&lt;td&gt;No&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Now do the arithmetic, and watch it decide things you thought were engineering decisions.&lt;/p&gt;
&lt;p&gt;Spend fifty million dollars in NRE and ship two hundred million phones, and you’ve added twenty-five cents to each one. You’d be irrational &lt;em&gt;not&lt;/em&gt; to. Every dollar you shave off the per-unit cost gets multiplied by two hundred million, and the upfront number disappears into the noise.&lt;/p&gt;
&lt;p&gt;Now spend that same fifty million and ship forty units. You’ve added more than a million dollars to each one. And you’ve bought yourself a permanent, unfixable design, in a product line that will be superseded before you’ve recovered the cost.&lt;/p&gt;
&lt;p&gt;Forty is not a hypothetical. In 2024, ASML — the company with an effective monopoly on the machines that print the world’s most advanced chips — sold forty-four of its extreme-ultraviolet lithography systems. The newest generation costs roughly $380 million each. These are arguably the most complex machines humans have ever assembled, they are the bottleneck of the entire semiconductor industry, and they are built in quantities you could park in a supermarket lot.&lt;/p&gt;
&lt;p&gt;At that volume, a ten-thousand-dollar flexible chip isn’t extravagant. It’s a rounding error against the machine it lives in — and it can be improved by a firmware update instead of a factory.&lt;/p&gt;
&lt;p&gt;Which lands somewhere genuinely counterintuitive: some of the most expensive, most advanced hardware on Earth contains &lt;em&gt;less&lt;/em&gt; custom silicon than a mid-range phone. Not because the people building it couldn’t. Because they did the multiplication.&lt;/p&gt;
&lt;h2 id=&quot;the-curve-youve-already-been-standing-on&quot;&gt;The curve you’ve already been standing on&lt;/h2&gt;
&lt;p&gt;So the four bodies of that one small signal were never four steps of progress, with the newest being best. They’re four correct answers to four different questions, and the question was never &lt;em&gt;what’s the most sophisticated way to do this?&lt;/em&gt; It was always &lt;strong&gt;how many times is this going to get built?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Volume decides the silicon. Not cleverness. Not budget, even. Volume.&lt;/p&gt;
&lt;p&gt;And here’s the part worth carrying out of the workshop, because this curve does not stay in hardware.&lt;/p&gt;
&lt;p&gt;Every time you decide whether to spend a morning automating something or just do it by hand, you’re pricing NRE against volume. Automating is the ASIC: expensive once, then nearly free forever. Doing it by hand is the FPGA — no setup cost, and you pay again every single time. If the task recurs daily for two years, you’d be foolish not to build the tool. If it happens twice, building the tool &lt;em&gt;is&lt;/em&gt; the expensive mistake, no matter how elegant it would have been.&lt;/p&gt;
&lt;p&gt;Rent infrastructure or run your own. Pull in the framework or hand-roll the thing you actually need. Write the abstraction now or copy-paste it three more times and see if a pattern emerges. Same curve. Same two variables. Every time.&lt;/p&gt;
&lt;p&gt;The reason people get these decisions wrong usually isn’t that they can’t do the arithmetic. It’s that they never noticed there was arithmetic to do — that upfront cost and repeated cost are different animals, and that the crossover between them is a real point you could actually locate if you sat down and estimated the volume.&lt;/p&gt;
&lt;p&gt;The engineer in 1985 couldn’t have known any of this yet. She just wanted one wire to say “you” to the right chip, and she was willing to cut her own board open to make it happen.&lt;/p&gt;
&lt;p&gt;Forty years later, the wire still says the same thing. Only the price of changing its mind has moved.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Disclaimer: Written by Human, improved using AI where applicable.&lt;/em&gt;&lt;/p&gt;</description><pubDate>Sun, 06 Sep 2026 00:00:00 GMT</pubDate></item></channel></rss>