Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume a simple multiply of two 8-bit numbers Each is stored in the lower 8-bits

ID: 1715628 • Letter: A

Question

Assume a simple multiply of two 8-bit numbers Each is stored in the lower 8-bits of an accumulator of a 16-bit processor. Use any two numbers. The processor does not have instuctions for multiply and divide. Accumulator A and B are already loaded and there are two additional 16-bit acculuatora C and D available. Provide a sequence of events (IN WORDS ONLY) how I would multiply these two 8-bit numbers using only (move,load, jump, and branch). Also, please provide a general flow chart. Thank you very much!

Explanation / Answer

This is quite interesting question. :D
So, Here is the answer:

a shl operation performs the same operation as multiplying the specified operand by two. Shifting to the left two bit positions multiplies the operand by four. Shifting to the left three bit positions multiplies the operand by eight. In general, shifting an operand to the left n bits multiplies it by 2n. Any value can be multiplied by some constant using a series of shifts and adds or shifts and subtractions. For example, to multiply the ax register by ten, you need only multiply it by eight and then add in two times the original value. That is, 10*ax = 8*ax + 2*ax. The code to accomplish this is

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote