COA Module 3 PART 2
COA Module 3 PART 2
COA Module 3 PART 2
org
Basic Computer
Organization and Design
Computer Organization & Architecture - MODULE 3
PART 2
Instruction Cycle
Instruction Cycle
● Initially, the program counter PC is loaded with the address of the first instruction in the
program.
● SC is cleared to 0, providing a decoded timing signal T0.
● After each clock pulse, SC is incremented by one, so that the timing signals go through a
sequence T0, T1, T2, and so on.
● The microoperations for the fetch and decode phases are
○ T0: AR ← PC
○ T1: IR ← M [AR], PC ← PC+1
○ T2: D0,. . . , D7 ← Decode IR(12–14), AR ← IR(0-11), I ← IR(15)
Fetch & Decode
● During time T3, the control unit determines the type of instruction that was just read from
memory.
● Memory Reference Instructions
○ If D7=0, the op-code will be 000 through 110
○ If D7 =0 and I =1 - memory reference instruction with an indirect address.
○ The micro-operation for the indirect address condition can be symbolized by
AR ← M [AR].
● Register Reference or I/O Instructions
○ If D7 =1 and I=0 - Register Reference Instruction.
○ If D7 =1 and I=1 - I/O Instruction.
● The three instruction types are subdivided into four separate paths.
● The selected operation is activated with T3.
○ D7’ IT3 : AR ← M[AR].
○ D7’ IT3 : Nothing.
○ D7 I’T3 : Execute a register-reference instruction.
○ D7 IT3 : Execute an input–output instruction.
Memory Reference Instruction
Memory Reference Instruction
● Performs AND logic operation on pairs ● Adds the content of the memory word
of bits in AC and the memory word specified by the effective address to
specified by effective address. the value of AC.
● The result of operation is transferred to ● Sum is transferred to AC and output
AC. carry Cout is transferred into E
(Extended accumulator flipflop)
● D0T4: DR ← M [AR]
D0T5: AC ← AC ^ DR, SC ← 0 ● D1T4: DR ← M [AR]
D1T5: AC ← AC ^ DR, E ← Cout, SC ← 0
LDA : Load to AC STA : Store to AC
● Transfers the memory word specified ● Stores the content of AC into the
by the effective address to AC. memory word specified by the
● D2T4: DR ← M [AR] effective address.
D2T5: AC ← DR, SC ← 0 ● D3T4: M [AR] ← AC, SC ← 0
ISZ: Increment and Skip if
Zero
BUN : Branch
● Increments the word specified by the
Unconditionally
effective address, and if the
incremented value is equal to 0, PC is
● Transfers the program to the
incremented by 1 in order to skip the
instruction specified by the effective
next instruction in the program.
address.
● D6T4: DR ← M [AR]
● D4T4: PC ← AR, SC ← 0
D6T5: DR ← DR+1
D6T6: M [AR] ← DR, if (DR 0) then (PC
← PC 1), SC ← 0
BSA : Branch and Save Return Address
● A computer can serve no useful purpose unless it communicates with the external
environment.
● Instructions and data stored in memory must come from some input device.
● Computational results must be transmitted to the user through some output device.
● To demonstrate the most basic requirements for input and output communication, we will use
as an illustration a terminal unit with a keyboard and printer.
Input-Output Configuration
● Needed for
○ transferring information to and from AC register.
○ for checking the flag bits.
○ for controlling the interrupt facility.
● Recognized by the control when D7 =1 and I =1.
● The remaining bits(0-11) of the instruction specify the particular operation.
● Executed with the clock transition associated with timing signal T3.
● Each control function needs a Boolean relation D7IT3, and is represented by the symbol p.
● By assigning the symbol Bi to bit i of IR, all control functions can be denoted by pBi for i = 6
through 11.
Input-Output Instructions
Program Interrupt
Need for Interrupt
● In basic case (Programmed control transfer), the computer keeps checking the flag bit, and
when it finds it set, it initiates an information transfer.
● This type of transfer is inefficient because of the difference of information flow rate between
the computer and that of the input–output device.
● The computer is wasting time while checking the flag instead of doing some other useful
processing task.
Program Interrupt
● An alternative to the programmed controlled procedure is to let the external device inform the
computer when it is ready for the transfer.
● In the meantime the computer can be busy with other tasks.
● This type of transfer uses the interrupt facility.
● While the computer is running a program, it does not check the flags.
● When a flag is set, the computer is interrupted from proceeding with the current program.
● The computer stops what it is doing to take care of the input or output transfer.
● It then returns to the current program to continue what it was doing before the interrupt
Program Interrupt
● The inputs to this circuit come from ● The outputs of the control logic circuit are
○ two decoders ○ Signals to control the inputs of the
○ I flip-flop nine registers
○ bits 0 through 11 of IR. ○ Signals to control the read and write
● The other inputs to the control logic are inputs of memory
○ AC bits 0 through 15 to check if AC =0 ○ Signals to set, clear, or complement
and to detect the sign bit in AC(15) the flip-flops
○ DR bits 0 through 15 to check if DR= 0 ○ Signals for S2, S1, and S0 to select a
○ The values of the seven flip-flops. register for the bus
○ Signals to control the AC adder and
logic circuit
Control of Registers and Memory
● The control inputs of the registers are LD (load), INR (increment), and CLR (clear).
● Eg: To derive the gate structure associated with the control inputs of AR.
Find all the statements that change the content of AR
R’T0: AR ← PC
R’T2: AR ← IR(0–11)
D7’IT3: AR ← M [AR]
RT0: AR ← 0
D5T4: AR ← AR + 1
● The control functions can be combined into three Boolean expressions as follows
LD(AR) = R’T0 + R’T2 + D7’IT3
CLR(AR) = RT0
INR(AR) = D5T4
Control of Common Bus
● The 16-bit common bus is controlled by the selection inputs S2, S1, and S0.
● The decimal number shown with each bus input specifies the equivalent binary number that
must be applied to the selection inputs in order to select the corresponding register.
● For example, when x1 = 1, the value of S2S1S0 must be 001 and the output of AR will be
selected for the bus.
Control of Common Bus
● In order to design the logic associated with AC, extract all the statements that change the
content of AC.
D0T5: AC ← AC ^ DR
D1T5: AC ← AC + DR
D2T5: AC ← DR
pB11: AC(07) ← INPR
rB9: AC ← AC
rB7: AC ← shr AC, AC(15) ← E
rB6: AC ← shl AC, AC(0) ← E
rB11: AC ← 0
rB5: AC ← AC + 1
● From this list we can derive the control logic gates and the adder and Logic circuit.