MOS Technology 6581


The MOS Technology 6581/8580 SID is the built-in programmable sound generator chip of the Commodore 64, Commodore CBM-II, Commodore 128, and MAX Machine home computers. Together with the VIC-II graphics chip, the SID was instrumental in making the C64 the best-selling home computer in history, and is partly credited for initiating the demoscene.
The SID was an advanced design for the era, compared to competing systems like Atari's POKEY or the widely used General Instrument AY-3-8910 or Texas Instruments SN76489. In contrast to those systems, which were aimed at producing simple sound effects for games and similar purposes, the SID is better described as a single-chip music synthesizer. It included common synthesizer features like ADSR envelope controls, the ability to mix channels to produce ring modulation and similar effects, and filters. These features allowed the SID to produce more complex sounds and more natural sounding music than other home computers.
The original version of the SID, the 6581, was introduced with the C64 in 1982. It had a number of design features that were not well implemented due to time constraints, which resulted in various oddities in the output. Many of these were addressed in the later 8580 version, which took over from the original 6581 around 1986 in the Commodore 128 and used in later machines. The 8580 was produced until around 1992.
In the spring of 1983, the designer of the SID, Bob Yannes, left Commodore and would later go on to produce digital synthesizers at his new company, Ensoniq.

History

The SID was devised by engineer Bob Yannes, who later co-founded the Ensoniq digital synthesizer and sampler company. Yannes headed a team that included himself, two technicians and a CAD operator, who designed and completed the chip in five months in the latter half of 1981. Yannes was inspired by previous work in the synthesizer industry and was not impressed by the current state of computer sound chips. Instead, he wanted a high-quality instrument chip, which is the reason why the SID has features like the envelope generator.
Emphasis during chip design was on high-precision frequency control, and the SID was originally designed to have 32 independent voices, sharing a common wavetable lookup scheme that would be time multiplexed. However, these features could not be finished in time, so instead the mask work for a certain working oscillator was simply replicated three times across the chip's surface, creating three voices each with its own oscillator. Another feature that was not incorporated in the final design was a frequency look-up table for the most common musical notes, a feature that was dropped because of space limitations. The support for an audio input pin was a feature Yannes added without asking, which in theory would have allowed the chip to be used as a simple effect processor. The masks were produced in 7-micrometer technology to gain a high yield; the state of the art at the time was 6-micrometer technologies.
The chip, like the first product using it, was finished in time for the Consumer Electronics Show in the first weekend of January 1982. Even though Yannes was partly displeased with the result, his colleague Charles Winterble said: "This thing is already 10 times better than anything out there and 20 times better than it needs to be."
The specifications for the chip were not used as a blueprint. Rather, they were written as the development work progressed, and not all planned features made it into the final product. Yannes claims he had a feature-list of which three quarters made it into the final design. The later revision was revised to more closely match the specifications. For example, the 8580 slightly improved upon the ability to perform a binary AND between two waveforms, which the SID can only do in an odd and illogical manner that results in messy, and in some cases nearly silent, waveforms. Wave combinations on the 8580 result in cleaner waveforms than on the 6581, although irregularities are still present. Another feature that differs between the two revisions is the filter, as the 6581 version is far away from the specification.

Design

