Hacker News new | past | comments | ask | show | jobs | submit login
Reverse-engineering a tiny 1980s chip that plays Christmas tunes (righto.com)
310 points by picture on Dec 25, 2021 | hide | past | favorite | 64 comments



Back in 1980 when I was working on my Masters in EE, my capstone project was a chip that would play music. The problem was; that back then, the amount of ROM you could fabricate (at least at our facility) was limited to about 1K at best.

I decided to take a music class to learn a little more about music and thought that would help me with my project. The professor would play various classical pieces and lecture about them. Our homework was to go in a listening room and familiarize ourselves with the music. Everything was on vinyl so you would put a record on, listen, take notes etc.

When the first exam came, the professor would take out a record, and place it on a turntable and play a piece and you were supposed to identify it. I was amazed that all the other students seemed to be getting all of them and I was struggling. I went to the professor's office hours and I explained to him my project and what I was working on. He was very intrigued and suggested that I consider Bach especially Fugue's which has a lot of repetition and cycles (good advice I ended up using Bach Toccata Fugue in D minor, which is used a lot in old timey horror movies and I just loved it).

Later, after talking with other students, they showed me their "system" which was crib notes with things written on them like "Blue label with yellow text = Bethoven", things like that. In other words, they were cheating. They were making crib notes about the record labels in the listening room and paying no attention whatsoever to the music.

Since the professor was so nice to me, I decided to tell him about it. He listened to what I said, and he just said "I see", then asked me about my project. He asked if he could come when I presented my project and I was thrilled he was interested.

But he seemed to continue to use the records and the same method, until the final exam when he announced to the class he was going to use a new system, a Tape Deck! You could hear an audible gasp in the classroom. Needless to say, a lot of students did not do so well on the final. I got an A.

I also got an A on my capstone and the EE professors were all very impressed I had taken the time to research the music and my music professor got up and said a few words for me. It was a really cool experience in my life. I hope it is OK that I shared such a long boring story, but every time I see something about a music chip like the kind in greeting cards or whatever, it kind of reminds me a little of my project and how much I enjoyed that experience.

As for the technology of the chip Ken covered, it is of course, quite a bit more sophisticated than mine was, at least as memory serves me (pun intended).


I wish I read more touching stories like this on HN. These are the stories that bring meaning to life. Keep on remembering and keep on sharing. Have a wonderful Christmas holiday.


Thank you so much,

And just a quick aside, Thanks to Ken for what he does, obviously I ravishly read everything he does!


This was such a good story that I read it aloud to a completely non-techie loved one, and we both got some joy from it. Thank for the Christmas gift, friend.


Oh, that is wonderful to hear.

Please have a wonderful Holiday!


Thanks a bunch for this story! I really like the way you used your music class for research.

If you don't mind me asking- What sort of things are you doing now? Are you able to do much R&D?


After I received my PhD I worked at Bell Labs for a while and did several different things and now I am a Distinguished Research Fellow at a large telcom company and I have many patents and interesting inventions mostly around antenna technology.

I still love music, especially Jazz and find inspiration from it at times.

Thank you for asking.

Happy Holiday !


Well congratulations on a very cool career. I often lament the fact that there is no more Bell Labs. I try to promote that concept at my company knowing that I am just tilting at windmills. Happy Holidays!


> I hope it is OK that I shared such a long boring story

Definitely okay. I found this story absolutely delightful. Thanks for sharing, and happy holidays!


Thank you. And you too, enjoy the holiday :)


You really designed a chip at uni? I think mine uni was a rip off then.


Oh no, if you did it then it was not a rip off. As long as you learned from it then it was awesome!

Have a wonderful Holiday!


Thank you for sharing this story! I really enjoyed it!


Well written! That was fun read.


Thank you so much


Author here if anyone has questions about the chip...


The block-diagram level breakdown of the different sections of silicon is really a wonderfully helpful way to look at this. It makes the zoomed in view of each section more meaningful. Then seeing the die photo of individual transistors or groups of them, next to schematic level interpretation, really drives it home. Thanks for making something so instructive.

Have you decapped other sound-making devices? The greeting card chip makes me think of the ubiquitous "laser noise" chip from countless 80's kids toys. That or one of the many kid's keyboards or baby noise console devices, that have all of the function inside a single epoxy-blobbed die. It would be pretty fascinating to see a similar breakdown of which sections encode samples, note values, rhythm and sequences, control inputs, etc.


Your description immediately made me think of the TI SN76577 "Complex Sound Generator" IC [1]. If I'm not mistaken it was used in the early versions of the MB Games Electronic Battleship game (think falling missile and white-noise explosion sounds).

Edit: Not a decap, but this page [2] has links to the datasheet and other reference material that includes a block diagram, and even has circuit diagrams of the internal circuitry.

Edit 2: A video [3] demonstrating some of the possible sounds.

[1] https://en.wikipedia.org/wiki/Texas_Instruments_SN76477 [2] http://sandsoftwaresound.net/sn76477-complex-sound-generator... [3] https://www.youtube.com/watch?v=atH1MvXDYYE


