The Z-80 has a 4-bit ALU – here’s how it works

The 8-bit Z-80 processor is famed for use in many early personal computers such the Osborne 1, TRS-80, and Sinclair ZX Spectrum, and it is still used in embedded systems and TI graphing calculators. I had always assumed that the ALU (arithmetic-logic unit) in the Z-80 was 8 bits wide, like just about every other 8-bit processor. But while reverse-engineering the Z-80, I was shocked to discover the ALU is only 4 bits wide! The founders of Zilog mentioned the 4-bit ALU in a very interesting discussion at the Computer History Museum, so it’s not exactly a secret, but it’s not well-known either.

I have been reverse-engineering the Z-80 processor using images from the Visual 6502 team. The image below shows the overall structure of the Z-80 chip and the location of the ALU. The remainder of this article dives into the details of the ALU: its architecture, how it works, and exactly how it is implemented.

Ken Shirrif’s blog is an absolute must for fans of ultra-low-level hardware stuff. This goes way over my head, but interesting nonetheless.

28 Comments

  1. 2013-09-07 11:54 am
    • 2013-09-07 6:36 pm
      • 2013-09-07 7:33 pm
      • 2013-09-08 9:32 am
      • 2013-09-08 12:50 pm
        • 2013-09-08 7:00 pm
          • 2013-09-08 7:52 pm
          • 2013-09-08 8:41 pm
          • 2013-09-09 4:43 pm
          • 2013-09-09 5:15 pm
          • 2013-09-09 6:40 pm
          • 2013-09-09 7:19 pm
          • 2013-09-09 7:36 pm
          • 2013-09-10 7:57 am
          • 2013-09-10 7:16 pm
          • 2013-09-10 8:02 pm
          • 2013-09-12 8:41 pm
  2. 2013-09-07 2:32 pm
    • 2013-09-07 7:19 pm
      • 2013-09-07 8:08 pm
      • 2013-09-08 7:11 am
        • 2013-09-08 12:40 pm
        • 2013-09-09 8:21 pm
        • 2013-09-10 8:51 am
          • 2013-09-10 1:23 pm
    • 2013-09-08 5:32 pm
      • 2013-09-09 11:51 am
  3. 2013-09-08 6:54 pm