The current system, adopted in 1997-98, uses a four-character prefix where the first one is the season number ( The Simpsons uses letters since it was already above nine seasons at the time of the switch note ) and the remaining three is the series code pulled from an alphabetical sequence, such as "ACX" for Family Guy or "ACV" for Futurama.In 1990-91 the code was standardized, with the number corresponding to the calendar year starting with 7 in 1990-91 and going from 9 in 1992-93 to 1 in 1993-94, and the letter corresponding to a series, such as "F" for The Simpsons note (there was a run of four episodes produced separately during the seventh season and aired during the eighth and ninth seasons which received 3Gxx codes), "X" for (what else?) The X-Files, "S" for Space: Above and Beyond and "E" for King of the Hill.The Simpsons debuted in that era with the famous 7Gxx code, which inspired the name of Sector 7G of the Springfield Nuclear Power Plant.
In 1981-82 the prefix became number-letter (as can be seen in the M*A*S*H example) and by the mid-1980s the hyphen was dropped. Starting with the 1970-71 season, the first two digits became a hyphenated letter-number prefix, which was seemingly assigned at random for each production season of each series: for example, the episode code for M*A*S*H goes J-3xx, K-4xx, B-3xx, G-5xx, U-8xx, Y-1xx, T-4xx, S-6xx, Z-4xx, 1-Gxx, 9-Bxx through its ten-season run.Shows up to the 1969-70 season used a four-digit code where the first two indicated the series and season (often the second digit remained constant and the first one incremented each season) and the last two were the episode number.A thorough guide can be seen here, but to summarize: 20th Century Fox Television has a tradition of funky episode coding with its shows, changing its system every decade or so.