455 Zilog Z80

455 : Zilog Z80

Design render
  • Author: ReJ aka Renaldas Zioma
  • Description: Z80 open-source silicon. Goal is to become a silicon proven, pin compatible, open-source replacement for classic Z80.
  • GitHub repository
  • Open in 3D viewer
  • Clock: 4000000 Hz

How it works

On April 15 of 2024 Zilog has announced End-of-Life for Z80, one of the most famous 8-bit CPUs of all time. It is a time for open-source and hardware preservation community to step in with a Free and Open Source Silicon (FOSS) replacement for Zilog Z80.

The implementation is based around Guy Hutchison's TV80 Verilog core.

The future work

  • Add thorough instruction (including 'illegal') execution tests ZEXALL to testbench
  • Compare different implementations: Verilog core A-Z80, Netlist based Z80Explorer
  • Create gate-level layouts that would resemble the original Z80 layout. Zilog designed Z80 by manually placing each transistor by hand.
  • Tapeout QFN44 package
  • Tapeout DIP40 package

Z80 technical capabilities

  • nMOS original frequency 4MHz. CMOS frequency up to 20 MHz. This tapeout on 130 nm is expected to support frequency up to 50 MHz.
  • 158 instructions including support for Intel 8080A instruction set as a subset.
  • Two sets of 6 general-purpose reigsters which may be used as either 8-bit or 16-bit register pairs.
  • One maskable and one non-maskable interrupt.
  • Instruction set derived from Datapoint 2200, Intel 8008 and Intel 8080A.

Z80 registers

  • AF: 8-bit accumulator (A) and flag bits (F)
  • BC: 16-bit data/address register or two 8-bit registers
  • DE: 16-bit data/address register or two 8-bit registers
  • HL: 16-bit accumulator/address register or two 8-bit registers
  • SP: stack pointer, 16 bits
  • PC: program counter, 16 bits
  • IX: 16-bit index or base register for 8-bit immediate offsets
  • IY: 16-bit index or base register for 8-bit immediate offsets
  • I: interrupt vector base register, 8 bits
  • R: DRAM refresh counter, 8 bits (msb does not count)
  • AF': alternate (or shadow) accumulator and flags (toggled in and out with EX AF, AF' )
  • BC', DE' and HL': alternate (or shadow) registers (toggled in and out with EXX)

Z80 Pinout

                    ,---------.__.---------.
         <--    A11 |1                   40| A10    -->       
         <--    A12 |2                   39| A9     -->        
         <--    A13 |3       Z80 CPU     38| A8     -->        
         <--    A14 |4                   37| A7     -->        
         <--    A15 |5                   36| A6     -->
         -->    CLK |6                   35| A5     -->
         <->     D4 |7                   34| A4     -->
         <->     D3 |8                   33| A3     -->            
         <->     D5 |9                   32| A2     -->            
         <->     D6 |10                  31| A1     -->            
                VCC |11                  30| A0     -->           
         <->     D2 |12                  29| GND           
         <->     D7 |13                  28| /RFSH  -->          
         <->     D0 |14                  27| /M1    -->           
         <->     D1 |15                  26| /RESET <--      
         -->   /INT |16                  25| /BUSRQ <--      
         -->   /NMI |17                  24| /WAIT  <--      
         <--  /HALT |18                  23| /BUSAK -->     
         <--  /MREQ |19                  22| /WR    -->       
         <--  /IORQ |20                  21| /RD    -->       
                    `----------------------'

How to test

Hold all bidirectional pins (Data bus) low to make CPU execute NOP instruction. NOP instruction opcode is 0. Hold all input pins high to disable interrupts and signal that data bus is ready.

Every 4th cycle 8-bit value on output pins (Address bus low 8-bit) should monotonously increase.

     Timing diagram, input pins

      Z80CLK____      ____      ____      ____      ____      ____         
         __/    \____/    \____/    \____/    \____/    \____/    `____ ...
           |        |         |         |         |         |
           |        |         |         |         |         |

      /RESET___________________________________________________________
         __/
      /WAIT ___________________________________________________________
         __/
      /INT  ___________________________________________________________
         __/
      /NMI  ___________________________________________________________
         __/
      /BUSRQ___________________________________________________________
         __/

      D7..D0             NOP       NOP       NOP       NOP       NOP
         __ XXXXXXXXX ___#00___ ___#00___ ___#00___ ___#00___ ___#00___

      Expected signals on output pins
      /M1   _________                    ____________________
                     \__________________/                    \_________
      /MREQ ___________________          ______________________________
                               \________/ 
      /RD   ___________________          ______________________________
                               \________/
      A0..A7         
         __ XXXXXXXXX ___#00___ ___#00___ XXXXXXXXX XXXXXXXXX ___#01___
 

