• Support PF! Buy your school textbooks, materials and every day products Here!

Hexadecimal Multiplication using 2's complement

  • #1
251
11

Homework Statement


Perform the following operations using 2's complement method.
##FFFD_{16} * FFF1_{16}##

Homework Equations


-

The Attempt at a Solution


##FFFD_{16}## ----> (1's comp.) = ##0002_{16}## -----> (2's comp.) = ##0003_{16}##
##FFF1_{16}## ----> (1's comp.) = ##000E_{16}## -----> (2's comp.) = ##000F_{16}##
##0003_{16} * 000F_{16} = D2_{16} ##

But ##FFFD_{16} ## ( negative ) * ##FFF1_{16}## ( negative ) , so the answer should be positive .
The answer is ## = 0D2_{16}## (positive ) .
Could anyone check my answer please ?
 

Answers and Replies

  • #2
phinds
Science Advisor
Insights Author
Gold Member
2019 Award
15,920
5,616
what is D2 base 16 in decimal? Does it sound like the right answer for 3x15?
 
  • #3
251
11
what is D2 base 16 in decimal? Does it sound like the right answer for 3x15?
##2D_{16}##
 
  • #4
phinds
Science Advisor
Insights Author
Gold Member
2019 Award
15,920
5,616
##2D_{16}##
Did you not understand my question? What is that in DECIMAL base?
 
  • #5
251
11
Did you not understand my question? What is that in DECIMAL base?
##D2_{16} = 13 * 16 + 2 * 16^0 ##
## = 210 ##
It's not the right answer for 3*15 .
I tried to solve the problem again and this is my work :
## 3 * 15 = 45## in decimal which is equal to ##2D_{16} ##
So, ##FFFD_{16} ## ( negative ) * ##FFF1 ## (negative) = ##02D_{16}##
 
  • #6
phinds
Science Advisor
Insights Author
Gold Member
2019 Award
15,920
5,616
##D2_{16} = 13 * 16 + 2 * 16^0 ##
## = 210 ##
It's not the right answer for 3*15 .
I tried to solve the problem again and this is my work :
## 3 * 15 = 45## in decimal which is equal to ##2D_{16} ##
So, ##FFFD_{16} ## ( negative ) * ##FFF1 ## (negative) = ##02D_{16}##
Yes, and can you do the actual arithmetic in base 16? (I wouldn't bother but I'm not sure if that's part of what you are supposed to do)
 
  • #7
phinds
Science Advisor
Insights Author
Gold Member
2019 Award
15,920
5,616
I solved it again and I got ##2D_{16}## not ##D2_{16}##.
Yes, I deleted the post where I mistakenly said it 2D was wrong. I got the 2D confused with the D2
 
  • #8
251
11
Yes, and can you do the actual arithmetic in base 16? (I wouldn't bother but I'm not sure if that's part of what you are supposed to do)
3 * F (15 in decimal) = 45 in decimal.
45 / 16 = 2.8125 ( 2 is the first digit , subtract 2 from 2.8125 and multiply the answer by 16 to get the second digit which is 13 in decimal ( D in base 16 ).
 
  • #9
phinds
Science Advisor
Insights Author
Gold Member
2019 Award
15,920
5,616
3 * F (15 in decimal) = 45 in decimal.
45 / 16 = 2.8125 ( 2 is the first digit , subtract 2 from 2.8125 and multiply the answer by 16 to get the second digit which is 13 in decimal ( D in base 16 ).
No, I mean can you do the original problem FFFD*FFF1 IN HEX not in decimal. I don't know that it's a requirement of the problem, I'm just asking if you CAN do it. Anyway, I think I've given you what help I can with this problem so I'll bow out now.
 
  • #10
358
108
No, I mean can you do the original problem FFFD*FFF1 IN HEX
yes, but it's annoying and requires twice the register space and use of a rubber chicken to do it flat out instead of as complements.
 
  • #11
NascentOxygen
Staff Emeritus
Science Advisor
9,244
1,071
But ##FFFD_{16} ## ( negative ) * ##FFF1_{16}## ( negative ) , so the answer should be positive .
The answer is ## = 0D2_{16}## (positive ) .
Could anyone check my answer please ?
Is this all solved now, Fatima Hasan? The only problem being that you have been writing D2 where you meant to write 2D?
 

Related Threads on Hexadecimal Multiplication using 2's complement

  • Last Post
Replies
3
Views
480
  • Last Post
Replies
13
Views
2K
  • Last Post
Replies
2
Views
11K
  • Last Post
Replies
4
Views
2K
Replies
0
Views
15K
  • Last Post
Replies
2
Views
15K
Replies
5
Views
442
Replies
1
Views
5K
Replies
2
Views
783
  • Last Post
Replies
8
Views
1K
Top