You are on page 1of 13

T3-ASSESSMENT

BATCH-11
BATCH MEMBERS:

211FA04099
211FA04116
211FA04152
211FA04157
T-1 QUESTION
Design an algorithm for a machine with the data path as shown below
Figure, based on the knowledge of Register reference, Memory
reference, and Input-Output reference Instructions.
• Direct addressing:
It is sometimes referred to as Absolute Addressing Mode.
The direct addressing mode is the one whose operand part contains the
address of the memory location where the data over which the operation is
to be performed resides. Direct addressing is represented by ‘0’.
• Indirect addressing :
The indirect addressing mode is the one whose operand part contains
the effective address of the location where the address of the actual data
resides.
Direct and indirect addressing modes are the two classifications of
addressing modes, distinguished on the basis of data on which operation is
performed is accessed. Indirect addressing is represented by ‘1’.
Basic Computer Instructions:
The basic computer has 16-bit instruction register(IR)which can denote
either memory or register or input-output register instructions.
1) Memory Reference:
These instructions refer to memory address as an operand. Specifies 12-
bit address,3-bit opcode(other than 111)and 1-bit addressing mode for direct and
indirect addressing.
2) Register Reference:
These instructions perform operations on registers rather than
memory addresses.the IR(14-12) is 111 and IR(15) is 0(i.e.,Direct
addressing),the rest 12 bits specify register operation.

3)Input/Output Reference:
These instructions are for communication between computer
and outside environment. The IR(14-12) is 111 and IR(15) is 1 (i.e.,Indirect
addressing),the rest 12 bits specify I/O operation.
ALGORITHM
1. Start by loading the first value into a register.
2. Determine the type of reference for the second value. If it's a register
reference, load the value into another register. If it's a memory
reference, load the value into a register using the memory address. If it's
an input-output reference, use the appropriate input-output instruction to
read in the value and store it in a register.
3. Add the two values using the ALU.
4. If the result needs to be stored in memory, use the appropriate
memory reference instruction to store it at the specified address. If it
needs to be outputted, use the appropriate input-output instruction to
output the result.
5.By using output reference instruction give output to the user.
6.stop
Hierarchy of Languages
FLOW CHART
• In the fetch step, operands are
retrieved from memory.
• The decode step puts the operands
into a format that the ALU can
manipulate.
• The execute cycle performs the
selected operation within the ALU.
Control facilitates orderly routing of
data, including I/O to the ALU's
external environment (e.g.,
peripheral devices such as
disk or keyboard).
PSEUDO CODE
THANK YOU!

You might also like