Egghead.page Logo

How the Sinclair ZX81 Managed TV Refresh Rates

The Sinclair ZX81, a pioneering home computer from 1981, utilized a unique method to generate video signals for standard television sets. This article explores how the ZX81 synchronized its processing with the TV’s refresh rate using interrupt-driven architecture. We will examine the role of the Uncommitted Logic Array (ULA) and the trade-offs between display generation and CPU performance that defined the machine’s operation.

The Role of the ULA

At the heart of the ZX81’s video capability was the Uncommitted Logic Array, or ULA. This custom chip was designed to minimize component count and cost, which was essential for the computer’s low price point. The ULA was responsible for generating the complex timing signals required by standard analog televisions. It handled the horizontal and vertical sync pulses necessary to lock the television’s electron beam to the computer’s output, ensuring a stable image without rolling or tearing.

Synchronization via Interrupts

To maintain the correct refresh rate, typically 50Hz for PAL regions and 60Hz for NTSC, the ULA generated a Non-Maskable Interrupt (NMI) at the start of each vertical flyback period. This interrupt signaled the Z80 processor that the television beam had returned to the top of the screen. The processor would then execute a specific interrupt service routine to reset the video memory pointer. This ensured that the data sent to the screen corresponded correctly to the start of the new frame, keeping the display synchronized with the television’s inherent refresh cycle.

CPU Contention and Slow Mode

The method used to manage the display had a significant impact on processing speed. The ZX81 shared its single block of RAM between the CPU and the ULA. During the visible portion of the television frame, the ULA required constant access to memory to fetch character data for the display. Consequently, the CPU was halted during this period to prevent memory conflicts. This state was known as “slow mode.” The processor could only execute instructions during the vertical and horizontal blanking intervals when the ULA did not need memory access. This resulted in the characteristic pause in computation whenever the screen was being updated.

Fast Mode and Display Blanking

Users could switch the computer into “fast mode” to maximize processing power for calculations. In this mode, the video display was turned off entirely. By disabling the video output, the ULA no longer required access to the RAM, allowing the CPU to run at its full clock speed without interruption. While this significantly sped up program execution, it left the user with a blank screen. This trade-off highlighted the engineering compromise required to deliver a functional graphical interface within the strict hardware limitations of the era.

Legacy of the Design

The ZX81’s approach to video refresh management was a testament to cost-effective engineering. By leveraging the television’s existing refresh circuitry and using interrupts to synchronize processing, Sinclair Research created a viable home computer with minimal hardware. While the memory contention caused noticeable slowdowns during display updates, the system successfully bridged the gap between early microcomputers and standard household television sets, paving the way for the home computing revolution.