programb28 - Microprocessors & Applications (UPTU) Appendix...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Appendix B ØØ Explanation : We have a number which is available in the AX register. We have to find the 2’s complement of the number. The 2’s complement of the number can be found out by finding 1’s complement of a number and adding 1 to it to give the 2’s complement. eg. : AX = 1234 H. 1’s complement = 111 0 110 1 110 0 101 1 = EDCB + 1 2’s complement 111 0 110 1 110 0 110 0 = EDCC ØØ Algorithm : Step I : Initialize the data memory. Step II : Load the number in AX. Step III : Initialize counter = 16 in CX. Step IV : Rotate number by 1 bit position to left with carry. Step V : Complement carry. Step VI : Decrement count. Step VII : Check if count = 0. If not goto step IV Step VIII : Rotate once again by 1 bit to restore original carry back. Step IX : 2’s complement = 1’s complement in AX + 1 Step X : Display result. Step XI : Stop. ØØ Flowchart : Refer flowchart 28. ØØ
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/04/2011 for the course ECON 101 taught by Professor Lucky during the Spring '11 term at Silver Lake.

Page1 / 2

programb28 - Microprocessors & Applications (UPTU) Appendix...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online