Title: MICROPROGRAMMING
1MICROPROGRAMMING
2WHAT IS MICROPROGRAMMING?
-
- A microprogram is a highly-specialized
computer program that allows one computer
microarchitecture to emulate another, usually
more-complex architecture. The microprogram is
usually very small compared to ordinary software,
hence its name. It is also very carefully
designed and optimized for the fastest possible
execution. As with any computer program,
microprograms consist of series of
microinstructions. These microinstructions
usually control the computer's CPU at a very
fundamental level.
3MICROINSTRUCTIONSWhile a real
instruction might be something like 'add the
contents of registers A and B', a
microinstruction might be something like 'write
out register A to bus Z', or 'read data bus into
register X' - very basic actions that could be
assembled to implement the actual instruction set
of the machine. To simultaneously control of many
features, the microinstruction is often very
wide, for example, 100 bits or more.
4 MICROPROGRAMMED CONTROL UNIT (fig. 1)
5HOW IT WORKS?
- The microinstruction is fetched from the ROM and
placed in the microinstruction register where it
is decoded. Some of the bits of the
microinstruction are used for sequencing that
is, they determine the location of the next
microinstruction and are able to implement
conditional branches. - Some of the bits in the microinstruction register
are used to control the CPU. The "address mapper"
in figure 1 converts the bit pattern of the
machine level microinstruction into the first
address of the microprogram that interprets it.
6HORIZONTAL VS VERTICAL
MICROCODEA typical micromachine's control
word has a field, a range of bits, to control
each piece of electronics in the CPU. For
example, one simple arrangement might be
register source A register source B
destination register arithmetic and logic unit
operation type of jump jump address The
above is an example of "horizontal" microcode.
This is microcode that sets all the bits of the
CPU's controls on each tick of the clock that
drives the sequencer. Many of the bits in
horizontal microcode contain fields to do nothing.
7Some CPUs use a completely
different design called "vertical" microcode to
reduce cost. It has two fields field select
field value The "field select" selects which
part of the CPU will be controlled by this word
of the control store(the memory in which the
CPUs microcode resides). The "field value"
actually controls that part of the CPU. With this
type of microcode, a designer explicitly chooses
to make a slower CPU to save money by reducing
the unused bits in the control store however,
the reduced complexity may increase the CPU's
clock frequency, which lessens the effect of an
increased number of cycles per instruction.
8WHY MICROPROGRAMMING?
- Without microprogramming, each computer has to be
constructed from digital circuits that are
specifically designed to execute the machine code
instructions. Such a design is specific to a
particular architecture and organization. - Microprogramming is a general technique that can
be applied to any computer. Because the
microprogrammed control unit is such a regular
structure, it was possible to develop formal
methods for the design of microprograms and to
construct tools to aid the creation, validation,
and testing of microprograms.
9- Microprogramming made it possible to totally
divorce architecture from organization. By means
of a suitable microprogram you could impose any
architecture on the simplest of CPUs.In
practical terms, a company could design a
powerful architecture that, for example,
supported high-level languages and operating
systems and then use microprogramming to
implement this architecture on a range of
machines.
10ADVANTAGE OF MICROPROGRAMMING
- In the mid 1970s by using a writeable
microprogram control store users could implement
their own instructions or dynamically change the
architecture of the computer. If you changed your
architecture you could still run your old
programs on the your new microprogrammed machine
by emulating the old architecture in microcode.
Machine emulation was very important at a time
when computers cost hundreds of thousands of
dollars and the software base was very small. - One of the advantages of microprogrammed
architectures is their flexibility and ease of
implementation. -
11- Another advantage is their efficient use of
memory. In 1970 main store random access memory
was both slow and expensive. By implementing
complex-instruction architectures, the size of
programs could be reduced to minimize memory
requirements. Control store was much faster than
main memory and it paid to implement machine
level instructions in microcode. - By the 1980s the cost of memory had dramatically
reduced and its access time had dropped to 100
ns. Under such circumstances, the microprogrammed
architecture lost its appeal.
12CHANGES
- Much has changed, since the first
microprogramming was introduced ROM, which was
used to hold the microinstructions is no longer
faster than RAM, which holds the machine language
program Instruction set have become much
simpler leading to reduced complexity in
control Microprogramming is used today to
implement some parts of a complex instruction
set, such as a Pentium. -
13Thank You !Konrad Majka