Open main menu
102728136 be03b53723 z.jpg

Motorola processor which existed around the same time as the Intel 486. The 68040 was used in Macintosh models such as the "Quadra" line along with the Amiga 4000. A lower cost version without the FPU exists as the Motorola 68LC040.

The MC68040 microprocessor is the most powerful member of the 68000 family, with performance approximately three times that of an MC68030 with the same clock speed. While the MC68040 is upwardly compatible with application software written for the MC68020 and MC68030, it also has many new features that contribute to its increased processing power. The new features of the MC68040 include

  • a redesigned and optimized integer unit
  • a built-in floating-point unit (FPU)
  • built-in memory management units (MMUs), one for instructions and one for data
  • built-in instruction and data caches, 4 KB each

The MC68040 is different in many ways from the MC68020 and MC68030. For example, the MC68040’s built-in FPU is not the same as the MC68881 FPU; similarly, the built-in MMU is not the same as the MC68851 MMU or the built-in MMU in the MC68030. Also, the instruction and data caches in the MC68040 use a new mode called CopyBack mode. That mode is different from the WriteThru mode used by the caches in the MC68020 and MC68030 microprocessors. CopyBack mode improves performance because the processor may write to a memory location several times before the data must be flushed from the cache. Operating in CopyBack mode can increase the processor’s performance by up to 50 percent but also requires the operating system to manage some types of data more carefully.

The difference between WriteThru and CopyBack modes is the way they deal with data being written to memory. When the processor executes a write cycle, it first writes the data into the cache. After that, the two modes are different. In WriteThru mode, the cache writes the data to main memory immediately. In CopyBack mode, the cache does not update main memory each time data is written to the cache. Instead, the cache writes the data to main memory when that portion of the data cache is selected for replacement or when the data cache is flushed.

It has always been important to flush the caches on the MC68020 and MC68030 microprocessors before executing instructions that were recently written to memory. On the MC68040, flushing only the instruction cache in this situation is not sufficient. The instruction and data caches are independent of each other, and there is a strong possibility that the instruction cache will fill with old data from RAM while the new data has not yet been written to RAM from the data cache.

Unlike the previous processors in the 68000 family, the MC68040 handles exceptions by the method called instruction restart. The processor recognizes exceptions at each instruction boundary in the execute stage of the integer pipeline and forces later instructions that have not yet reached the execute stage to be aborted. Also, the MC68040 creates some new exception stack frames, including those for its version of bus errors, which are called access errors.

Further Reading