I'm not nearly at the experience level in computer science to be able to properly determine the number of instructions involved in basic ALU calculations, and I'm interested in a certain software concept where the difference is important.
1011 (this is 11 in decimal) x 1110 (this is 14 in decimal) ====== 0000 (this is 1011 x 0) 1011 (this is 1011 x 1, shifted one position to the left) 1011 (this is 1011 x 1, shifted two positions to the left) + 1011 (this is 1011 x 1, shifted three positions to the left) ========= 10011010 (this is 154 in decimal)
I've been studying the binary multiplier, which seems to calculate partial products with binary, and then shifts them to the left, the very same way that we do with base-10 multiplication in grade school. It would seem to me that this would require 2 instructions per digit, but that's merely a barely-educated guess.
I've found Wiki's explanation of an adder-subtractor to be far more advanced, (in description, not operation, surely), and I've had less luck interpreting it thus far.
My goal is to determine the number of instructions required to compute the addition / multiplication (respectively) of number sets. Basically, I want to figure:
5 x 5 = 10 --> 5 instructions //example 5,000,000,001 x 456892 --> 50 instructions //example 1 + 1 = 2 --> 4 instructions //example 1,000,042,569 + 1,491 = 1,000,044,060 --> 45 instructions //example
Tl;dr - My Question:
Is it possible to accurately determine the number of instructions required to multiply or add two (whole number) integers in a modern processor?
If so, how is this figured (in both addition and multiplication, based on the size of the number)?