Microprogramming
Microprogramming
+ Lecture 7
Microprogramming
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Registers for Memory Operations
This is a
typical
CPU RAM diagram of
a computer
The processor system.
communicates
with RAM along
the System Bus
Values are
retrieved and Other
Mouse Display
stored by being Keyboard … Peripheral
transferred along
the System Bus
Registers for Memory Operations
CPU RAM
This bus is
actually three
Data bus carries
buses:
the values (data)
that are
stored/retrieved
Address bus carries a to/from memory.
value that is the
location in memory
where the data is to be Control bus carries signals to memory to
stored/retrieved from. indicate the type of memory operation that
is being requested. Also carries signals
from memory to the processor.
Registers for Memory Operations
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0
F1 F0 OUTPUT
0 0 A
0 1 B
1 0 B+1
Step 1 - Send Read Step 2 - Move 1 1 A + B (SUM)
signal to memory value in MDR to D1
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0
0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0
0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
2 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0
0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0
3 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0
4 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 1 1 0
5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
8 8
MDR
To RAM
Control In PC Out
8
Unit 8 8
IR
8
Control Unit what to do 8
8
D1 8
.
D0 Out
0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0
0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0
0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0
1. The value in the PC is sent through the ALU and stored in the MAR. The MAR now has the
address of the next instruction that is to be fetched from memory.
2. A Read signal is sent to memory. Memory will respond (after 1 clock cycle) by placing a value
on the data bus, to be stored in the MDR. At the same time the value in the PC is sent
through the ALU, incremented by 1 and stored back into the PC. The next instruction that
the processor fetches will be the one following the one that is now being fetched.
3. The instruction from memory has arrived in the MDR. The bits in the instruction are
transferred from the MDR to the Instruction Register (IR).
Instruction Fetch
▪ Once the instruction has been fetched the processor must determine
what “command” the instruction gives.
▪ This is referred to as decoding the instruction.
▪ The bits in the instruction are a code that the processor decodes.
▪ Instruction Decode is carried out by the processor’s Control Unit.
▪ This can be quite complex but will usually involve the controller selecting
a specific micro-routine that carries out the requested operations.
▪ For example, if the instruction is ADD X, Y, Z then the micro-routine that
was discussed earlier will be selected.
Instruction Fetch
microinstruction is stored in a D2
Sequencer
….
MDR
D2
….
1. Sequencer sends an F1
…
4 0010 0000
5 0010 0001
Microinstructions that
6 0010 0010
carry out the instruction
7 0010 0011
ADD X,Y,Z 8 0010 0100