COA Unit1
COA Unit1
Digital computers
A computer system is subdivided into two functional entities: Hardware and Software. The hardware
consists of all the electronic components and electromechanical devices that comprise the physical
entity of the device. The software of the computer consists of the instructions and data that the
computer manipulates to perform various data-processing tasks.
The Central Processing Unit (CPU)
contains an arithmetic and logic unit
for manipulating data, a number of
registers for storing data, and a
control circuit for fetching and
executing instructions.
The memory of a computer contains
storage for instructions and data. Its is
called a random access
memory(RAM) because the CPU can
access any location in memory at
random and retrieve the binary
information within a fixed interval of time
The input and output processor(IOP) contains electronic circuits for communicating and controlling
the transfer of information between the computer and the outside world.
The input and output devices connected to the computer include keyboards, printers, terminals, disk
drives an other communication devices.
Computer organization is concerned with the way the hardware components operate and the way they
are connected together to form the computer system. The various components are assumed to be in
place and task is to investigate the organizational structure to verify that the computer parts operate as
intended.
Computer design is concerned with the hardware design of the computer. Once the computer
specification are formulated, it is the task of the designer to develop hardware for the system. Computer
design is concerned with the determination of what hardware should be used and how the parts should
be connected.
Computer architecture is concerned with the structure and behaviour of the computer as seen by the
user. It includes the information formats, instruction set, and techniques for addressing memory. The
architectural design of a computer system is concerned with the specification of the various functional
modules, such as processor and memories, and structuring them together into a computer system.
Register Transfer Language
The Register Transfer Language is the symbolic representation of notations used to specify
the sequence of micro-operations.
In a computer system, data transfer takes place between processor registers and memory and
between processor registers and input-output systems. These data transfer can be represented
by standard notations given below:
Register Transfer
The term Register Transfer refers to the availability of hardware logic circuits that can perform
a given micro-operation and transfer the result of the operation to the same or another register.
Most of the standard notations used for specifying operations on various registers are stated
below.
• The register that holds an address for the memory unit is usually called a memory
address register is designated by MAR.
• Program Counter PC is a 16bit register which holds the next instruction's address.
The symbol PC( 0-7)or PC(L)
refers to the low order byte and
PC(8-15) or PC(H) to the high
order byte.
• Instruction Register IR holds the
instruction being executed.
• R1 (Processor Register).
• We can also indicate individual
bits by placing them in
parenthesis. For instance, PC (8-
15), R2 (5), etc.
• Data Transfer from one register to another register is represented in symbolic form
by means of replacement operator. For instance, the following statement denotes a
transfer of the data of register R1 into register R2.
R2 ← R1
Transfer to occur only a under a predetermined control condition. This can be shown by
following if-then statement:
If (P=1) then (R2 ← R1); Here P is a control signal generated in the control section.
the data transfer operation under a specific control function (P) is given by
P: R2 ← R1
Here, the letter 'n' indicates the number of bits for the register. The 'n' outputs of the register
R1 are connected to the 'n' inputs of register R2. A load input is activated by the control variable
'P' which is transferred to the register R2. It is assumed that the control variable is synchronized
with the same clock as the one applied to the register.
The statement T: R2←R1,R1←R2 denotes an operation that exchanges the contents of two
registers during one common clock pulse provided that T=1
When both of the select lines are at low logic, i.e. S1S0 = 00, the 0 data inputs of all four
multiplexers are selected and applied to the outputs that forms the bus. This, in turn, causes the
bus lines to receive the content of register A since the outputs of this register are connected to
the 0 data inputs of the multiplexers.
Similarly, when S1S0 = 01, register B is selected, and the bus lines will receive the content
provided by register B.
A bus system can also be constructed using three-state gates instead of multiplexers.
The most commonly used three state gates in case of the bus system is a buffer gate.
The following diagram demonstrates the construction of a bus system with three-state buffers.
The outputs generated by the four
buffers are connected to form a single
bus line.
Memory Transfer
Most of the standard notations used for specifying operations on memory transfer are stated
below.
o The transfer of information from a memory unit to the user end is called
a Read operation.
o The transfer of new information to be stored in the memory is called a Write operation.
o A memory word is designated by the letter M.
o We must specify the address of memory word while writing the memory transfer
operations.
o The address register is designated by AR and the data register by DR.
o Thus, a read operation can be stated as:
Read: DR ← M [AR]
o The Read statement causes a transfer
of information into the data register
(DR) from the memory word (M)
selected by the address register (AR).
o And the corresponding write operation
can be stated as: Write: M [AR] ← R1
The Write statement causes a transfer of information from register R1 into the memory word
(M) selected by address register (AR).
A micro-operation is a simple operation performed on the data stored in one or more registers. They
transfer the data between registers. There are four types of micro-operations.
• Register micro-operations
• Arithmetic micro-operations
• Logic micro-operations
• Shift micro-operations
Arithmetic Micro-operations
In general, the Arithmetic Micro-operations deals with the operations performed on numeric
data stored in the registers.
The basic Arithmetic Micro-operations are classified in the following categories:
1. Addition
2. Subtraction
3. Increment
4. Decrement
The following block diagram shows the interconnections of four full-adder circuits to provide
a 4-bit binary adder.
o The augend bits (A) and the addend bits (B) are designated by subscript numbers from
right to left, with subscript '0' denoting the low-order bit.
o The carry inputs starts from C0 to C3 connected in a chain through the full-adders. C4
is the resultant output carry generated by the last full-adder circuit.
o The output carry from each full-adder is connected to the input carry of the next-high-
order full-adder.
o The sum outputs (S0 to S3) generates the required arithmetic sum of augend and addend
bits.
o The n data bits for the A and B inputs come from different source registers. For
instance, data bits for A input comes from source register R1 and data bits for B input
comes from source register R2.
o The arithmetic sum of the data inputs of A and B can be transferred to a third register
or to one of the source registers (R1 or R2).
Binary Adder-Subtractor
Note: The 2's compliment can be obtained by taking the 1's compliment and adding one to the least significant
pair of bits. The 1's compliment can be implemented with inverters, and one can be added to the sum through
the input carry.
The Arithmetic micro-operations like addition and subtraction can be combined into one
common circuit by including an exclusive-OR gate with each full adder.
The block diagram for a 4-bit adder-subtractor circuit can be represented as:
o When the mode input (M) is at a low logic, i.e. '0', the circuit act as an adder and when
the mode input is at a high logic, i.e. '1', the circuit act as a subtractor.
o The exclusive-OR gate connected in series receives input M and one of the inputs B.
o When M is at a low logic, we have B⊕ 0 = B.
The full-adders receive the value of B, the input carry is 0, and the circuit performs A
plus B.
o When M is at a high logic, we have B⊕ 1 = B' and C0 = 1.
The B inputs are complemented, and a 1 is added through the input carry. The circuit
performs the operation A plus the 2's complement of B.
Binary Incrementor
The increment micro-operation adds one binary value to the value of binary variables stored in
a register. For instance, a 4-bit register has a binary value 0110, when incremented by one the
value becomes 0111. The increment micro-operation is best implemented by a 4-bit
combinational circuit incrementer. A 4-bit combinational circuit incrementer can be
represented by the following block diagram.
o A logic-1 is applied to one of the inputs of least significant half-adder, and the other
input is connected to the least significant bit of the number to be incremented.
o The output carry from one half-adder is connected to one of the inputs of the next-
higher-order half-adder.
o The binary incrementer circuit receives the four bits from A0 through A3, adds one to
it, and generates the incremented output in S0 through S3.
o The output carry C4 will be 1 only after incrementing binary 1111.
Logic Micro operation
Logic micro-operations are used on the bits of data stored in registers. These micro-operations
treat each bit independently and create binary variables from them.
There are a total of 16 micro-operations available. These are-
The below diagram shows the truth table for all the 16 logic micro-operations mentioned
above. Here, x and y are the variables or registers in which the data is stored and F0, F1,
….., F15 are the outputs that occur after performing these logic micro-operations.
Let us consider the X-OR micro-operation with the contents of two registers R1 and R2.
P: R1 ← R1 X-OR R2 or P: R1←R1⊕R2
1010 Content of R1
1100 Content of R2
0110 Content of R1 after P = 1
Shift Micro operations
Shift micro-operations are those micro-operations that are used for serial transfer of
information. These are also used in conjunction with arithmetic micro-operation, logic micro-
operation, and other data-processing operations.
Instruction code
An instruction code is a group of bits that tells the computer to perform a specific operation
part.
Operation Code
The operation code of an instruction is a group of bits that define operations such as add,
subtract, multiply, shift and compliment. The number of bits required for the operation code
depends upon the total number of operations available on the computer. The operation code
must consist of at least n bits for a given 2^n operations. The operation part of an instruction
code specifies the operation to be performed.
Register Part
The operation must be performed on the data stored in registers. An instruction code therefore
specifies not only operations to be performed but also the registers where the operands(data)
will be found as well as the registers where the result has to be stored.
➢ If we store each instruction code in one 16-bit memory word, we have available four bits
for the operation code (abbreviated opcode) to specify one out of 16 possible operations, and
12 bits to specify the address of an operand
Accumulator (AC): Computers that have a single-processor register usually assign to it the
name accumulator and label it AC. The operation is performed with the memory operand and
the content of AC.
Addressing modes
The address field for instruction can be represented in two different ways are as follows −
➢ It is placed in address 22 in
memory. The I bit is 0, so the
instruction is recognized as a direct
address instruction. The opcode
specifies an ADD instruction, and
the address part is the binary
equivalent of 300.
➢ Therefore, it is recognized as an
indirect address instruction.
➢ The operand found in address 1200 is then added to the content of AC.
➢ The effective address to be the address of the operand in a computation-type instruction or
the target address in a branch-type instruction.
➢ Thus the effective address in the instruction of Fig. a is 300 and in the instruction of Fig b
is 1200.
Computer Registers
Registers are a type of computer memory used to quickly accept, store, and transfer
data and instructions that are being used immediately by the CPU. The registers used by the
CPU are often termed as Processor registers. A processor register may hold an instruction, a
storage address, or any data (such as bit sequence or individual characters).
The computer needs processor registers for manipulating data and a register for holding a
memory address. The register holding the memory location is used to calculate the address of
the next instruction after the execution of the current instruction is completed.
Following is the list of some of the most common registers used in a basic
computer:
There are multiple registers and their functions which are as follows −
• Load (LD) − During the next clock pulse transition the information from the bus is
transmitted to the register whose load (LD) input is enabled.
• Memory Unit − When the write input of the memory is activated, it holds the content
of the bus. When the read input is activated, the memory places the 16-bit output onto
the bus with the selection variables being S2S1 S0 = 111..
• Increment (INR) and Clear (CLR) − When the INR signal is enabled, the contents of
the specified register are incremented. The contents are cleared when the CLR signal is
enabled.
• Address Registers (AR) − The address of the memory for the next read and write
operation is determined. It receives or sends an address from or to the bus when
selection inputs S2S1 S0=001 is used and the load is enabled. With inputs INR and CLR,
the address gets incremented or cleared.
• Program Counter (PC) − The address of the next instruction that is to be read from
the memory is saved. It receives or sends an address from or to the bus when selection
inputs S2S1 S0 = 010is applied and the load input is enabled. With inputs INR and CLR,
the address gets incremented or cleared.
• Data Register (DR) − The data register includes the data to be written into memory or
data that is to be read from the memory. It receives or sends an address from or to the
bus when selection inputs are S2S1 S0 = 011 applied and the load input is enabled. With
inputs INR and CLR, the address gets incremented or cleared.
• Accumulator (AC) − Accumulators are beneficial in executing the register micro-
operations including complement, shift, etc. The results acquired are again sent to the
accumulator. An accumulator stores the intermediate arithmetic and logic results.
• Instruction Registers (IR) − The IR stores the copy of the instruction that the
processor has to implement. The instruction that is read from the memory is stored in
the IR. It receives or sends instruction code from or to the bus when selection inputs
S2S1 S0 = 111 are applied and the load input is enabled.
• Temporary Register (TR) − The temporary storage for variables or results is
supported by the temporary register. It receives or sends the temporary data from or to
the bus when selection inputs S2S1 S0 = 011 are applied and the load input is enabled.
With inputs INR and CLR, the address gets incremented or cleared.
• Input Registers (INPR) − It includes 8 bits to hold the alphanumeric input
information. Input device shifts its serial data into the 8-bit register. The data is moved
to AC via the adder/logic circuit with load enabled.
• Output Registers (OUTPR) − The data is received from AC and moved to the output
device.
Computer Instruction
Computer instructions are a set of machine language instructions that a particular processor
understands and executes. A computer performs tasks on the basis of the instruction provided.
An instruction comprises of groups called fields. These fields include:
o The Operation code (Opcode) field which specifies the operation to be performed.
o The Address field which contains the location of the operand, i.e., register or memory
location.
o The Mode field which specifies how the operand will be located.
Memory Reference Instruction
A memory-reference instruction uses 12 bits to specify an address and one bit to determine the
addressing mode I. I is the same as 0 for direct address and to 1 for indirect address.
Input-Output Instruction
An input-output instruction does not require a reference to memory and is identified by the
operation code 111 with a 1 in the leftmost bit of the instruction. The remaining 12 bits can
determine the type of input-output operation or test implemented.
The type of instruction is identified by the computer control from the four bits in positions 12
through 15 of the instruction. If the three opcode bits in positions 12 through 14 are not similar
to 111, the instruction is a memory-reference type and the bit in position 15 is taken as the
addressing mode I. If the 3-bit opcode is similar to 111, the control then examines the bit in
position 15. If this bit is 0, the instruction is a register-reference type. If the bit is 1, the
instruction is an input-output type.
Symbol Hexadecimal Code Description
AND 0xxx 8xxx And memory word to AC
ADD 1xxx 9xxx Add memory word to AC
LDA 2xxx Axxx Load memory word to AC
STA 3xxx Bxxx Store AC content in memory
BUN 4xxx Cxxx Branch Unconditionally
BSA 5xxx Dxxx Branch and Save Return
Address
ISZ 6xxx Exxx Increment and skip if 0
CLA 7800 Clear AC
CLE 7400 Clear E(overflow bit)
CMA 7200 Complement AC
CME 7100 Complement E
CIR 7080 Circulate right AC and E
CIL 7040 Circulate left AC and E
INC 7020 Increment AC
SPA 7010 Skip next instruction if AC > 0
SNA 7008 Skip next instruction if AC < 0
SZA 7004 Skip next instruction if AC = 0
SZE 7002 Skip next instruction if E = 0
HLT 7001 Halt computer
INP F800 Input character to AC
OUT F400 Output character from AC
SKI F200 Skip on input flag
SKO F100 Skip on output flag
ION F080 Interrupt On
IOF F040 Interrupt Off
Instruction Set Completeness:
A computer should have a set of instructions so that the user can construct machine language
programs to evaluate any function.
➢ The set of instructions are said to be complete if the computer includes a sufficient number
of instructions in each of the following categories: o Arithmetic, logical, and shift instructions
o Data Instructions (for moving information to and from memory and processor registers) o
Program control or Brach o Input and output instructions
➢ There is one arithmetic instruction, ADD, and two related instructions, complement
AC(CMA)and increment AC(INC). With these three instructions we can add and subtract
binary numbers when negative numbers are in signed-2's complement representation.
➢ The circulate instructions, CIR and CIL; can be used for arithmetic shifts as well as any
other type of shifts desired.
➢ There are three logic operations: AND, complement AC (CMA), and clear AC(CLA). The
AND and complement provide a NAND operation.
➢ The branch instructions BUN, BSA, and ISZ, together with the four skip instructions,
provide capabilities for program control and checking of status conditions.
➢ The input (INP} and output (OUT) instructions cause information to be transferred between
the computer and external devices.
➢ There are two major types of control organization: Hardwired control and
Microprogrammed control
The differences between hardwired and microprogrammed control are
Hardwired control Microprogrammed control
The control logic is implemented with gates, The control information is stored in a
flip-flops, decoders, and other digital control memory. The control memory is
circuits. programmed to initiate the required
sequence of microoperations
The advantage that it can be optimized to Compared with the hardwired control
produce a fast mode of operation operation is slow.
Requires changes in the wiring among the Required changes or modifications can be
various components if the design has to be done by updating the microprogram in
modified or changed. control memory.
Shows the block diagram of control unit which uses hardwired approach. It consists of
decoders, a sequence counter(SC) and combinational logic circuitry.
Fig shows how the instruction in the instruction register(IR) is used to generate control signals.
The instruction register is divided into three fields: I field, operation code field and bits 0
through 11. The 3:8 decoder decodes the operation code bits and output of this decoder are
used as an input for combinational logic circuitry. The four bit sequence counter counts from
0000 through 1111,i.e. (0 through 15 in decimal). These four bits are decoded by 4:16 decoder
to generate timing signals from 0 through 15. The I bit from IR is also connected to the
combinational control circuitry. Therefore, combinational control circuitry takes the input from
3:18 decoder, 4:16 decoder, I bit and bits 0 through 11 to generate control signals.
Along with the clock input SC has two other inputs: clear and increment. Initially, sequence
counter is cleared by activating clear input. Once the SC is cleared, clear signal is negated and
SC is incremented with every positive clock transition to produce the sequence of timing
signals T0, T1, T2, T3 and so on. If SC is not cleared, the timing signal will continue with T4, T5
up to T15 and back to T0. However, if SC is cleared in between, a new sequence will start from
T0, T1 and so on.
From fig it is observed that the SC is cleared to 0 in T4 if decoder output D2 is active(logic 1).
This can be expressed symbolically as D3T4: SC←0
Instruction Cycle
A program residing in the memory unit of a computer consists of a sequence of instructions.
These instructions are executed by the processor by going through a cycle for each instruction.
T0:AR←PC
T1: IR←M[AR], PC←PC+1
At T0, the address from PC is transferred from PC to AR. The instruction read from the memory
is then placed in the IR during T1. At the same time, PC is incremented by one.
The fig shows the implementation of the first two register transfer statements in the common
bus system.
In T0:
1. The contents of PC are
placed onto the common
bus by enabling its EN
input by setting
S2S1S0=010.
2. contents of the common
bus are transferred to AR
by enabling its LD input.
In T1:
1. read input of the memory is
enabled by setting S2S1S0=111.
This places the contents of
memory onto the bus
2. the contents of common bus are
transferred to IR by enabling the
its LD input.
3. PC is incremented by enabling
the INR input of PC.
AND to AC:
This is an instruction that performs the AND logic operation on pairs of bits in AC and the memory
word specified by the effective address.
The result of the operation is transferred to AC.
ADD to AC:
This instruction adds the
content of the memory
word specified by the
effective address to the value of AC. The sum is transferred into AC and the output carry Cout is
transferred to the E (extended accumulator) flip-flop.
LDA: Load to AC
1. This instruction transfers the memory word specified by the
effective address to AC.
2. The microoperations needed to execute this instruction are
STA: Store AC
1. This instruction stores the content of AC into the memory word specified by the effective
address.
2. Since the output of AC is applied to the bus and the data input of memory is connected to the
bus,
BUN: Branch Unconditionally
1. This instruction transfers the program to the instruction specified by the effective address.
2. The BUN instruction allows the programmer to
specify an instruction out of sequence and we say
that the program branches (or jumps) unconditionally.
Control Flowchart
A flowchart showing all microoperations for the execution of the seven memory-reference
instructions is shown in Fig.
The control functions are indicated on top
of each box.
Note that we need only seven timing signals to execute the longest instruction (ISZ).
The computer can be designed with a 3-bit sequence counter. The reason for using a
4-bit counter for SC is to provide additional timing signals for other instructions that
are presented in the problems section.
Register-Reference Instructions:
1. Register-reference instructions are recognized by the control when D7 = 1 and I=0.
2. These instructions use bits 0 through 11 of the instruction code to specify one of
12instructions.
3. These 12 bits are available in IR (0-11).
4. These instructions are executed with the clock transition associated with timing variable
T3.
5. Control function needs the Boolean relation D7I’T3, which we designate for
convenience by the symbol r.
6. By assigning the symbol Bi to bit i of IR, all control functions can be simply denoted
by rBi.
7. For example, the instruction CLA has the hexadecimal code 7800, which gives the binary
equivalent 0111 1000 0000 0000. The first bit is a zero and is equivalent to I ’ .
8. The next three bits constitute the operation code and are recognized from decoder output D7.
9. Bit 11 in IR is 1 and is recognized from B11. The control function that initiates the
microoperation for this instruction is D7I’T3 B11 = rB11.
10. The execution of a register-reference instruction is completed at time T3.
11. The sequence counter SC is cleared to 0 and the control goes back to fetch the next instruction
with timing signal T0.
12. The first seven register-reference instructions perform clear, complement, circular shift, and
increment microoperations on the AC or E registers.
13. The next four instructions cause a skip of the next instruction in sequence when a stated
condition is satisfied. The skipping of the instruction is achieved by incrementing PC once
again.
14. The condition control statements must be recognized as part of the control conditions.
15. The AC is positive when the sign bit in AC(15) = 0; it is negative when AC(15) = 1. The content
of AC is zero (AC = 0) if all the flip-flops of the register are zero.
16. The HLT instruction clears a start-stop flip-flop S and stops the sequence counter from
counting.
Input-Output Configuration:
1. The terminal sends and receives serial information. Each quantity of information has
eight bits of an alphanumeric code.
2. The serial information from the keyboard is shifted into the input register INPR.
3. The serial information for the printer is stored in the output register OUTR.
4. These two registers communicate with a communication interface serially and with
the AC in parallel. The input-output configuration is shown in Fig. below. The
transmitter interface receives serial information from the keyboard and transmits it to
INPR.
5. The receiver interface receives information from OUTR and sends it to the printer
serially.
6. The input register INPR consists of eight bits and holds an alphanumeric input information.
The 1-bit input flag FGI is a control flip-flop. The flag bit is set to 1 when new information is
available in the input device and is cleared to 0 when the information is accepted by the
computer.
7. The flag is needed to synchronize the timing rate difference between the input device and the
computer.
8. The process of information transfer is as follows. Initially, the input flag FGI is cleared to 0.
When a key is struck in the keyboard, an 8-bit alphanumeric code is shifted into INPR and the
input flag FGI is set to 1.
9. As long as the flag is set, the information in INPR cannot be changed by striking another key.
The computer checks the flag bit; if it is 1, the information from INPR is transferred in parallel
into AC and FGI is cleared to 0. Once the flag is cleared, new information can be shifted into
INPR by striking another key.
1. Input and
output
instructions
are needed
for
transferring
information
to and from AC register, for checking the flag bits, and for controlling the interrupt
facility.
2. Input-output instructions have an operation code 1111 and are recognized by the control
when D7 = 1 and I = 1.
3. The remaining bits of the instruction specify the particular operation.
4. These instructions are executed with the clock transition associated with timing signal
T3.
5. Each control function needs a Boolean relation D7IT3, which we designate for
convenience by the symbol p.
6. The control function is distinguished by one of the bits in IR (6-11).
7. By assigning the symbol Bi to bit i of IR, all control functions can be denoted by pBi
for i = 6 though 11.
8. The sequence counter SC is cleared to 0 when p = D7IT3 = 1.
9. The last two instructions set and clear an interrupt enable flip-flop IEN.
Program Input
1. The computer keeps checking the flag bit, and when it finds it set, it initiates an
information transfer. The difference of information flow rate between the computer
and that of the input—output device makes this type of transfer inefficient.
2. An alternative to the programmed controlled procedure is to let the external device
inform the computer when it is ready for the transfer.
3. In the meantime the computer can be busy with other tasks. This type of transfer uses
the interrupt facility.
4. While the computer is running a program, it does not check the flags.
5. When a flag is set, the computer is momentarily interrupted from the current program.
6. The computer deviates momentarily from what it is doing to perform of the input or
output transfer. It then returns to the current program to continue what it was doing
before the interrupt.
7. The interrupt enable flip-flop IEN can be set and cleared with two instructions.
• When IEN is cleared to 0 (with the IOF instruction), the flags cannot interrupt
the computer.
• When IEN is set to 1(with the ION instruction), the computer can be interrupted
The way that the interrupt is handled by the computer can be explained by means of the
flowchart of Fig.
1. An interrupt flip-flop R is included
in the computer. When R = 0, the
computer goes through an
instruction cycle.
2. During the execute phase of the
instruction cycle IEN is checked
by the control.
3. If it is 0, it indicates that the
programmer does not want to use
the interrupt, so control continues
with the next instruction cycle.
4. If IEN is 1, control checks the flag
bits. If both flags are 0, it indicates
that neither the input nor the output
registers are ready for transfer of
information. In this case, control
continues with the next instruction
cycle.
5. If either flag is set to 1 while IEN = 1, flip-flop R is set to 1. At the end of the execute
phase, control checks the value of R, and if it is equal to 1, it goes to an interrupt cycle
instead of an instruction cycle
Interrupt cycle:
1. The interrupt cycle is a hardware implementation of a branch and save return address
operation.
2. The return address available in PC is stored in a specific location.
3. This location may be a processor register, a memory stack, or a specific memory
location.
4. An example that shows what happens during the interrupt cycle is shown in Fig.
5. When an interrupt occurs and R is set to 1 while the control is executing the instruction
at address 255.
6. At this time, the returns address 256 is in PC.
7. The programmer has previously placed an input—output service program in memory
starting from address 1120 and a BUN 1120 instruction at address 1. This is shown in
Fig. a.
8. When control reaches timing signal T0 and finds that R = 1, it proceeds with the
interrupt cycle.
9. The content of PC (256) is stored in memory location 0, PC is set to 1, and R is cleared
to 0.
10. The branch instruction at address 1 causes the program to transfer to the input—output
service program at address 1120.
11. This program checks the flags, determines which flag is set, and then transfers the
required input or output information.
12. Once this is done, the instruction ION is executed to set IEN to 1 (to enable further
interrupts), and the program returns to the location where it was interrupted.