DIP-40 · 6C001E-7 · drawing, not a photo
SinclairFerranti (para a Sinclair)
1981
ULA da Ferranti
An "uncommitted" chip that Sinclair turned into the rest of the computer.
Ferranti's ULA (Uncommitted Logic Array) is an array of logic gates wired to order in the last stage of manufacture. In the ZX81 it replaced 18 chips from the ZX80; in the Spectrum it generates the colour picture, reads the keyboard, handles the tape and the sound, and decides when the processor may use the memory.
- 8
An uncommitted array
A ULA is a chip made in advance with thousands of transistors not yet connected. Only the last metal layers, made to order, wire those transistors into logic gates and flip-flops, and that is what defines what the chip does. It is much cheaper and quicker to develop than a chip designed from scratch, which only pays off in huge volumes.
Ferranti, of Manchester, the same company that had completed the Ferranti Mark 1 in 1951, pioneered these arrays in bipolar technology in the United Kingdom. According to Chris Smith, who spent years studying the Spectrum's ULA, the 6C001E probably came from Ferranti's 6000 series of arrays, after the 1000, 2000 and 5000 series of CML logic. Ferranti also made ULAs for the BBC Micro and the Acorn Electron.
In 1982 Ferranti even sold the ULA Designer, a design workstation for 46,500 pounds, promising about 5,000 pounds per project and 1 to 2 pounds per chip in large quantities, against 15,000 pounds if the design was done by Ferranti itself. The microelectronics division was sold to Plessey in November 1987.
The ZX81 ULA
Jim Westwood, Sinclair's chief engineer, was given the job of bringing down the cost of the ZX80 and folded 18 of its chips into a single ULA. The ZX81 ended up with four main chips: processor, ULA, ROM and memory. The manual called the ULA the system's "dogsbody", the one that does everything.
It generates the 6.5 MHz clock (from which the processor's 3.25 MHz comes), synchronises the picture, reads the keyboard, saves to and loads from tape, chooses when the ROM and RAM speak and controls the timing of everything. Because the same pin serves the video and the tape output, the zigzag stripes appear on screen during LOAD and SAVE.
There were three main versions: 2C158E, 2C184E and 2C210E. The first two generate a video signal without the "back porch", a short interval in the signal that televisions use as a reference, and on many colour televisions the picture comes out very dark, with white looking grey. The 2C210E has it. The Timex Sinclair 1000 uses the 2C210E.
The Spectrum ULA
Richard Altwasser designed the Spectrum's hardware and, with it, its ULA. The graphics mode was designed to fit in under 7 KB: 6,144 bytes for the 256 × 192 pixels and 768 bytes of attributes, one for each 8 × 8 block, for a total of 6,912 bytes. Each attribute has 3 bits for the ink colour, 3 for the paper, one for brightness and one for FLASH, which swaps the two colours every 0.64 seconds.
The ULA reads the keyboard and the tape input through port 0xFE, and through the same port it receives the border colour (bits 0 to 2), the MIC output (bit 3) and the beeper (bit 4). To clean up the noise from tapes, the team put a Schmitt trigger inside the ULA.
The clock comes from a 14 MHz crystal: the ULA divides it by 2 to get the 7 MHz pixel clock and by 4 to get the Z80's 3.5 MHz. And about 50 times a second, at the start of each frame, it gives the processor the interrupt that the ROM uses to read the keyboard and keep time.
Contended memory: the ULA is in charge
The ULA and the processor share the first 16 KB of RAM (0x4000 to 0x7FFF), where the screen lives, and the memory cannot be read by both at once. The ULA has priority: while it draws the active part of the screen, it holds up any Z80 that wants to access that area, following a pattern of 6, 5, 4, 3, 2, 1, 0, 0 cycles. In the border and during beam retrace there are no delays. Code in the top 32 KB always runs at full speed.
On the 48K each line lasts 224 processor cycles and there are 312 lines, which makes 69,888 cycles per frame. Effects that change colours halfway down the screen, multi-voice beeper music or speech samples count these cycles one by one. And because the ULA rereads the attributes on every pixel line, some programs swap attributes between lines to show more colours in an 8 × 8 block.
When reading a port with nothing connected, the processor picks up the byte the ULA is fetching from video memory at that instant, the so-called floating bus. Games such as Cobra, Short Circuit, Sidewize and Arkanoid used this to know where the beam was on the screen and draw without flicker.
Revisions: cockroaches and spiders
The first Spectrum ULA, the 5C102E (Issue 1 boards and some Issue 2), had a bug in port contention that made reading the keyboard from machine code unreliable. The fix was the "dead cockroach": a 74LS00 chip hand-soldered on top of the board, connected by flying wires.
The 5C112E, on Issue 2 boards, fixed the bug but started delaying ports that did not need it. Then came the "spider": a ZTX313 transistor soldered on top of the processor, with a diode and a resistor. From Issue 3 onwards that transistor became part of the board, as TR6. ZTX was Ferranti's own line of transistors.
Next came the 6C001E family. The 6C001E-5 changed the timing to work with more televisions, at the cost of shifting the picture one character to the left, and the EAR input bit floated until the ULA warmed up. The 6C001E-6 was used on most Issue 3 boards, and the 6C001E-7 works on every 48K board; the last ones already carry the Plessey logo. The ZX81 and 48K ULAs have 40 pins.
From the 128 to the end of the ULA, and the Timex machines
The 128 and the grey +2 use the 7K010E5, later marked Amstrad 40056 but functionally identical, with 48 pins and RGB output. A single 17.7345 MHz crystal gives, divided by 5, the processor's 3.5469 MHz and, divided by 4, the 4.43 MHz of PAL colour. Each frame now has 228 × 311 = 70,908 cycles, which is why the 128 is slightly faster than the 48K and some timing tricks notice the difference.
Because of a bug in a paging logic chip, on the 128 and the grey +2 the contended pages are 1, 3, 5 and 7, not the 4, 5, 6 and 7 that the documentation stated. You can hear it, for example, in the digitised speech of Fantasy World Dizzy, which sounds wrong on a 128 and right on a +2A.
On the +2A, +2B and +3 the ULA disappears: Amstrad replaced it with a gate array, the 40077, in a surface-mount package, which combines the functions of the ULA and the surrounding logic. Contention moves to pages 4 to 7 and applies only to memory accesses, and games that relied on the floating bus may hang or run jerkily.
The Timex machines took another route: in the TS2068 the ULA's job is done by the SCLD (Standard Cell Logic Device), a standard-cell chip that Timex ordered from NCR, in a 68-pin package. It is also in the TS1500 and in the TC2048 and TC2068 made in Portugal, where it enables the 512 × 192 modes and colour in 8 × 1 cells. In the TS2068, the Z80 runs at 3.528 MHz, a quarter of the SCLD's 14.112 MHz clock.
Did you know…
It's said that only 70% of the ZX81 ULA's gates were meant to be used, but Sinclair used them all to squeeze in more functions, and the computer ran hot. The story goes that some people cooled it with a cold carton of milk on top of the case.
The name "dead cockroach" comes, it's said, from the look of the 74LS00 soldered on top of the board, with its legs and wires on show.
Chris Smith decapped several 6C001E-7 ULAs to photograph them and redrew the circuit transistor by transistor: the complete schematic, on paper, measures 210 × 196 cm.
In the former Soviet Union a chip compatible with the Spectrum's ULA was made, the T34VG1.
On the 48K, the border changes colour through the same port that sounds the beeper, and it is that port that paints the coloured stripes in the border while a tape loads.
The 128's ULA came to be marked Amstrad 40056 after the purchase of Sinclair, but it works exactly like Ferranti's 7K010E5.
The Timex SCLD is not a ULA: it is a standard-cell chip, a different semi-custom technique.
Attribute clash
On the Spectrum, the ULA stores colour per 8×8-pixel cell: just one ink and one paper colour in each. When the yellow ship enters a cell, everything drawn there changes colour with it. Compare with per-pixel colour.





