Zilog Z80

From Free net encyclopedia

(Redirected from Zilog Z-80)

Image:Zilog Z80.jpg The Zilog Z80 is an 8-bit microprocessor designed and sold by Zilog from July 1976 onwards. It was widely used both in desktop and embedded computer designs as well as for defense purposes. The Z80 and its derivatives and clones make up one of the most commonly used CPU families of all time, and, along with the MOS 6502 family, dominated the 8-bit microcomputer market from the late 1970s to the mid-1980s.

Although Zilog made attempts with 16-bit (Z800 / Z280) and 32-bit (Z380) versions of the 8/16-bit Z80-architecture, these chips never caught on. The company was also trying hard in the workstation market with its Z8000 and 32-bit Z80000 (both technically unrelated to Z80). In recent decades Zilog has concentrated on the ever-growing market for embedded systems, and the most recent CPU family, the 8/16/24-bit eZ80, a fast Z80 with a linear 16 MB address range has been successful.

Contents

History

Image:Z80pinout.png

The Z80 came about when Federico Faggin left Intel after working on the 8080, and by July 1976 Zilog had the Z80 on the market. It was designed to be binary compatible with the Intel 8080 so that most 8080 code could run unmodified on it, notably the CP/M operating system.

The Z80 offered many real improvements over the 8080:

  • An enhanced instruction set including bit manipulation, block move, block I/O, and byte search instructions
  • New IX and IY index registers and instructions for them
  • A vectorized interrupt mode (mode 2), as well as a useful "no hardware"-mode (mode 1)
  • Two separate register files, which could be quickly switched, to speed up response to interrupts
  • A built-in DRAM refresh address mechanism that would otherwise have to be provided by external circuitry
  • Single 5 Volt power supply
  • Fewer support chips required for clock generation and interface to memory and I/O
  • A much lower price

The Z80 quickly took over from the 8080 in the market, and became one of the most popular 8-bit CPUs. Later versions increased in speed from the early models' 2.5 MHz up to as much as 20 MHz.

Perhaps a key to the success of the Z80 was the built-in DRAM refresh, which allowed systems to be built with fewer support chips.

Programming model and register set

The programming model and register set are conventional and similar to many other processors, such as the related x86 family. The 8080 compatible registers AF,BC,DE,HL are duplicated as two separate banks in the Z80, where the processor can quickly switch from one bank to the other; a feature useful for speeding up responses to single level, high priority interrupts. This makes sense as the Z80 (like, for instance, the 6502) was really intended* for embedded use, not for personal computers or the, yet to be invented, home computers.

The 8080 compatible registers:

  • A - 8-bit accumulator
  • F - zero, negative, overflow, carry, and BCD flags
  • BC - two 8-bit registers, or one 16-bit data/address register
  • DE - two 8-bit registers, or one 16-bit data/address register
  • HL - one 16-bit address/data register or two 8-bit registers
  • SP - stack pointer, 16 bits
  • PC - program counter, 16 bits

Registers introduced with the Z80:

  • IX - 16-bit base register for 8-bit offsets
  • IY - 16-bit base register for 8-bit offsets
  • I - interrupt vector register, 8 bits
  • R - DRAM refresh counter**, 8 bits
  • Four bits of interrupt status and interrupt mode status

* According to one of the designers, Masatoshi Shima, the market focus was on high performance printers, high-end cash registers, and intelligent terminals.

** The R register increments each time the CPU fetches data from RAM, and was sometimes useful as a source of pseudorandom numbers and in software protection schemes. Interestingly, while R is an 8 bit register, it wraps around at 128 instead of 256. If the programmer stores a value in the register, its high bit will be preserved regardless of what the CPU does to the remaining 7 bits. Poor implementation of the R register's odd behaviour is a common source of problems when running games for Z80-based machines under emulation.

Instruction set and encoding

The Z80 uses 252 out of the available 256 codes as single byte opcodes; the four remaining codes are used extensively as opcode prefixes; ED and CB enables extra instructions and DD or FD selects IX+d or IY+d (in place of HL). This scheme gives the Z80 a large number of permutations of instructions and registers; Zilog categorizes these into 158 different "instruction types", 78 of which are the same as those of the Intel 8080 (allowed operation of 8080 programs on a Z80). The Zilog documentaion further groups instructions into the following categories:

8-bit load
16-bit load
Exchange, block transfer, and search
8-bit arithmetic and logic operations
General purpose arithmetic and CPU control
16-bit arithmetic
Rotate and shift
Bit set, reset, and test
Jump
Call, return, and restart
Input and output

The bit set, reset, and test instructions are well adapted to I/O control. Instructions takes a minimum of 4 clock cycles to execute, with some of the more complex memory operations taking up to 21 clock cycles; no multiply instruction is available in the original Z80.

In the same manner as the x86 family, but unlike contemporary 8-bit processors, like the Motorola 6800 and Mos Technology 6502, the Z80 and 8080 had a separate control line and address space for I/O instructions. While some Z80-based computers used "Motorola-style" memory mapped input/output devices, usually the I/O space was used to address one of the many Zilog peripheral chips compatible with the Z80. Zilog I/O chips supported the Z80's Mode 3 interrupts which simplified interrupt handling for large numbers of peripherals.

Compatible perpherals

Zilog introduced a number of peripheral parts for the Z80, which all supported the Z80's interrupt handling system and I/O address space. These included the CTC (Counter-Timer-Circuit), the SIO (Serial Input Output), the DMA (DIrect Memory Access), the PIO (Parallel Input-Output) and the DART (Dual Asynchronous Reciever Transmitter). As the product line developed, low-power, high-speed and CMOS versions of these chips were produced.


