This document discusses different addressing modes used in computer instructions including register, absolute, immediate, indirect, index, base with index, relative, autoincrement, and autodecrement modes. It provides examples of each mode and how effective memory addresses are calculated. The document also contains questions about identifying addressing modes and calculating effective addresses from sample instructions. Sorting algorithms like bubble sort are explained with C language and assembly language examples.
Breadth First Search & Depth First SearchKevin Jadiya
The slides attached here describes how Breadth first search and Depth First Search technique is used in Traversing a graph/tree with Algorithm and simple code snippet.
Cohen-Sutherland Line Clipping Algorithm:
When drawing a 2D line on screen, it might happen that one or both of the endpoints are outside the screen while a part of the line should still be visible. In that case, an efficient algorithm is needed to find two new endpoints that are on the edges on the screen, so that the part of the line that's visible can now be drawn. This way, all those points of the line outside the screen are clipped away and you don't need to waste any execution time on them.
A good clipping algorithm is the Cohen-Sutherland algorithm for this solution.
By,
Maruf Abdullah Rion
Discussed Elements of Dynamic Programming, covered all the points from Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein,‖
Introduction to Algorithms‖, Third Edition, Prentice-Hall, 2011.
Breadth First Search & Depth First SearchKevin Jadiya
The slides attached here describes how Breadth first search and Depth First Search technique is used in Traversing a graph/tree with Algorithm and simple code snippet.
Cohen-Sutherland Line Clipping Algorithm:
When drawing a 2D line on screen, it might happen that one or both of the endpoints are outside the screen while a part of the line should still be visible. In that case, an efficient algorithm is needed to find two new endpoints that are on the edges on the screen, so that the part of the line that's visible can now be drawn. This way, all those points of the line outside the screen are clipped away and you don't need to waste any execution time on them.
A good clipping algorithm is the Cohen-Sutherland algorithm for this solution.
By,
Maruf Abdullah Rion
Discussed Elements of Dynamic Programming, covered all the points from Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein,‖
Introduction to Algorithms‖, Third Edition, Prentice-Hall, 2011.
Literature Review Basics and Understanding Reference Management.pptxDr Ramhari Poudyal
Three-day training on academic research focuses on analytical tools at United Technical College, supported by the University Grant Commission, Nepal. 24-26 May 2024
A review on techniques and modelling methodologies used for checking electrom...nooriasukmaningtyas
The proper function of the integrated circuit (IC) in an inhibiting electromagnetic environment has always been a serious concern throughout the decades of revolution in the world of electronics, from disjunct devices to today’s integrated circuit technology, where billions of transistors are combined on a single chip. The automotive industry and smart vehicles in particular, are confronting design issues such as being prone to electromagnetic interference (EMI). Electronic control devices calculate incorrect outputs because of EMI and sensors give misleading values which can prove fatal in case of automotives. In this paper, the authors have non exhaustively tried to review research work concerned with the investigation of EMI in ICs and prediction of this EMI using various modelling methodologies and measurement setups.
HEAP SORT ILLUSTRATED WITH HEAPIFY, BUILD HEAP FOR DYNAMIC ARRAYS.
Heap sort is a comparison-based sorting technique based on Binary Heap data structure. It is similar to the selection sort where we first find the minimum element and place the minimum element at the beginning. Repeat the same process for the remaining elements.
Water billing management system project report.pdfKamal Acharya
Our project entitled “Water Billing Management System” aims is to generate Water bill with all the charges and penalty. Manual system that is employed is extremely laborious and quite inadequate. It only makes the process more difficult and hard.
The aim of our project is to develop a system that is meant to partially computerize the work performed in the Water Board like generating monthly Water bill, record of consuming unit of water, store record of the customer and previous unpaid record.
We used HTML/PHP as front end and MYSQL as back end for developing our project. HTML is primarily a visual design environment. We can create a android application by designing the form and that make up the user interface. Adding android application code to the form and the objects such as buttons and text boxes on them and adding any required support code in additional modular.
MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software. It is a stable ,reliable and the powerful solution with the advanced features and advantages which are as follows: Data Security.MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software.
3. WHAT IS ADDRESSING MODE?
The different ways in which location of an operand is specified in an instruction are
referred to as “Addressing Modes”.
The different types of generic addressing modes are Immediate, Register,
Absolute(Direct), Indirect, Index, Base with index, Base with index and offset, Relative,
Autoincrement, Autodecrement .
4. Register Addressing Mode
Register addressing mode involves the use of registers to hold the data to be
manipulated.
Eg : Mov A,R0
Mov R1,R0
Mov Res,R1
In this mode operand is the content of a processor register.
5. ABSOLUTE MODE(DIRECT MODE)
In the absolute or direct addressing mode, the data is in a ram memory location whose
address is known, and this address is given as a part of the instruction.
Eg : Mov Loc,R1
6. IMMEDIATE ADDRESSING MODE
In this addressing mode, the source operand is a constant.
In immediate addressing mode, as the name indicates when the
instruction is assembled, the operand comes immediately after the
opcode.
In this addressing mode the data must be immediately
preceded by the pound sign, ‘#’;
7. INDIRECT ADDRESSING MODE
In this addressing mode, the instruction does not give the operand or
its address explicitly.
This addressing mode provides information from which the memory address
or the operand can be determined. This address is the effective address of
the operand.
When we use this addressing mode here actually the register acts as a pointer, where
pointer is nothing but the register or memory location that contains the address of an
operand.
9. INDEX ADDRESSING MODE
This is useful in dealing with lists and arrays.
The effective address of the operand is generated by adding a constant
value to the contents of the register.
The register used may be either a special function register or general purpose
register, the register which we use here is known as “index register”.
We indicate the Index mode symbolically as X(Ri).
10. Continuation……….
In X(Ri)
X denotes the constant value contained in the instruction
and
Ri is the name of the register involved.
The effective address of the operand is given by
EA = X+[Ri].
The contents of the index registers are not changed in the
process of generating the effective address.
The value X defines an offset also called as a
displacement.
12. RELATIVE ADDRESSING MODE
In this addressing mode the effective address is determined by the Index
mode using the program counter in the place of general purpose register
Ri.
13. ADDITIONAL MODES
The two additional modes are Autoincrement and Autodecrement mode.
Autoincrementmode – The effective address of the operand is the
contents of a register specified in the instruction. After accessing the
operand, the contents of this register are automatically incremented to
point to the next item in a list. The autoincrement mode is written as
(Ri)+
Autodecrementmode - The contents of a register specified in the
instruction are first automatically decremented and are then used as the
effective address of the operand. The Autodecrementmode is written as
-(Ri)
14. ADVANTAGE OF INDIRECT OVERDIRECT MODE
In direct addressing mode we cannot use loops, and in case of indirect addressing mode we
can use loop.
15. QUESTIONS
Registers R1 and R2 of a computer contain the decimal values 1200 and 4600. What is the
effective address of the memory operand in each of the following instructions?
Q1.
i) Load 20(R1),R5
a) 20 b) 4600 c)1220 d)1200
Ans : 1220
16. ii) Move #3000,R5
a)1220 b)1400 c)4600 d)None of the above
Ans : d) None of the above
iii) Store R5,30(R1,R2)
a)5830 b)5600 c)1200 d)4600
Ans : a)5830
17. iv) Add -(R2),R5
v) Add (R1)+,R5
a)1200 b)4599 c)1199 d)4600
Ans : b)4599
a)1199 b)1200 c)1198d)1201
Ans : d)1199
18. Q 2. Identify the addressing modes
i) ADD #6,R1
a)Register b)Absolute(Direct) c)Indirect d)Index e)Immediate
Ans : a) and e)
ii) ADD R1
a)Register b)Absolute(Direct) c)Indirect d)Index e)Immediate
Ans : a)
19. iii) ADD (R1)+,R5
a)Increment Mode b)Absolute(Direct) c) Autoincrement Mode d)Index e)Immediate
Ans : C) Autoincrement Mode
iv) Load 20(R1),R5
a)Base with index and offset b)Absolute(Direct) c)Indirect d)Index e)Immediate
Ans : d)Index
20. v) Store R5,30(R1,R2)
a)Base with index and offset b)Absolute(Direct) c)Indirect d)Index e)Immediate
Ans : a)Base with index and offset
21. Sorting
The process of rearranging the elements so that they are in ascending
or descending order is called as sorting
The various types of sorting are bubble sort, quick sort, insertion
sort etc…
22. C-Language for bubble sorting
for (j=n-1;j>0;j=j-1)
{
for(k=j-1;k>0;k=k-1)
{
if(List[k]>List[j])
{
Temp=List[k];
List[k]=List[j];
List[j]=Temp;
}
}
}
23. ALP For Bubble Sorting
Move #LIST,R0
Move N,R1
Subtract #1,R1
OUTER Move R2,R2
Subtract #1,R1
MoveByte (R0,R1),R3
INNER CompareByte R3,(R0,R2)
Branch<=0 NEXT
MoveByte (R0,R2),R4
MoveByte R3,(R0,R2)
MoveByte R4,(R0,R1)
MoveByte R4,R3
NEXT Decrement R2
Branch>=0 INNER
Decrement R1
Branch>0 OUTER