Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the subject is : computer organization and assembly language strictly follow the instructions given below important instructions only answer if you know the correct answer

the subject is : computer organization and assembly language

strictly follow the instructions given below

important instructions

only answer if you know the correct answer

do not just put the answer explain in step by step of the answer

do step by step explanation in detail of the problem

Attention:

explain the problem in each question and then write its solution with proper explanation.

If you just write down the solution without any explanation it will be considered copied and you will lose marks

------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------

---------------------------Question-1---------------------------

explain step by step solution what is happing in the example

explain each process in detail and also explain what is happing in each step (step by step explation)

image text in transcribed

image text in transcribed

Extended Multiplication We use extended shifting and extended addition to formulate our algorithm to do extended multiplication. The multiplier is still stored in 16bits since we only need to check its bits one by one. The multiplicand however cannot be stored in 16bits otherwise on left shifting its significant bits might get lost. Therefore it has to be stored in 32bits and the shifting and addition used to accumulate the result must be 32bits as well. Example 4.2 01 02 03 POO OOOOOOO ; 16bit multiplication (org 0x0100) jmp start multiplicand: dd 1300 multiplier: dw 500 result: dd 0 04 05 06 07 08 09 10 11 12 13 start: cl, 16 dx, (multiplier) : 16bit multiplicand 32bit space ; 16bit multiplier ; 32bit result ; initialize bit count to 16 ; load multiplier in dx ; move right most bit in carry ; skip addition if bit is zero checkbit: dx, 1 shr jnc skip 14 15 16 17 18 19 20 21 22 23 24 25 26 NNNNN HEPPA on NOBOJ skip: mov ax, (multiplicand) add [result], ax ; add less significant word ax, (multiplicand+2] adc [result+2], ax ; add more significant word shi word [multiplicand), 1 rel word (multiplicand+2), 1; shift multiplicand left dec cl ; decrement bit count jnz checkbit ; repeat if bits left mov ax, 0x400 ; terminate program int 0x21 05-07 10 15-18 The multiplicand and the multiplier are stored in 32bit space while the multiplier is stored as a word. Thc multiplicr is loaded in DX where it will be shifted bit by bit. It can be directly shifted in memory as well. The multiplicand is added to the result using extended 32bit addition The multiplicand is shifted left as a 32bit number using extended shifting operation. 20-21 The multiplicand will occupy the space from 0103-0106, the multiplier will occupy space from 0107-0108 and the result will occupy the space from 0109-010c. Inside the debugger observe the changes in these memory locations during the course of the algorithm. The extended shifting and addition operations provide the same effect as would be provided if there were 32bit addition and shifting operations available in the instruction set. At the end of the algorithm the result memory locations contain the value 0009EB10 which is 65000 in decimal; the desired answer. Also observe that the number 00000514 which is 1300 in decimal, our multiplicand, has become 05140000 after being left shifted 16 times. Our extended shifting has given the same result as if a 32bit number is left shifted 16 times as a unit. There are many other important applications of the shifting and rotation operations in addition to this example of the multiplication algorithm. More examples will come in coming chapters

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Example. Evaluate 5n+7 lim 7-00 3n-5

Answered: 1 week ago

Question

Question What is a Roth 403 (b) plan?

Answered: 1 week ago