CSC232 Chp5 Proc Design (Compatibility Mode)
CSC232 Chp5 Proc Design (Compatibility Mode)
and Architecture
1.9
5.1 CPU Basic
1.11
5.1 CPU Basic
1.16
5.2 Register Set
• Condition Registers
– Condition registers, or flags, are used to
maintain status information.
– Some architectures contain a special Program
Status Word (PSW) register.
– The PSW contains bits that are set by the CPU
to indicate the current status of an executing
program.
– These indicators are typically for arithmetic
operations, interrupts, memory protection
1.19information, or processor status.
5.2 Register Set
– Stack Pointer:
• A stack is a data organization mechanism in which the last
data item stored is the first data item retrieved.
• Two specific operations can be performed on a stack. These
are the Push and the Pop operations.
• A specific register, called the stack pointer (SP), is used to
indicate the stack location that can be addressed.
• In the stack push operation, the SP value is used to indicate
the location (called the top of the stack).
• After storing (pushing) this value, the SP is incremented (In
some architectures a SP is decremented (i.e. x86) as the
stack grows low in memory).
1.21
5.2 Register Set
80x86 Registers
– the Intel basic programming model of the 386, 486 and
the Pentium consists of three register groups:
• General-purpose registers,
• Segment registers, and
• The instruction pointer (program counter) & the flag
register.
1.22
5.3 Datapath
1.24
5.3 Datapath
– One-Bus Organization
– Using one bus, the CPU registers and the ALU
use a single bus to move outgoing and
incoming data.
– Since a bus can handle only a single data
movement within one clock cycle, two-operand
operations will need two cycles to fetch the
operands for the ALU.
– Additional registers may also be needed to
buffer data for the ALU.
1.25
5.3 Datapath
1.26
5.3 Datapath
1.27
5.3 Datapath
– Two-Bus Organization
– Using two buses is a faster solution than the one bus.
– General-purpose registers are connected to both
busses.
• Data can be transferred from two different registers
to the input point of the ALU at the same time.
– A two-operand operation can fetch both operands at
the same clock cycle.
– Additional buffer register may hold the output of the
ALU when the two busses are busy carrying the
1.28two operands.
5.3 Datapath
1.30
5.3 Datapath
1.31
5.3 Datapath
• Three-Bus Organization
– Two buses may be used as source busses while the third is
used as destination.
– The source busses move data out of registers (out-bus), and
the destination bus may move data into a register (in-bus).
– Each of the two out-busses is connected to an ALU input
point.
– The output of the ALU is connected directly to the in-bus.
– The more busses we have, the more data we can move
within a single clock cycle.
– However, increasing the number of busses will also increase
the complexity of the hardware.
1.32
5.3 Datapath
1.33
5.4 CPU Instruction Cycle
1.34
5.4 CPU Instruction Cycle
1.35
5.4 CPU Instruction Cycle
1.36
5.4 CPU Instruction Cycle
• Fetch Instructions
– The sequence of events in fetching an instruction can
be summarized as follows:
• The contents of the PC are loaded into the MAR.
• The value in the PC is incremented. (This operation
can be done in parallel with a memory access).
• As a result of a memory read operation, the
instruction is loaded into the MDR.
• The contents of the MDR are loaded into the IR.
1.37
5.4 CPU Instruction Cycle
1.38
5.4 CPU Instruction Cycle
1.39
5.4 CPU Instruction Cycle
1.41
5.3 Datapath
1.42
5.4 CPU Instruction Cycle
1.43
5.3 Datapath
1.44
5.4 CPU Instruction Cycle
1.45
5.3 Datapath
1.46
5.4 CPU Instruction Cycle
1.47
5.3 Datapath
1.48
5.4 CPU Instruction Cycle
1.50
5.4 CPU Instruction Cycle
1.51
5.4 CPU Instruction Cycle
1.52
5.4 CPU Instruction Cycle
1.53
5.4 CPU Instruction Cycle
• Interrupt Handling
• After the execution of an instruction, a test is performed to
check for pending interrupts.
• If there is an interrupt request waiting, the following steps
take place:
• The contents of PC are loaded into MDR (to be saved).
• The MAR is loaded with address at which the PC contents
to be saved.
• The PC is loaded with the address of the first instruction of
the interrupt handling routine.
• The contents of MDR (old value of the PC) are stored in
memory.
1.54
5.4 CPU Instruction Cycle
1.55
5.5 Control Unit
1.59
5.5 Control Unit
– Hardwired
• Fixed logic circuits that correspond directly to the
Boolean expressions are used to generate the
control signals.
• Hardwired control is more economical for small
control units.
• It should also be noted that microprogrammed
control could adapt easily to changes in the
system design.
• We can easily add new instructions without
1.61changing hardware.
5.5 Control Unit
1.63
5.5 Control Unit
1.65
5.5 Control Unit
1.66
5.5 Control Unit
1.67
5.5 Control Unit
1.69
5.5 Control Unit
• Hardwired Implementation
• In hardwired control, a direct implementation is
accomplished using logic circuits.
• For each control line, one must find the Boolean expression
in terms of the input to the control signal generator.
• Assume that the instruction set of a machine has three
instructions: Inst-x, Inst-y, and Inst-z; and A, B, C, D, E, F,
G, and H are control lines. The following table shows the
control lines that should be activated for the three
instructions at the three steps t0 , t1 , and t2 .
1.70
5.5 Control Unit
1.71
5.5 Control Unit
1.72
5.5 Control Unit
1.73
5.5 Control Unit
1.74
5.5 Control Unit
1.75
5.5 Control Unit
1.76
5.5 Control Unit
1.78
5.5 Control Unit
1.79
5.5 Control Unit
1.80
5.5 Control Unit
1.81
5.5 Control Unit
1.82
5.5 Control Unit
1.83
5.5 Control Unit
1.84
5.5 Control Unit
1.85
5.5 Control Unit
1.86
5.6 Summary
1.88
5.6 Summary
1.89