Week 5
Week 5
10 A Simple Program (1 of 3)
LOADI X STOREI X
4.12 Extending Our Instruction Set
(3 of 6)
ADDI X
4.12 Extending Our Instruction Set
(4 of 6)
Another helpful programming tool is the use of subroutines.
The jump-and-store instruction, JNS, gives us limited
subroutine functionality. The details of the JNS instruction are
given by the following RTL:
/This example illustrates the use of a simple subroutine to double the value stored at X
ORG 100
Load X / Load the first number to be doubled.
Store Temp / Use Temp as a parameter to pass value to Subr.
JnS Subr / Store the return address, and jump to the procedure.
Store X / Store the first number, doubled
Load Y / Load the second number to be doubled.
Store Temp
JnS Subr / Store the return address and jump to the procedure.
Loop, Store Y / Store the second number doubled.
Halt / End program.
X, DEC 20
Y, DEC 48
Temp, DEC 0
MARIE Assembly Program: Example 4.5
MAR X
MBR M[MAR]
AC AC + MBR
After an Add instruction is fetched, the address, X, is in
the rightmost 12 bits of the IR, which has a datapath
address of 7.
X is copied to the MAR, which has a datapath address of 1.
Thus we need to raise signals P0, P1, and P2 to read from
the IR, and signal P3 to write to the MAR.
4.13 A Discussion on Decoding (8 of 21)
instruction:
P3 P2 P1 P0 T3 : MAR X
P4 P3 T4 MR : MBR M[MAR]
Cr A0 P5 T5 LALT : AC AC + MBR
[Reset counter]
These signals are ANDed with combinational logic to
bring about the desired machine behavior.
The next slide shows the timing diagram for this
instruction.
4.13 A Discussion on Decoding (9 of 21)
Notice the concurrent signal states
during each machine cycle: C3
through C5.
P3 P2 P1 P0 T3 : MAR X
P4 P3 T4 MR : MBR M[MAR]
Cr A0 P5 T5 LALT : AC AC + MBR
[Reset counter]
4.13 A Discussion on Decoding
(10 of 21)
We note that the signal pattern just described is the
same whether our machine used hardwired or
microprogrammed control.
In hardwired control, the bit pattern of machine
instruction in the IR is decoded by combinational
logic.
The decoder output works with the control signals
of the current system state to produce a new set of
control signals.
= 0011 instruction.
4.13 A Discussion on Decoding
(15 of 21)
architecture.
Speed enhancing features include:
Hyperthreading
Hyperpipelining
Wider instruction pipeline
Execution trace cache (holds decoded instructions for
possible reuse) multilevel cache and instruction pipelining.
Intel, along with many others, is marrying many of the
ideas of RISC architectures with microprocessors that
are largely CISC.
4.14 Real-World Architectures (6 of 7)