Monday, April 18, 2016

Multiplication


1.  Program for multiplication of two 8-bit numbers stored at memory location 5001H and 5002H.


The multiplication of two 8-bit numbers can generate a result of maximum 16-bits. so the final result is stored at 5003H (Lower 8-bit) and 5004H (Higher 8-bit). See the content of the memory locations. The result of operation is 500 (decimal) or 1F4 (Hex) or 256 (Higher 8-bit) + 244 ( Lower 8-bit) = 500.



2.   Program for multiplication of two signed 8-bit numbers. The result should also be in the signed number format. Assume the result is limited to 8-bit only with MSB as the sign bit.






The result is shown for the numbers 84H (-4 in decimal) and 82H (-2 in decimal). See the content of accumulator which is 08H ( -4 x -2 = +8 in decimal). 

Note: The MSB represents the sign of the number. Refer here for more explanation on signed number representation. 


Again, result is shown for the numbers 84H (-4 in decimal) and 02H (2 in decimal). See the content of accumulator which is 88H ( -4 x 2 = -8 in decimal).




No comments:

Post a Comment