Why the Z-80's Data Pins Are Scrambled
An anonymous reader writes "The Z-80 microprocessor has been around since 1976, and it was used in many computers at the beginning of the PC revolution. (For example, the TRS-80, Commodore 128, and ZX Spectrum.) Ken Shirriff has been working on reverse engineering the Z-80, and one of the things he noticed is that the data pins coming out of the chip are in seemingly random order: 4, 3, 5, 6, 2, 7, 0, 1. (And a +5V pin is stuck in the middle.) After careful study, he's come up with an explanation for this seemingly odd design. "The motivation behind splitting the data bus is to allow the chip to perform activities in parallel. For instance an instruction can be read from the data pins into the instruction logic at the same time that data is being copied between the ALU and registers.
[B]ecause the Z-80 splits the data bus into multiple segments, only four data lines run to the lower right corner of the chip. And because the Z-80 was very tight for space, running additional lines would be undesirable. Next, the BIT instructions use instruction bits 3, 4, and 5 to select a particular bit. This was motivated by the instruction structure the Z-80 inherited from the 8080. Finally, the Z-80's ALU requires direct access to instruction bits 3, 4, and 5 to select the particular data bit. Putting these factors together, data pins 3, 4, and 5 are constrained to be in the lower right corner of the chip next to the ALU. This forces the data pins to be out of sequence, and that's why the Z-80 has out-of-order data pins."
[B]ecause the Z-80 splits the data bus into multiple segments, only four data lines run to the lower right corner of the chip. And because the Z-80 was very tight for space, running additional lines would be undesirable. Next, the BIT instructions use instruction bits 3, 4, and 5 to select a particular bit. This was motivated by the instruction structure the Z-80 inherited from the 8080. Finally, the Z-80's ALU requires direct access to instruction bits 3, 4, and 5 to select the particular data bit. Putting these factors together, data pins 3, 4, and 5 are constrained to be in the lower right corner of the chip next to the ALU. This forces the data pins to be out of sequence, and that's why the Z-80 has out-of-order data pins."
Why didn't they just ask Federico Faggin? According to Wikipedia, he's still alive.
Too bad no company ever came up with a killer 8-bit machine. Z80 CPU, more than 64 kB RAM, sound and graphics like SID and VIC-II.
Really? Ever heard of MSX? See: http://en.wikipedia.org/wiki/M...
It came with graphics, sprites (TMS9918/9929) and was a standard design carried by several manufacturers.
To Terminate, or not to Terminate, that's the question - SCSIROB
Too bad no company ever came up with a killer 8-bit machine. Z80 CPU, more than 64 kB RAM, sound and graphics like SID and VIC-II.
Really? Ever heard of MSX? See: http://en.wikipedia.org/wiki/M... It came with graphics, sprites (TMS9918/9929) and was a standard design carried by several manufacturers.
Ah, MSX... weirdest computers in history. The Yamaha MSX computer was an awesome music computer with built in FM synthesis, and then you had the vastly different Spectravideo MSX, it was fully compliant with the MSX standard...but it's just that, not everyone was compliant - every MSX computer seemed to be a special variant of itself, something that confused me something so fierce back in the days, I even had a Memotech MSX, weird WEIRD computer.
:)
The games on the MSX computers wasn't mind blowing, nowhere near the commodore 64 games, it simply lacked the awesome sound capabilities of the 64. They had a wider color range though.
I remember the war between us Commodore users (65xx type processors) vs the Z80 series, yes - the Z80 was a far superior processor in many ways and sometimes I wished we had that processor just for the extended registers alone, not to mention that the speed was 4 mhz instead of our meager 0.97mhz (could be doubled if you turned off the screen). But the hardware sprites & scrolling is what beat the living bejeezus outta the other competing products.
And I nearly cried snot when the Commodore 65 didn't make it. It was a super-cool Commodore 64 with beefed up hardware, higher resolution, stereo SID sound (6 channels!) of pure ring-modulated goodness.
Ah, I'll go stare at my stash of Z0840004PSC, 27xxxx's and the rest of the Chip Pron in my vast land of NOS components...aaaahh..
What this world is coming to - is for you and me to decide.
And then Commodore went on to (half inherit, half design) the Amiga. Maybe "cobbled together" is too harsh for it, but still. Floppy controller that can decide, per track, whether to work in MFM or RLL (but not read a single sector, mind you), more DMA channels than the CPU can handle, and a display processor with a built-in three commands machine language (one of which was only ever used by one application ever) to change display resolution mid-monitor.
I loved it, but the Amiga gave the impression that it was designed by engineers that couldn't make up their mind on what choice to make, so they created hardware that would offload all decisions to software.
One last anecdote. Many have heard of the famous "Guru meditation". What only Amiga users know is that you knew one was coming because the power led would blink three times. Yes, the power led was software controlled, making the Amiga the first ever computer that could play dead.
Shachar
It looks like the firing order for an 8 cylinder engine. I thought maybe the engineer tasked with that pin out was moonlighting in a garage somewhere.
Damn_registrars has no butt-hole. Damn_registrars has no use for a butt-hole.
The Z80 was used every time the C128 was turned on. It was added specifically to work around a compatibility issue with the C64 and one single, solitary, cartridge (Magic Voice) for the C64. To make it work, Bill Herd added the Z80, It would start (at address 0x0000), run a handful of instructions that initialised the C128 hardware, and then started the 8502 proper. (The Spectacular Rise And Fall Of Commodore, pg. 368)