Question:
What gives binary code it's formula?
Laurence
2017-01-20 21:36:07 UTC
I've read that there isn't a specific binary code/ machine code sequence that all CPU's use to perform like kind functions, if so what mathematical formula or innate ability would explain how they all recreate the phenomena of multiplication using only 0's and 1's?
Four answers:
?
2017-01-20 21:39:02 UTC
I really don't think you understand what you are asking.



Are you saying that for multiplying to 32 bit integers they don't all use the same method? Well, the reason they all work is that the only methods people create machines that use is methods that work.



It's like asking "I hear there is more than one way to clean your house, if so what mathematical formula or innate ability would explain how they all recreate the phenomena of cleaning?"



Can you clarify what you are asking?



Edit: I looked at your other questions, you clearly think computers are magic or something.



People build computers. The math works because they build the computer so the math works. They build it so 1s and 0s are represented by voltages, and the computer can combine those voltages so that math happens.



There is nothing magic about voltages that make math happen. The machine was built to do math. Someone had to go "well if this component takes in a volt from A but not B it sends a volt to C. If it takes in a volt from A and B it sends a volt to D. This is how it does math. Everyone who designs a CPU needs to make sure they did it in such a way that math works. If it took in a volt from A and B and sent a volt to C instead of D then you'd get the wrong result.
husoski
2017-01-20 21:59:44 UTC
A modern desktop processor has about half a billion transistors. The "code" is in the arrangement of those into circuits that will read instructions as binary data from memory, interpret the bits of that instruction to select an action and perform it.



Many other functions are supported as well, with much of that transistor count going to things like cache memory and an on-chip graphics controller. There's also a lot of duplication, with multiple cores and multiple execution units per core, but there is still quite a lot of circuitry used for instruction execution.



Most processor families have several (maybe many dozens) of actual processor models that run essentially the same instruction set, so there's usually a design document produced by the manufacturer(s) stating what instructions are supported and what they do. Designing hardware and writing code according to that specification makes it possible to run the same software on most or all of the processor models.
Me2
2017-01-20 22:46:19 UTC
"there isn't a specific binary code/ machine code sequence that all CPU's use to perform ... multiplication using only 0's and 1'



That's correct, because different CPU families may have different machine languages.  The MIPS64 processor and the Core i3, for example, have no opcodes (binary instructions) in common.



There are, however, commonly available and efficient algorithms for performing all the fundamental mathematical functions available in modern CPUs.  Although the actual opcodes used to implement the steps in an algorithm vary between families, the steps achieve the same results.
Crim Liar
2017-01-20 21:43:31 UTC
When you get down to the nitty gritty you find that instructions load data into custom logic systems where that data is then fed through a series of transpositions based on custom logic circuits. The instructions are exactly that, they do not perform anything, rather they provide guidance to the CPU as to what logic it should send data through.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...