Second sources, clones, emulation

Image:NEC D780C.jpg Image:T34BM1.jpg

Mostek MK3880 and SGS-Thompson Z8400 (now ST Microelectronics) were both second-sources for the Z80. Sharp and NEC developed clones in NMOS, the LH-0080 and µPD780C respectively. Toshiba made a CMOS-version, the TMPZ84C00, which is believed (but not verified) to be the same design also used by Zilog for its own CMOS Z84C00. There were also Z80-chips marked GoldStar and LG.

In East Germany, an unlicensed clone of the Z80, known as the U880, was manufactured. It was very popular and was used in Robotron's and VEB Mikroelektronik Mühlhausen's computer systems (e.g. the KC85-series) and also in many self-made computer systems (ex. COMP JU+TER).

Also, several fully compatible clones of Z80 were created in the Soviet Union, notable ones being the КP1858ВМ1 (there was an unproven rumor that it contains the East-German U880 chip inside) and T34BM1 (this one contains a real Soviet chip inside). Another Soviet CPU, the KP580ИK80 (later marked as KP580BM80), was a clone of the Z80's predecessor, the Intel 8080. A Z80A Polish clone was also used in the ZX Spectrum clones produced by Polish company Elwro.

In Romania, several Z80 implementations were manufactured: HC85, HC90, HC91, HC2000 (by the Felix Computers Factory, based in Bucharest), CIP-02 and CIP-03 (by the Electronica Factory, located in Bucharest) and TimS (by the Timisoara Technical University).

Today, a functionally equivalent CPU core (T80 & TV80) is available free under a BSD style license as VHDL and Verilog source. The VHDL version, once synthesized, can be clocked up to 35 MHz on a Xilinx Spartan II FPGA. It's often somewhat cheaper to use a more traditional solution, however.

Software emulation of the Z80 instruction set on modern PCs runs faster than the original Z80 CPU ran and is used today for home computer simulators (such as ZX Spectrum) and also for video game emulators such as MAME, which executes 1980s vintage video games.

Notable uses

In desktop computers

During the late 1970s and early 1980s, the Z80 was used in a great number of fairly anonymous business-oriented machines with the CP/M operating system; a CPU/OS combination that dominated the market in much the same way that Windows based machines do today. Two well-known examples of Z80+CP/M business computers are the portable Osborne 1 and the Kaypro series. Manufacturers of such systems included Televideo, Xerox and a number of more obscure firms. Some systems used multi-tasking operating system software to share the one processor between several concurrent users.

Home computers using the Z80 include the following:

For a more comprehensive overview, see the List of home computers using the Z80.

  • The Z80 was also used in the Norwegian Tiki 100 computers, which were the computers of choice in Norwegian primary schools during the late 1980s.
  • The Multitech Microprofessor I, introduced in 1981, was designed as a a simple and inexpensive training system for the Z80 microprocessor. As of 2005, it was still on market.

In embedded systems and consumer electronics

The Zilog Z80 has long been a popular microprocessor in embedded systems and microcontroller cores, where it remains in widespread use today. The following list provides a few examples of such applications of the Z80, including uses in consumer electronics products.

Industrial/embedded:

Consumer electronics:

Sucessors and derivatives

Hitachi developed an enhanced CMOS version, HD64180, which was later second-sourced by Zilog, both as Z64180 and as the slighly modified Z180.

Nintendo's Game Boy and Game Boy Color handheld game systems used a Z80 clone manufactured by Sharp Corporation, which had a slightly different instruction set. The Sharp Z80 in the Game Boy Color is notable for its ability to selectively double its clock speed when running Game Boy Color software.

Some of the index register instructions of the Z80 instruction set were not much fasterTemplate:Ref than equivalent sequences of simpler operations. The 10-year-newer HD64180 / Z180 design had more "chip area", permitting a somewhat more efficient implementation using an additional ALU. However, it is not until 2001 and the advent of the fast pipelined eZ80 that operations involving IX and IY finally becomes nearly as fast as it is technically possibleTemplate:Ref to make them.

The ill fated NMOS Z800 and CMOS Z280 were quite fast Z80-implementations (before the HD64180 / Z180), but the Z280 was too mini-computer inspired and too complex to be a natural choice for most embedded applications. In contrast, the plain CMOS Z80 has remained popular, along with the compatible Z180 and eZ80 families.

See also

Notes

  1. Template:Note The Sinclair ZX80 and -81, and some ZX Spectrums, were equipped with the NEC μPD780C clone of the Z80.
  2. Template:Note This represented no severe problem however, as they could often save space if not time.
  3. Template:Note Given the fixed Z80 encodings and an 8-bit databus with one fetch per cycle.

External links

References

Zilog Components Data Book, Zilog, Campbell California, 1985, no ISBN


ZiLOG processors Compatibles

Z80 series: Z80 | Z180 | Z280 | Z380 | Z800 | eZ80
Z8000 series: Z8000 | Z80,000 | Microcontroller: Z8

Z80 series: NEC uPD780C | Sharp LH-0080 | T34
ASCII R800 | U880

cs:Z80

da:Z80 de:Zilog Z80 es:Zilog Z80 fr:Zilog Z80 ko:자일로그 Z80 id:Zilog Z80 it:Zilog Z80 nl:Z80 (processor) ja:Z80 nn:Zilog Z80 pl:Zilog Z80 pt:Z-80A ru:Zilog Z80 sk:Zilog Z80 fi:Zilog Z80 sv:Zilog Z80