External hardware

Bus de-multiplexor, external memory, 8-bit computer such as ZX Spectrum.

Alternatively the RP2040 on the TinyTapeout test PCB can be used to simulate RAM and I/O.

IO

#InputOutputBidirectional
0/WAIT/M1, A0, A8D0
1/INT/MREQ, A1, A9D1
2/NMI/IORQ, A2, A10D2
3/BUSRQ/RD, A3, A11D3
4CONFIG -- 00: short MREQ IORQ RD / 01: short MREQ IORQ RD starts early/WR, A4, A12D4
5CONFIG -- 10: long MREQ IORQ / 11: long MREQ IORQ RD starts early/RFSH, A5, A13D5
6MUX -- address lo/hi bits on the output pins/HALT, A6, A14D6
7MUX -- control signals on the output pins/BUSAK, A7, A15D7

Chip location

Controller Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux tt_um_chip_rom (Chip ROM) tt_um_factory_test (Tiny Tapeout Factory Test) tt_um_htfab_asicle2 (Asicle v2) tt_um_urish_simon (Simon Says memory game) tt_um_dlmiles_ringosc_5inv (Ring Oscillator (5 inverter)) tt_um_rejunity_vga_logo (VGA Tiny Logo) tt_um_rejunity_sn76489 (Classic 8-bit era Programmable Sound Generator SN76489) tt_um_wokwi_392873974467527681 (PILIPINAS_IC) tt_um_wokwi_442081253563458561 (PRISM 8 with TinySnake) tt_um_waferspace_vga_screensaver (Wafer.space Logo VGA Screensaver) tt_um_rejunity_z80 (Zilog Z80) tt_um_MichaelBell_tinyQV (TinyQV Risc-V SoC) tt_um_calonso88_spi_i2c_reg_bank (Register bank accessible through SPI and I2C) tt_um_htfab_caterpillar (Simon's Caterpillar) tt_um_gf0p2_faust_top (Silly-Faust) tt_um_htfab_cells (Cell mux) tt_um_zedtc1_top (Zedulo TestChip1) tt_um_essen (2x2 MAC Systolic array with DFT) tt_um_BLE_RX (SCµM-BLE-RX) tt_um_kianV_rv32ima_uLinux_SoC (KianV uLinux SoC) tt_um_schoeberl_wildcat (Wildcat RISC-V) tt_um_vga_clock (VGA clock) tt_um_digital_clock_example (7-Segment Digital Desk Clock) tt_um_rejunity_vga_test01 (VGA Drop (audio/visual demo)) tt_um_a1k0n_nyancat (VGA Nyan Cat) tt_um_proppy_megabytebeat (megabytebeat) tt_um_javibajocero_top (MarcoPolo) tt_um_kercrafter_leds_racer (LEDs Racer) tt_um_noritsuna_CAN_CTRL (CAN Controller for Rocket) tt_um_algofoogle_raybox_zero (raybox-zero TTGF0p2 edition) tt_um_flummer_ltc (Linear Timecode (LTC) generator) tt_um_dlmiles_bad_synchronizer (Example of Bad Synchronizer) tt_um_multi_bit_puf_wrapper (One Bit PUF) tt_um_algofoogle_vgaringosc (Ring osc on VGA) tt_um_lisa (LISA 8-Bit Microcontroller) tt_um_mmorri22_lockpick_game (Notre Dame - Lockpick Game TT Example) tt_um_simple_riscv (Simple RISC-V) tt_um_mmorri22_cse_30342 (Notre Dame - CSE 30342 - DIC - Advanced FSM Final Project Example) tt_um_zacky1972_PVTMonitorSuite (PVTMonitorSuite) tt_um_SophusAndreassen_dogbattle (Dog Battle Game) tt_um_frequency_counter (Frequency Counter SSD1306 OLED) tt_um_wokwi_445338187869298689 (WokwiPWM) tt_um_kbeckmann_flame (Flame demo) tt_um_2048_vga_game (2048 sliding tile puzzle game (VGA)) tt_um_spi_cpu_top (Super-Simple-SPI-CPU) tt_um_urish_usb_cdc (USB CDC (Serial) Device) tt_um_htfab_vga_tester (Video mode tester) tt_um_dlmiles_ddr_throughput_test (DDR throughput and flop aperature test) tt_um_dlmiles_loopback (GF180MCU loopback tile with input skew measurement) tt_um_thezoq2_quickscope (Quickscope) tt_um_MATTHIAS_M_PAL_TOP_WRAPPER (easy PAL) tt_um_htfab_rotfpga2 (ROTFPGA v2)