Microprogram



A microprogram is a special type of computer program that implements a CPU instruction set. As is known, each high level language command is compiled to a series of machine language instructions. After this, each instruction is implemented by a set of many microinstructions, which together form what is called a microprogram. Microcode is the common term used for a microprogram. Microcode exists in a special high speed memory and is typically written by the CPU engineer while designing the processor. Microcode allows one computer microarchitecture to emulate another architecture, which is often more complicated than the current.

The main aim of microprograms is to achieve the fastest possible execution as a slow microprogram means a slow machine instruction which translates to slow programs. Programming of a microprogram requires in-depth knowledge of low-level hardware and computer circuitry. Microprograms maybe stored in ROM or RAM. They are then called a control store.

History of Microprograms

Control stores were first introduced in 1947 in the design of the Whirlwind computer to simplify computer design and move beyond ad hoc methods. The control store propsed hence was a two-dimensional lattice. It was more like a player piano roll which controlled a sequence of wide words constructed of bits which are played one by one.

Maurice Wilkes, in 1951, enhanced the concept of control stores as given by the Whirwind proposal. He added to it a conditional execution which is similar to a conditional in computer software. It was Wilkes who coined the term microprogramming for this feature of a processor.

Why use microprograms

Before the advent of microcode, all instruction sets for a CPU were hard-wired, i.e., each instruction was implemented on the circuit itself, rather than in a software form. This kind of implementation led to fast performance. But when the instruction sets grew more complex, it became impossible to have all the sets hard-wired, leave alone debug them.

Microcode was helpful to remove this problem. It made it possible for CPU design engineers to write a microprogram to implement a machine instruction instead of doing the cumbersome job of designing circuitry. Microcode was easy to change and debug at any point or stage in the design process without having to change the design itself. This directly had an impact on productivity as time taken to desing a new processor was reduced significantly.

Microprogramming also helped solve the problem of memory bandwidth. During the 1970s, CPU speeds grew more quickly than memory speeds os much so that they outrunned them. Numerous acceleration techniques were developed such as memory block transfer and memory pre-fetch etc. that reduced this. However, it was high level machine instructions which were now possible due to microcode that changed the way things were going.

The IBM System/360
and DEC VAX family used complex microprograms. The IBM System/38 and AS/400 revolutionized the concept even further.

The best thing about microprogramming as probably that it reduced the cost of correcting defects in code which required replacing a particular part of the microcode instead of the whole wiring.