You are not logged in. Please login at www.codechef.com to post your questions!

×

How computer multiply two numbers.?

0
1

suppose i have to perform the multupication 100*100 .. so how many multipications are actually performed inside the computers to do this multipication. I searched it on stackoverflow , but i didn't understand their logic..! help ! http://stackoverflow.com/questions/3060064/how-computer-multiplies-2-numbers

asked 13 Aug '15, 14:59

va1ts7_100's gravatar image

3★va1ts7_100
462528
accept rate: 14%


Hi va1ts7_100,

Computer use Booth's algorithms for multiplication , this process is slightly different from we do normal multiplication there is shifting of bits also . There are many videos at Booth's algorithm on youtube and it is easily understandable.

Booth's multiplication algorithm wiki link

link

answered 14 Aug '15, 17:08

deepakmourya's gravatar image

4★deepakmourya
1145
accept rate: 16%

(14 Aug '15, 18:20) va1ts7_1003★

i guess from taking an organisation course that its done in a 32bit register or 64bit register - up to ur ps - , that the two numbers first are converted into binary n digits and then summed up to n times

link

answered 15 Aug '15, 14:25

genes123's gravatar image

0★genes123
1
accept rate: 0%

for more detail of this...you can look CO201 Computer architecture and Organization course this course generally taught in 3rd semester in B.tech(NITs)...

for multiplication there two major algorithms...

*Robertson's Multiplication Algorithm
*Booth's Multiplication Algorithm

these algorithm are really simple just look...you will understand definitely very quick.. it just state forward

here two major operation (here we do multiplication at binary level..like 101*011 )

  • compare

    • if multiplying bit 1 and 1 result :-1
    • if multiplying bit 0 and 1 or 1 and 0 or 0 and 0 result :- 0
  • shift

    • as we use cross mark 'x' for shifting in 3'rd grade multiplication method here we use bit shifting..

  0101
  X011

  0101
 01010
000000

001111

now you got it how simple it is ...just same as we do in decimal ..computer do in binary...

go through for more detail...

1). Robertson's Multiplication Algorithm

2).Booths' Multiplication Algorithm

Happy coding

link

answered 15 Aug '15, 15:57

rcsldav2017's gravatar image

5★rcsldav2017
1.0k1229
accept rate: 6%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×32
×1

question asked: 13 Aug '15, 14:59

question was seen: 2,817 times

last updated: 15 Aug '15, 15:57