Wehave discussed the common fetch sequence in previous lectures.
Wehave given both the sequence of microoperations and the corresponding sequenceof control signals. Remember that memorytimings restrict access to memory during the
(Fetch, T1) time slot, so we elect to update the Program Counter during thistime.
Fetch,T0: (PC)
Fetch,T1: (PC)
Fetch,T2: (MBR)
This lecture focuses on theimpact of incrementing the program counter on
Itis immediately obvious that the ALU must have either an addition operation oran increment (add 1) operation. Forsimplicity, the design uses a simple addition operation, associated with thecontrol signal“add”.
Wehave always assumed that the CPU has three internal data busses.
We now show why such aconfiguration is desirable.
Recallthat the ALU itself has two inputs and one output.
Weconsider how to create a bus structure for the CPU that will make efficient
use of this ALU. For this discussion, wefocus on the addition operation
associated with updating the PC (Program Counter).
Thesimplest design for the CPU calls for one common internal bus.
Therestriction that only one binary data set can be on a single bus at
any given time gives rise to severe timing problems.
Specifically,it will take two clock pulses to put the two arguments (PC and 1
on the bus and one clock pulse to transfer the updated value to the PC.
Thisone–bus design calls for two holding registers, here called “Y” and “Z”.
T1:
T2:
T3:
Theaddition takes three clock pulses.
Itis easy to show that a 2–bus design requires
two clock pulses to perform the addition.
Withthis structure, the CPU can complete the addition in one clock cycle.
Thisexample is only one case in which the CPU design is considerably simplified
by having a three bus structure.
It can be seen that havingthree internal busses only modestly increases the design
complexity of the CPU. This is considereda good trade–off.
Thedesign of the CPU calls for it to have three internal busses.
Theseare called B1, B2, and B3.
B1and B2 serve as input busses for the ALU.
B3serves as an output bus for the ALU.
This design can be seenin another light.
B1and B2 are the only busses to which any register can transfer data directly.
B3is the only bus that can transfer data directly to any register.
The protocol forregister–to–register transfer becomes as follows:
1.
2.
3.
Thisimplies two additional ALU control signals:tra1and tra2
Let’s repeat the common fetchsequence and examine it for more requirements.
Fetch, T0:
Fetch, T1:
Fetch,T2: (MBR)
T0:
tra1 to the ALU. The READcontrol signal goes to the memory interface.
T1:
T2:
My earlier designs required thatthe Memory Buffer Register and Instruction
Register be assigned to differentbusses, so this design reflects that.
Thestructure of the IR (Instruction Register) calls for bits to be sent directlyto the Control Unit and bits to be sent to the bus B1.
Wefocus on the twenty lower order bits of the IR: IR19 – IR0.
Insome instructions these bits IR19 – IR0 form an addressfor accessing memory.
Insome instructions these bits IR19 – IR0 are interpretedas an immediate operand,
either a 20–bit (five hexadecimal
or a 20–bit two’s–complementsigned integer.
Insome instructions, bits IR19– IR17 are part of the instruction and
bitsIR16 – IR0 are not used.
Inany case, provision is made to transfer only bits IR19 – IR0to bus B1.
Thistransfer is enabled by the signal IR
Twoof the immediate instructions, LDI and ADDI, require the contents of bits IR19– IR0 to be sign extended and treated as a 32–bit two’s–complementinteger.
Theother instructions that use bits IR19 – IR0 treat them asan unsigned integer.
Tohandle this we have a control signal“Extend”,which is emitted by the control unit.
Hereis a representation of the transfer mechanism for the IR.
Controlsignals are Boolean signals with two values:
Eachcontrol signal is labeled by the action that it enables.
It mightbe called IR19–0® B1
be signextended.
Controlsignals that enable data transfers to either bus B1 or bus B2 will take
effect by enabling a tri–state buffer. The IR is one of many possible inputs to B1.
Hereis a schematic that shows the basic processes associated with the transfer.
TheControl Unit emits both signals (Extend and IR
Inthis version of the design, the CPU has eight general–purpose registers.
They are oftenused as index registers.
Eachof these eight registers can output to either bus B1 or bus B2.
BusB3 can place data into any of the seven registers R1 – R7, but is not connectedto R0.
Hereis the complete register set and bus structure for the CPU.
Thereare only three control signals emitted by the Control Unit that enable thesetransfers. These are:
Wenow ask how each of these registers is selected.
TheControl Unit uses three selector registers, each based on bit fields in the IR.
The generation of these selector registers will be discussed later.
when B3
Eachof the signals B1S and B2S is the control input to an 8–to–1 multiplexer thatoutputs to a bus through a tri–state buffer enabled by the appropriate controlsignal.
The signal B3D is the 3–bitinput to an active–high 3–to–8 decoder that is
enabled by the control signal B3
Transfer to a register.
Whencontrol signal B3® R is asserted, the 3–to–8 decoder is activated and asserts the clockinput of all flip–flops associated with the selected register.
Eachflip–flop associated with the selected register takes input from its bit lineon B3.
Output0 of the decoder is not connected to any register, so that asserting
B3® R when B3D = 000 has noeffect.
IfB3® R is not asserted, alldecoder outputs are 0 and nothing happens.
Notethat the selector registers B1S and B2S always have values, so that the outputof the multiplexer associated with each bus always copies some general–purposeregister.
Whencontrol signal R® B1 is asserted the selected register is output to bus B1.
If it is not asserted, either B1 is not active or a special purpose register isfeeding it.
Whencontrol signal R® B2 is asserted the selected register is output to bus B2.
If it is not asserted, either B2 is not active or a special purpose register isfeeding it.
Itis expected that the two signals R