VOGONS


First post, by douglar

User metadata
Rank l33t
Rank
l33t

This was pretty interesting-- Using AI to replace failed PAL & GAL chips--

https://www.youtube.com/watch?v=C-dF4B84ZXs

Makes me glad I kept a bunch of failed controllers that maybe I can fix this way.

Although sometimes if you read a PAL chip and it's all 1's, couldn't it be copy protected?

Now, let me read what's on this chip ..... All 1's .... There's nothing on this chip. I guess it's too old.

Which means now I have to trace all the different signals from this chip because we have some inputs—pins 1 through 9, plus pin 11, while pin 10 is ground—and we have outputs. I know that some of them are jumpers to configure this chip, and they will be used inside the logic of this GAL chip to enable and disable other chips. An enable signal, for instance, could go to the IDE connector, or it could go anywhere. So I have to figure out where these signals go, and based on this map, hopefully Claude can recreate the logic programming of that chip.

With a multimeter, I went through every single pin of this chip that we removed from U5. This is definitely a GAL chip, and I tried to figure out where every pin connects to. This is the pin map of my work right now, so you can see where every single pin connects. There were a few unknowns—for instance, pin 8 goes to the Acer chip on pin 18, and there's also a 4.7 kiloohm pull-up resistor whose function is unknown—but everything else is completed.

So Claude wrote the GAL equations. I don't want to show the equations just yet because I don't know if they work, but they're based on this pinout that you see here. Now, let's program it. I have a GAL16V8B here that I pulled off another board. Okay, let's program this chip. Hopefully, this works. That looks good—programming successful. Very nice.

Okay, cool. I already put the socket on this card. Now we can place our programmed GAL chip in the socket, and hopefully, this card now detects the IDE drive. Okay, this is the moment of truth. I have no idea what is going to happen, so let's find out together. Will we see the flash card? I can already see it: Compact Flash 256! It figured it out—it's working! I can't believe this. Claude was able to reconstruct the logic for this GAL chip on the first try.

Reply 2 of 3, by jmarsh

User metadata
Rank l33t
Rank
l33t

Unfortunately it's not always that simple - Lattice were a bit atrocious at changing the GAL's behaviour without bumping the hardware revision, so when it comes to GAL16V8/20V8s you can never be sure whether the board design intended them to have internal pull-ups or not (unless you know the truth tables).

Reply 3 of 3, by rasz_pl

User metadata
Rank l33t++
Rank
l33t++

Some water on that fire:

This PAL performs very basic and very well documented address decoding for 0x1F0/3F6 + shared with floppy 0x3F7 Disk Change bit7. my ida header:

enum __bitmask __bin __lzero IO_Port_3F7h_FDC_IDE_Digital_Input_AT : unsigned __int8
{
IO_Port_3F7h_IDE_DI_b0_Drive0 = 0b00000001,
IO_Port_3F7h_IDE_DI_b1_Drive1 = 0b00000010,
IO_Port_3F7h_IDE_DI_b2_Head0 = 0b00000100,
IO_Port_3F7h_IDE_DI_b3_Head1 = 0b00001000,
IO_Port_3F7h_IDE_DI_b4_Head2 = 0b00010000,
IO_Port_3F7h_IDE_DI_b5_Head3 = 0b00100000,
IO_Port_3F7h_IDE_DI_b6_Write_Gate = 0b01000000,
IO_Port_3F7h_FDC_DI_b7_Disk_Changed = 0b10000000,
};

Here GAL16V8 performing exact same function https://www.alexandrugroza.ro/microelectronic … face/index.html with available jed file.

LLMs are really REAAAAALY good at copying solutions off the internet. Lets not forget 2021 OpenAI Codex/MS copilot happily stealing Carmack Quake3 codebase https://x.com/mitsuhiko/status/1410886329924194309 😀

Im not saying Claude couldnt figure it out, it probably could quite easily with couple of tries, but in this case it didnt even have to try.

TLDR: AI didnt "figure out equations", it recognized common implementation and plugged widely known solution available on in internet.

https://github.com/raszpl/sigrok-disk FM/MFM/RLL decoder
https://github.com/raszpl/FIC-486-GAC-2-Cache-Module (AT&T Globalyst)
https://github.com/raszpl/386RC-16 ram board
https://github.com/raszpl/Zenith_ZBIOS Zenith Z-386 MFM-300 ZBIOS disassembly