The Zx Spectrum Ula How To Design A Microcomputer Zx Design Retro Computer Portable [exclusive] Review
Designing a Portable ZX Spectrum: Replicating the ULA for a Modern Retro Computer
Abstract
The ZX Spectrum, released in 1982 by Sinclair Research, defined home computing for a generation. At its heart lies the ULA (Uncommitted Logic Array), a custom chip that integrated video generation, memory arbitration, I/O, and system timing. This paper explores how to design a portable, battery-powered ZX Spectrum-compatible computer by understanding, emulating, or replacing the ULA with modern hardware. We examine the ULA’s original functions and present a practical architecture for a handheld retro device using FPGA or discrete microcontroller techniques.
To make a ZX design portable, the ULA logic must be integrated into a low-power system. Modern builders often pair an FPGA or a microcontroller (like the ESP32 or Pi Pico) with a small LCD. Since the original ULA output a composite/RF signal for old TVs, a modern portable design requires the ULA code to output VGA or HDMI signals compatible with modern panels. Designing a Portable ZX Spectrum: Replicating the ULA
The Discrete Logic Approach: Enthusiasts often use "Harlequin" boards, which replace the single ULA chip with many small, widely available 74-series logic chips. This is great for learning exactly how the timing and video generation work step-by-step. Designing for Portability On-device editor for simple BASIC coding
1. Video on a Shoestring
The ULA is the Spectrum's heart, but its most brilliant trick is handling video. Most computers of the era used dedicated video display controllers (like the C64’s VIC-II). The Spectrum’s ULA generates the video signal directly. ULA functions — a concise breakdown
- On-device editor for simple BASIC coding.
- File manager for SD card.
ULA functions — a concise breakdown
- Video generation: Generated sync signals, pixel clock, and read DRAM to form a composite video signal. It produced a 256×192 bitmap with an 8×8 attribute grid for color information.
- DRAM refresh and contention: Performed memory refresh cycles and enforced contention rules with the Z80 CPU — CPU accesses during certain phases were delayed or slowed.
- I/O control: Scanned the keyboard matrix, managed tape interface timing, and implemented simple port decode logic for the CPU’s IN/OUT instructions.
- Address mapping: Mapped ROM and RAM into the Z80 address space, with some later models supporting paging for expanded RAM.
Designing a modern retro-style ZX microcomputer (portable)
This section provides a practical, prescriptive plan to build a portable microcomputer inspired by the Spectrum, combining authenticity with modern conveniences.
- Video Generation: It read screen memory (a linear 6912-byte block at 0x4000) and generated a PAL/NTSC composite video signal. No framebuffer; it streamed bytes directly from DRAM.
- Dynamic RAM Refresh & Arbitration: The Z80 needed the RAM, but the ULA needed it for video. The ULA stole cycles from the CPU (contended memory) during the screen's active display. It also handled DRAM refresh during horizontal and vertical blanking.
- Keyboard Scanning: It scanned the membrane keyboard matrix and generated an interrupt (IM 1) to the Z80.
- I/O Port Decoding: It decoded specific port addresses (e.g., 0xFE for keyboard, ear/mic, and border control).
- Beeper & Tape I/O: It toggled the internal speaker and read/wrote audio cassette data.
- Border Control: The famous colored border was just the ULA outputting a color outside the screen area.
3. Display & Video Features
- Native 256×192 (plus border area) at 50 Hz (PAL) or 60 Hz (NTSC selectable).
- Modern video out – mini HDMI or USB-C DisplayPort for external monitor (with scanline filters and CRT emulation).
- Scalers – 1:1, 2×, 3×, full-screen stretch with aspect correction.
- Palette switching – original green/black (ZX80/81 style), classic Spectrum bright/dark, or customizable RGB.