x86 (or others) internals
Posted: Wed Feb 06, 2008 11:52 am
i have been pondering exactly how the internals of, say an core2 cpu works. Not the hightech stuff, but the simple parts, like fx. multiplying two numbers.
Surely i can figure out severel way of doing this task, but if im not mistaken, the mult instruction is actually very efficient and doesnt use alot of clockcycles, and its here my problem lies.
and example:
we want to multiply (binary numbers for the ease of it)
110101 * 1101
now, the brute force atempt on this would be:
110101+110101+110101+110101+.... 1101-1 times.
Then you can use bitshifting:
(110101*1000)+(110101*100)+(110101)
(110101 << 3)+(110101<< 2)+(110101)
This certainly makes a difference. 4 cycles as oposed to 1100, but this is not as good as what my cpu can perform, or atleast so i think.
Anyhow, i would love to have a discusion regarding this subject and allso a link or two to reasources where you can learn more, as i have been unable to obtain any from google.
Surely i can figure out severel way of doing this task, but if im not mistaken, the mult instruction is actually very efficient and doesnt use alot of clockcycles, and its here my problem lies.
and example:
we want to multiply (binary numbers for the ease of it)
110101 * 1101
now, the brute force atempt on this would be:
110101+110101+110101+110101+.... 1101-1 times.
Then you can use bitshifting:
(110101*1000)+(110101*100)+(110101)
(110101 << 3)+(110101<< 2)+(110101)
This certainly makes a difference. 4 cycles as oposed to 1100, but this is not as good as what my cpu can perform, or atleast so i think.
Anyhow, i would love to have a discusion regarding this subject and allso a link or two to reasources where you can learn more, as i have been unable to obtain any from google.