multiplication of two numbers

Status
Not open for further replies.

shiv.emf

Newbie level 5
Joined
Jan 2, 2006
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,368
Hi friends ...
When two numbers r represented in 2's complement form n they r of 8bit length !!..
What r Maximum and minimum values of product of these two numbers?
 

as ur multiplying two 2's complement numbers, and as the number is minimum u will get the 2's complement wil be maximum. and as you are multiplying two 8-bit number u will get 16-bit output so u have to store the output in successive memory locations.
and max number u wll get is (2 pow 16) and min is 1
 
plz explain clearly ... i am still confused !! is 2^16 maximum ? when will i get 2^16 as product ??

As the range of numbers is 2^7-1 to -2^7
 

sorry i have written some wrong

00000001 --->(1's complement) 11111110 ----> 2's complement (11111111)FF(HEX)

if u multiply two 2's complement of 00000001 ie FF * FF= FE01

similarly for the min is

11111111--> 1's complement 00000000-----> 2's complemnt 000000001

if u multiply these two 2's complement of 111111111 ie 01*01=01
 

boss ....+ve numbers r not complemented !! only -ve number r written in 2's complement form

Added after 8 minutes:

11111111---> represents -1 ...u cant complement "11111111" as it is out of range !!.....
+ve numbers r 00000000 to 011111111 ie 0 to 2^7-1
n -ve number r -1 to -2^7 ie 11111111 to 10000000.... i think now it is clear !!
 

Boss i will agree with u here u r considering signed integers and i am considering unsigned integers so for any no there will be a 2's complement. for u r clarity i wil send u one document so if u consider this u will get the max as FE01 and min is 1
 

Hi,

Well, the bigest number that you can represent whith 8 bits is ( 2 ^ 8 ) - 1 = 255.

In 2's complement, you can represent numbers form -2 ^ ( 8 - 1 ) = -128 to +( 2 ^ ( 8 - 1 ) - 1 ) = +127.

127 - (-128) = 255 !!


Well, when you multiply the 2 numbers you can multiply:

- a positive number by positive number;
- a negative number by negative number;
- a positive number by negative number.

The bigest positive number that you can represent is : +127.

The bigest negative number that you can represent is : -128.


If you multiply the bigest positive number by himself:
(+127) * (+127) = +16'129

If you multiply the bigest negative number by himself:
(-128) * (-128) = +16'384

If you multiply the bigest negative number by the bigest positive number:
(-128) * (+127) = -16'256


Conclusion:

(*) The bigest number you have is +16'384;

(*) The smallest number you have is -16'256;


regards.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…