The Zx Spectrum Ula How To Design A Microcomputer Zx Design Retro Computer Portable -

Designing a retro microcomputer based on the ZX Spectrum architecture requires mastering the Uncommitted Logic Array (ULA), the custom chip responsible for video generation, memory management, and I/O. Core Architecture of the ZX Spectrum ULA

The original ULA was a custom Ferranti chip that integrated several discrete logic functions into one package to reduce costs. Key responsibilities included:

Video Generation: Fetching pixel and attribute data from memory and converting it into a composite video signal.

Clock Management: Dividing a 14MHz master clock to provide 7MHz for video and 3.5MHz for the Z80 CPU. Designing a retro microcomputer based on the ZX

Memory Contention: Delaying the CPU's access to the lower 16KB of RAM when the ULA needs it for the display, leading to "contended memory" behavior.

Peripherals: Handling keyboard input, tape EAR/MIC ports, and beeper sound. Modern Design & Implementation Strategies

For a modern retro-build or portable device, you can replace the original ULA using these methods: ZX MAX 128 ZX Spectrum Clone Build Part 4: The "How to Design a Microcomputer"

Here’s a feature overview for a retro-inspired portable microcomputer based on the ZX Spectrum ULA design philosophy:


Part 4: The "How to Design a Microcomputer" Checklist – ZX Edition

If you are serious about building this portable, follow this engineering sequence:

  1. Schematic Capture: Z80 (or FPGA core) -> SRAM -> FPGA (ULA) -> HDMI/LCD -> Battery management (MAX17048).
  2. The Contention Conundrum: In your FPGA code, when the Z80 reads from 0x4000-0x5BFF or 0x6000-0x7FFF (attribute memory), your ULA must halt the Z80’s clock for 1 or 2 cycles out of every 4. This is non-negotiable for game compatibility.
  3. Power Sequencing: The portable needs a 5V rail for USB, a 3.3V rail for the FPGA/SRAM, and optionally +9V for an amplified speaker. Use a TPS63060 buck-boost regulator to keep stable voltage as the battery drains.
  4. PCB Layout: Keep the crystal (14.318MHz) physically adjacent to the FPGA. Route the address/data buses short and matched. Use a 4-layer board (Signal-GND-Power-Signal) to avoid the noise that plagued original Spectrums.
  5. Firmware: Load the FPGA bitstream from a SPI flash (W25Q32). On power-up, the flash configures the FPGA into a Z80 + ULA + HDMI scaler + SD card controller.

6. Key Design Challenges & Solutions

| Challenge | Solution | |-----------|----------| | Contended memory timing | FPGA generates WAIT signal to Z80 exactly per original ULA. | | LCD scaling | 256×192 to 320×240: use pixel doubling or scanline buffer in FPGA. | | Keyboard matrix | 8×5 matrix via ULA port 0xFE; scan with FPGA and map to modern tact switches. | | Audio | Simple 1-bit PWM (original beeper) filtered through RC to speaker. | | Loading software | SD card + FAT32 + .tap parser; FPGA feeds bytes to Z80 via “divide-by-256” trick (simulate tape input on EAR pin). | | Case & portability | 3D print case with 40-key membrane (can source from ZX81 keyboard replicas). | Schematic Capture: Z80 (or FPGA core) -> SRAM

The ZX Spectrum ULA: How to Design a Microcomputer (And Build a Portable Retro Computer)

If you open up a Sinclair ZX Spectrum, you might expect to find a motherboard sprawling with chips—CPU, RAM, ROM, video logic, and sound circuits. Instead, you are greeted by a surprisingly empty board. The magic lies in one mysterious, black chip sitting smack in the center: the ULA (Uncommitted Logic Array).

For the retro computing enthusiast, the ULA isn't just a chip; it is a masterclass in cost-reduction engineering. It represents a pivotal moment in computing history where the goal wasn't just to build a computer, but to build one cheap enough to fit in every home.

Today, we’re going to look at how the ULA defined the Spectrum’s design, why it matters for modern hardware hackers, and how understanding it helps you build your own portable retro machines.

Step 1: Choose Your Core – The "ULA Heart"

Forget the original ULA. You need an FPGA (Field Programmable Gate Array). The cheapest and most documented for this task is the ICE40UP5K or the Xilinx XC9572XL for a CPLD, but for a full ULA+Z80, use an EP4CE10 (Cyclone IV) or an Lattice iCE40 HX8K.

  • Why: An FPGA runs logic in parallel. It can have one block generating video at 14MHz, another block acting as the Z80 CPU, and a third block performing DRAM refresh, all simultaneously. No microcontroller can do this without jitter.
  • The Core: Use the open-source "ZX Spectrum for FPGA" core (T80 CPU core + ULA replacement). This core replicates contention perfectly. Without contention, games like Chase H.Q. or RoboCop will run too fast or glitch.

Path B: The FPGA "Super ULA"

This is where the design of the Spectrum truly evolves. Modern retro engineers have replaced the physical Ferranti ULA with an FPGA (Field-Programmable Gate Array).

  • Projects like the ZX-Uno or the Spectrum Next essentially recreate the ULA in code.
  • Why is this better for a portable? An FPGA can output VGA or HDMI directly. It can also handle SD card storage (replacing the fragile tape deck) and run at different CPU speeds without timing conflicts.