Microprocessor Design/Wire Wrap

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Historically, most of the early CPUs were built by attaching integrated circuits (ICs) to circuit boards and wiring them up.

Nowadays, it's much faster to design and implement a new CPU in a FPGA -- the result will probably run faster and use less power than anything spread out over multiple ICs.

However, some people still design and build CPUs the old-fashioned way. Such a CPU is sometimes called a "home brew CPU" or a "home built CPU".

Some people feel that physically constructing a CPU in this way, since it allows students to probe the inner workings of the CPU, it helps them "Touch the magic"[1], helps them learn and understand the underlying electronics and hardware.

Contents

[edit] Overview

(FIXME: How do I get the picture from http://en.wikipedia.org/wiki/Image:YUNTEN.gif to show up here?)

A homebrew CPU is a central processing unit constructed using a number of simple integrated circuits, usually from the 7400 Series. When planning such a CPU, the designer must not only consider the hardware of the device but also the instructions the CPU will have, how they will operate, the bit patterns for each one, and their mnemonics. Before the existence of computer based circuit simulation many commercial processors from manufacturers such as Motorola were first constructed and tested using discrete logic (see Motorola 6809).

Although no limit exists on data bus sizes when constructing such a CPU, the number of components required to complete a design increases exponentially as bus size gets wider. Common physical data bus sizes are 1-bit, 4-bits, 8-bits, and 16-bits, although incomplete design documents exist for a 40-bit CPU.

A microcoded CPU may be able to present a significantly different instruction set to the application programmer than seems to be directly supported by the hardware used to implement it. For example, the 68000 presented a 32-bit instruction set to the application programmer -- a 32-bit "add" was a single instruction -- even though internally it was implemented with 16-bit ALUs.

For example, w:serial computers, even though they do calculations one bit per clock cycle, present a instruction set that deals with much wider words -- often 12 bits (PDP-14), 24 bits (D-17B), or even wider -- 39 bits (Elliott 803).


Notable Homebrew CPUs

The Magic-1 is a CPU with an 8-bit data bus and 16-bit address bus running at about 3.75MHz. [2]

The Mark I FORTH also has a 8-bit data bus and 16-bit address bus, but runs at 1MHz. [3]

The V1648CPU is a CPU with a 16-bit data bus and 48-bit address bus that is currently being designed. [4]

[edit] Parts

...

[edit] Tools

...

[edit] Design Tips

There are many ways to categorize CPUs. Each "way to categorize" represents a design question, and the various categories of that way represent various possible answers to that question that needs to be decided before the CPU implementation can be completed.

One way to categorize CPU that has a large impact on implementation is: "How many memory cycles will I hold one instruction before fetching the next instruction?"

  • 0: load-instruction on every memory cycle (Harvard architecture)
  • 1: At most 1 memory cycle between each load-instruction memory cycle ( load-store architecture )
  • more: some instructions have 2 or more memory cycles between load-instruction memory cycles (memory-memory architecture)

Another way to categorize CPUs is "Will my control lines be controlled by a flexible microprogramming, a fixed control store, or by hard-wired control decoder that directly decodes the instruction?"

The load-store and memory-memory architectures require a "instruction register" (IR). At the end of every instruction (and after coming out of reset), the next instruction is fetched from memory[PC] and stored into the instruction register, and from then on the information in the instruction register (directly or indirectly) controls everything that goes on in the CPU until the next instruction is stored in the instruction register.

For homebrew CPUs, the 2 most popular architectures are[citation needed]:

  • direct-decode Harvard architecture
  • flexible microprogramming that supports the possibility of memory-memory architecture.

[edit] Harvard architecture

The simplest kinds of CPU control logic use the Harvard architecture. However, Harvard architecture requires 2 separate storage units -- the program memory and the data memory. Some Harvard architecture machines, such as "Mark's TTL microprocessor", don't even have an instruction register -- in those machines, the address in the program counter is always applied to the program memory, and the data coming out of the program memory directly controls everything that goes on in the CPU until the program counter changes. With these machines, storing new programs into the program memory becomes a bit tricky.

[edit] microcode architecture

See Microprocessor Design/Microcodes.

[edit] Assembly Tips

...

[edit] Programming Tips

...

[edit] Further Reading

  1. "Touch the magic. By this I meant to gain a deeper understanding of how computers work" -- Bill Buzbee [1]