The SID is a mixed-signal integrated circuit, featuring both digital and analog circuitry. All control ports are digital, while the output ports are analog. The system is programmed using a 5-bit address bus that selects a processor register, and then reading or writing that register over an 8-bit data bus. Only 29 of the possible 32 registers are used.
The SID features three voices, with four types of waveforms able to be selected per voice: pulse wave, triangle wave, sawtooth wave, and pseudorandom noise. Multiple waveform types may be selected simultaneously, which produces certain complex/combined waveforms. The oscillators of each voice are built on a 24-bit phase accumulator. A voice playing a triangle waveform may be ring-modulated with one of the other voices, where the triangle waveform's bits are inverted when the MSB of the modulating voice's accumulator is set, producing a discontinuity and inversion of direction with the triangle's ramp. Voices may also be hard-synced to each other, where the synced voice's oscillator is reset whenever the MSB of the syncing voice's accumulator is increased. If both ring modulation and hard-sync are set to affect the same voice, the two effects are combined. The voice that ring modulates and/or syncs a given affected voice is determined by the following pattern: voice 1 affects voice 2, voice 2 affects voice 3, and voice 3 affects voice 1.
Each voice may be routed into a common, digitally controlled analog multimode filter, which is constructed with aid of external capacitors to the chip. The filter has lowpass, bandpass and highpass outputs, which can be individually selected for final output amplification via the master volume register. Filter modes can also be combined. For example, using a combined state of lowpass and highpass results in a notch output.
The programmer may vary the filter's cutoff frequency and resonance. An external audio-in port enables external audio to be passed through the filter.
The ring modulation, filter, and programming techniques such as arpeggio together produce the characteristic feel and sound of SID music.
Due to imperfect manufacturing technologies of the time and poor separation between the analog and digital parts of the chip, the 6581's output was always slightly biased from the zero level. Each time the volume register was altered, an audible click was produced. By quickly adjusting the amplifier's gain through the main 4-bit volume register, this bias could be modulated as PCM, resulting in a "virtual" fourth channel allowing 4-bit digital sample playback. The glitch was known and used from an early point on, first by Electronic Speech Systems to produce sampled speech in games such as Impossible Mission and Ghostbusters. The first instance of samples being used in actual musical compositions was by Martin Galway in Arkanoid, although he had copied the idea from an earlier drum synthesizer package called Digidrums. The length of sampled sound playback was limited first by memory and later technique. Kung Fu Fighting, a popular early sample, has a playback length measured in seconds. c64mp3 and Cubase64 demonstrate playback lengths measured in minutes. Also, it was hugely CPU intensive - one had to output the samples very fast.
The better manufacturing technology in the 8580 used in the later revisions of Commodore 64C and the Commodore 128 DCR caused the bias to almost entirely disappear, causing the digitized sound samples to become very quiet. Fortunately, the volume level could be mostly restored with either a hardware modification, or more commonly a software trick involving using the Pulse waveform to intentionally recreate the required bias. The software trick generally renders one voice temporarily unusable, although clever musical compositions can make this problem less noticeable. An excellent example of this quality improvement noticeably reducing a sampled channel can be found in the introduction to Electronic Arts' game Skate or Die. The guitar riff played is all but missing when played on the Commodore 64c or the Commodore 128.
At the X'2008 demo party, a completely new method of playing digitized samples was unveiled. The method allows for an unprecedented four channels of 8-bit samples with optional filtering on top of all samples, as well as two ordinary SID sound channels. The method works by resetting the oscillator using the waveform generator test bit, quickly ramping up the new waveform with the Triangle waveform selected, and then disabling all waveforms, resulting in the DAC continuing to output the last value---which is the desired sample. This continues for as long as two scanlines, which is ample time for glitch-free, arbitrary sample output. It is however more CPU-intensive than the 4-bit volume register DAC trick described above. Because the filtering in a SID chip is applied after the waveform generators, samples produced this way can be filtered normally.
The original manual for the SID mentions that if several waveforms are enabled at the same time, the result will be a binary AND between them. What happens in reality is that the input to the waveform DAC pins receives several waveforms at once. For instance, the Triangle waveform is made with a separate XOR circuit and a shift-to-left circuit. The top bit drives whether the XOR circuit inverts the accumulator value seen by the DAC. Thus, enabling triangle and sawtooth simultaneously causes adjacent accumulator bits in the DAC input to mix. The pulse waveform is built by joining all the DAC bits together via a long strip of polysilicon, connected to the pulse control logic that digitally compares current accumulator value to the pulse width value. Thus, selecting the pulse waveform together with any other waveform causes every bit on the DAC to partially mix, and the loudness of the waveform is affected by the state of the pulse.
The noise generator is implemented as a 23-bit-length Fibonacci LFSR. When using noise waveform simultaneously with any other waveform, the pull-down via waveform selector tends to quickly reduce the XOR shift register to 0 for all bits that are connected to the output DAC. As the zeroes shift in the register when the noise is clocked, and no 1-bits are produced to replace them, a situation can arise where the XOR shift register becomes fully zeroed. Luckily, the situation can be remedied by using the waveform control test bit, which in that condition injects one 1-bit into the XOR shift register. Some musicians are also known to use noise's combined waveforms and test bit to construct unusual sounds.
The 6581 and 8580 differ from each other in several ways. The original 6581 was manufactured using the older NMOS process, which used 12V DC to operate. The 6581 is very sensitive to static discharge and if they weren't handled properly the filters would stop working, explaining the large number of dead 6581s in the market. The 8580 was made using the HMOS-II process, which requires less power, and therefore makes the IC run cooler. The 8580 is thus far more durable than the 6581. Also, due to more stable waveform generators, the bit-mixing effects are less noticeable and thus the combined waveforms come close to matching the original SID specification. The filter is also very different between the two models. The 6581 cutoff range resembles a sigmoid function on a log scale and varies wildly between chips, while the cutoff range on the 8580 is a straight line on a linear scale and is both more consistent between chips and close to the designers' actual specifications. The 8580 filter can achieve higher resonances as well. Additionally, a better separation between the analog and the digital circuits made the 8580's output less noisy and distorted. The noise in 6xxx-series systems can be reduced by disconnecting the audio-in pin.
The consumer version of the 8580 was rebadged the 6582, even though the die on the chip is identical to a stock 8580 chip, including the '8580R5' mark. Dr. Evil Laboratories used it in their SID Symphony expansion cartridge, and it was used in a few other places as well, including one PC sound-card.
Despite its documented shortcomings, many SID musicians prefer the flawed 6581 chip over the corrected 8580 chip, some even seeing the flaws as actual 'features' that made the SID chip distinct from other sound chips at the time. The main reason for this is that the filter produces strong distortion that is sometimes used to produce simulation of instruments such as a distorted electric guitar. Also, the highpass component of the filter was mixed in 3 dB attenuated compared to the other outputs, making the sound more bassy. In addition to nonlinearities in filter, the D/A circuitry used in the waveform generators produces yet more additional distortion that made its sound richer in character.