Coincidentally, I've written about that chip :-) http://www.righto.com/2017/04/reverse-engineering-76477-spac...


Nice!


One of my earliest memories is my grandmother giving me a musical christmas card that played a medley of Jingle Bells and Santa Claus is Coming to Town. I thought it was the cutest thing ever. This had to have been it. Thank you so much for reminding me of this old memory on Christmas. :)


I’ve been following your blog for a while and just wanted to thank you for your work. Keep it up! :)


Is it possible that your "Structure of an inverter" image is mislabed? NMOS would be on the left and PMOS on the right. My thinking is the PMOS has the extra diffusion step to create the n-well for the channel under the gate.


It's quite possible that they are reversed; I'm sort of guessing. PMOS transistors are usually bigger, so I think it's the one on the left. The chip could have n-wells or p-wells, so it could go either way with the extra diffusion.


Can boiling sulfuric acid like you used to dissolve the epoxy package be used to successfully de-bayer a CMOS camera sensor?


You'd think someone would have a service dedicated to this, but I've wanted a monochrome dslr or mirrorless for like a decade and a half, already.

Preferably Nikon, but my limited understanding is that the canon sensors are easier to debayer.


Crazy thing is you can buy the same sensors monochrome for industrial and astro applications but the cameras are twice as expensive.

Eg Sony IMX455 61MP sensor in the $4k ASI6200: https://astronomy-imaging-camera.com/product/asi6200mm-pro-m...


The cheapest I have seen an IMX455 in a new camera is $3000 for the Sony A7RIV when it’s on sale. And that doesn’t have a lens. Once one has a couple of lenses, a case, a tripod, filters, and memory cards, we’re in the $5000 ballpark.

The IMX455 is an incredible hi end sensor; there’s only about three medium format sensors that exist with higher resolution—forget getting one of those for “only” $5000—but the cost of entry to have one in a usable camera is pretty substantial.


Maybe; I haven't tried that. I don't know what the Bayer layer is made of; if it's glass, you'd need HF or something nasty.


What is the "options" section in the block diagram? Does that represent the debug functionality you mention on unexposed pins? Anything else interesting that someone could do with these chips in a different package?


> The chip has 3 pins, but there are 8 pads on the die. The other pins appear to be used for testing. By activating one of the pins, the chip can be put into a test mode. The test mode runs through the songs at 512× speed so the chip can be tested quickly without waiting for the tunes to play. The other test pins appear to expose other internal data for testing.

This makes me wonder if you put one of the other test pins on a scope, if you'd see a pattern representing the song or sequence, allowing quick verification of the chip. I think at 512x speed, even a more limited storage scope of the era of these chips could capture the full output on-screen. Each flavor of the chip probably had an expected pattern based on ROM which could be checked.

I'm imagining a technician sitting at a test bench, having to do verification work on these all day, thankful for having a test pin instead of having to listen to the same dang beeping song over and over :)


The options are things such as staccato notes vs held notes or making the chip loop continuously. These are implemented in the logic section through connections in the metal layer to power or ground. In other words, different versions of the chip have the metal layer constructed slightly differently to obtain different behavior.


Nice work!

How many transistors does it have in all?

They could have used an LFSR for the PC too. Would that have saved some area? If not, I wonder why they used them elsewhere.

Are the resets (on 10000...) synchronous? If not I wonder how they handled glitch safety.


I estimate about 1500 transistors. Yes, they could have used the LFSR for the PC; I've seen that in early microcontrollers. I actually expected to see a LFSR there. Maybe they wanted to have a linear ROM layout to make their life simpler.

Yes, the resets are synchronous.


Thank you very much!

I wonder if you could do a CMOS μC in 1500 transistors; my best ideas so far are barely under 3000. Of course to make music that way you need a much faster clock plus some code memory.


The Intel 4004 had 2250 transistors, and it was designed to work in concert with support chips, unlike a modern MCU. A quick search doesn't turn up any known models with fewer. 1500 for an MCU might be possible, but it'd be a tight squeeze. Registers and multiplexers chew through transistors rather quickly.


The 4004 had to go fast enough to run a calculator at 0.75 MHz though. A modern chip typically runs at 100 MHz and can run at 4 GHz. If you could fab it in indium phosphide (which wouldn't be CMOS!) you could maybe run it at 400 GHz and use an optical fiber as a delay-line memory, 1 bit per millimeter. This sort of thing might enable you to use less transistors than a 4004.

I got down about that low with a bit-serial design whose only arithmetic instruction was a subtract, but I haven't simulated it at even the RTL level, just done a gate-level design on paper and a couple of software instruction-level sims.


Can you post a video of all songs?

My parents had that card when I was a kid, it really was great.


Excellent work Ken, as always. Love the detail.


Behold, the Santasizer courtesy of LMNC (Highly recommended sub, if you like circuit bending, old tech being used to make music, Gameboy/Megadrive arrays etc etc etc)

https://www.youtube.com/watch?v=qcqGqpI4qBU

Merry Christmas!


Oh and flame-throwing pipe organs, as well, why not?


I had no idea this was a specialised IC that played this tune! I assumed it was a jellybean microcontroller, but thinking about it it makes a lot of sense. These must have been produced in the literal billions over the past few decades.

For what it's worth, I've come across at least three variants of this particular chip that play slightly different versions of the Jingle Bells/Santa Claus is Coming to Town/We Wish You a Merry Christmas tune. In addition to the one in the video, there's one that holds a note for slightly too long during Jingle Bells ("oh what fun it is to ride" becomes "oh what fun it is - -", and another that repeats the first line of "We Wish You A Merry Christmas" a third time.

I wonder if they're knockoffs, and if so how they're constructed!


As a kid I used open up those handheld games beginning 80s to try to figure out how they worked; most has just 1 blob on the pcb which contained the chip and not much more but I did get some good results, like a Pacman clone had 2 blobs; one if them was a music chip which contained 100s of tunes mosty unrelated to Pacman; by figuring out what was the power and what was the signal to select the tunes (there was not much choice and if I remember the correctly the signal was serial). Great fun. Took me a lot of time and the games would be broken afterwards; luckily my parents liked that I was learning stuff instead of playing the actual games.


These chips are everywhere in Shenzhen--usually playing loudly when a gate is opening. It was a bit strange the first time I heard it. Of course, they have no cultural connection to these tunes, so it works fairly well as a warning.


The linear-feedback shift register method is also used for procedurally generating content in e.g. demos. Funny to see this implemented in hardware and it would be interesting to know when this trick was used firstly.


It's common where area or performance are paramount, since it performs better than an equivalent (binary) counter in silicon. The Numerically Controlled Oscillator in the Apple M1 that is used to generate audio sample rates uses an LFSR as its first stage clock divider, and the driver has to load the right LFSR initializer value directly. It was fun working that one out. They use an LFSR because the input clock is a rather fast 1GHz or so, and dividing that down requires a bit of optimization.

There are some 4-bit CPUs that use an LFSR as the program counter, so the ROM gets stored in pseudorandom order.

It's fun how the lowest tech chips and the highest tech chips both end up resorting to the same old techniques, isn't it? :)


I think I saw your tweet about getting nerd-sniped into figuring this out. Or was that another component?

What would be the reason for the pseudorandom ROM order? Just a side effect of the PC choice or deliberate?

sidenote: interesting that two sentences into your response I knew exactly what name I was going to see as the author. Thanks for the work you're doing and especially for documenting it. I've been reversing my old DSL-modem to pass time during lockdowns and since it's an obscure, asic based model it's highly educational to see you talk about figuring out things living on the hard/software boundary.


It was this :)

The pseudorandom ROM order is just a consequence of using an LFSR as a counter, since it counts in pseudorandom order.

I'm glad you enjoy what I'm doing! It's a lot of fun being able to work on a project like this, and I'm glad some of it is educational for other folks.


I don’t know the history, and I agree it would be fascinating to hear from someone who does — but the fact that we call it a “shift register” strongly suggests it was implemented in hardware first, because “shift register” is usually a hardware term rather than a software term.

The earliest example of an LFSR I’ve seen is the Nintendo Entertainment System’s white noise generator, implemented in hardware. But many NES games used software LFSRs to generate random numbers for gameplay, so the trick was probably long-established and well-known at that time.


I don't know the full history, but a bit of searching shows that linear feedback shift registers were in use in the 1960s, so it's a pretty old technology.


It's not about how old the technology is, but from when on it wasn't used as e.g. a pseudo-RNG, but rather for storing data. So, formally, still a RNG, but using a special seed to get a sequence that is equal to the data that one wants to store.

I have found that "River Raid" (1982) and "The Sentinel" (1986) were using it for game data. Apparently, the original "Elite" was supposed to use one, too, but they decided against it.


I wonder if someone could get the Apollo source code compiled and running on this chip to finally once and for all prove that old chestnut (i.e. the musical greeting card has more computing power than the Apollo Lunar lander)


It's not a CPU, so no... But if it were a microcontroller then it could've worked. The thing is you still need to look at slightly less ridiculously mass produced stuff for that, since the absolute cheapest stuff is still optimized to hell and back and won't include a CPU if it doesn't need one.


It’s hard to imagine, how they designed this chips without having modern wafer design tools. Crazy


Creating masks by hand at Intel corporation, c. 1970: http://images.computerhistory.org/revonline/images/500003094...


> I dissolved the epoxy package in boiling sulfuric acid to expose the silicon die inside

What!!?


The boiling sulfuric acid was not as scary as it sounds. I put the chip in a test tube with a small amount of sulfuric acid and heated it with a hot air gun outside. (I wore protective gloves and eye protection, and didn't breathe the fumes of course.) It took a couple of minutes to dissolve the epoxy.


I take it you prefer boiling colophony? Or are you a nitric man? Or are you, like me, surprised that even little old sulfuric could handle the job?


I hope he did not inhale the fumes.


I wonder why it needs to be boiling...


It's very slow with cool acid.


Any idea where i can source some of the -01L or 01S versions ( or something similar ). My google fu seems to be rusty… Id like 5-10 for some projects with the kids.



Sorry, I don't have any sources other than what turns up on eBay.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: