Decoding the NEC V20's Microcode with a CNN

Decoding the NEC V20 Microcode

Decoding the NEC V20's Microcode with a CNN

MartyPC's author wanted cycle-accurate emulation of the NEC V20 CPU, but without the microcode it was guesswork. So he commissioned die photography of the chip, extracted the 29,928-bit microcode ROM visually, and trained a convolutional neural network to classify the bits—a task that took just an afternoon with PyTorch. The result: a full microcode dump and a decoder PLA extraction, bringing the V20's inner workings to light.

The problem is quite literally "Hotdog or Not Hot Dog."
  1. ataylor284_

    If anybody's interested in the V20 from a programming perspective, The User's Manual from NEC is here: https://archive.org/details/bitsavers_necV20V30U_11351331/mo....

    The V20 instruction set is interesting and has some very 1980s extensions. In addition to the 8080 emulation mode, it has instructions for binary-coded decimal arithmetic and bit fields.

    However, NEC uses their own naming scheme which makes picking out the differences from the 8088 unnecessarily difficult. The bits are the same but the mnemonics are different. For example, they renamed all the registers (AX -> AW, SI -> IX, etc) and many opcodes (JMP -> BR, REP MOVSB -> REP MOVBK).

  2. klelatti

    Of course the V20’s microcode was the centre of an interesting legal dispute when NEC was sued by Intel.

    https://thechipletter.substack.com/p/intel-vs-nec-the-case-o...

  3. jeanmichelselli

    This is an amazing project, I'm always impressed by stuff like this. I'd be very curious to know, though, if there's a market for achievements like that.

More from this day

2026-09-07