> Here is my situation. The input data is 8-bit, two's complement > data. I need to multiply two inputs together then multiply the result by > 8 and still get the result to fit in 16 bits. > > As I see it the max 8-bit value can be FFh (-1). In order to > make the multiply work for the 16-bit math I need to set all upper 8 bits > (I think) so that my multiplier data is FFFFh. This will cause an > overflow if I have two such values to multiply so I was going to limit > one of my inputs to 5 bits (ie, max value = 1Fh). But if I do this how > do I use this 5-bit representation of -1 in the 16-bit adder??? > Hi Martin, I'm not sure that I fully understand what you are trying to do. If you convert your data from two's complement, you can simply multiply the two values and then left shift the 16-bit result three times for the 8*a*b result. If you leave the data in 2's comp. format, when you multiply you will get the following: a+a2=h'100' or a2=h'100'-a these are your 2's comp values b+b2=h'100' or b2=h'100'-b Now multiplying a2*b2 a2*b2 = h'10000' - h'100'*a - h'100'*b + a*b For a 16-bit result, the h'10000' overflows. To get your desired value of a*b you must correct the a2*b2 result by the following a*b = a2*b2 + h'100'*a + h'100'*b - h'10000' This simply means to add a and b to the high byte of the 2 byte a2*b2 result, but your data is still in 2's comp. So you'll need to substitute a*b = a2*b2 + h'100'*(h'100'-a2) + h'100'*(h'100'-b2) - h'10000' or a*b = a2*b2 - h'100'*a2 - h'100'*b2 + h'10000' So, you can get your a*b from you a2*b2 by subtracting a2 and b2 from the high byte of a2*b2. You may want to use the 16-bit subtraction with a2 and b2 as the high byte. Now that you have a*b, just left shift three times for 8*a*b. I hope this is correct. Good luck, Derrick Early early@finite.nrl.navy.mil