Electronic – How exactly does the transition between Software and Hardware occur

hardwareinterfacemicroprocessoroperating systemsoftware

Well first allow me to explain what I actually meant to ask. Ok, so it is clearly known that without software, a piece of hardware is just a lifeless body, something without a soul. But I clearly cannot understand how this communication/interface between software and hardware is actually happening?

A Software is nothing but lines of code which finally after getting compiled, assembled, linked and is converted to a string of binary digits. But you see the hardware of the processor doesn't understand ones and zeros it understands a high voltage level and a low voltage level. but how is this transition from binary digits to voltage levels actually taking place?
For a really quick analogy, if I wanted to lift a book there is actual physical contact between my hands and the book. But what about the interface between hardware and software?

I hope you people understand the crux of my question. It is really difficult to put it into straight-forward sentences. This may sound like a bizarre question, but trust me it's been bugging me for a really long time. I've taken courses on Computer Organization and basic processor Design, but they clearly failed in providing me an answer.

A similar question exists on StackOverflow and there is not one convincing answer.
https://stackoverflow.com/questions/3043048/how-does-software-code-actually-communicate-with-hardware

EDIT:
You see the standard process for the code to be executed by the processor is such that it passes through
compiler -> assembler -> linker -> loader -> Memory.
Because once the instructions get into the memory it is pretty straight forward as to how the processing takes place.
The only inconsistency which I feel in that flow is about how the transition from loader -> memory. is happening? This is one of the straightforward ways I can put up the question. But if it would be really grateful if you've understood the soul of the question.

Best Answer

I think a powerful tool for helping you understand what is going on is to realize that software has to be implemented, in terms of magnetic patterns on a harddrive or charges on transistors in memory, to be run. Your hardware is always operating on the implemented/realized version of the software.

We tend to like to talk about software in terms of "information" because that form is convenient for the kind of things we want to do with software. It is convenient that we can say a particular magnetic pattern "is the same as" a particular pattern of charges in a block of RAM. In the physical world, they're fundamentally different medium, but we recognize that they are "logically" identical because we assert their "meaning" to be the same.

So when I hand you a CD with my software on it, I don't hand you "a string of 1's and 0's." I hand you a piece of metalized plastic with some pits carefully stamped into it. The "information content" comes from the fact that you and I both agree on how one should translate the geometry of those pits into 1's and 0's. You then may install that software, writing careful magnetic squiggles onto a harddrive. You're okay with saying those pits and those squiggles are "the same thing" because you know that all you really cared about was the information encoded in them, and they encode the same information.

Thus, when hardware boots, and "software tells hardware what to do," what that really means is that you have a bunch of hardware components (like harddrives and memory chips and whatnot) that all agree on what things mean. The CPU interacts with fluctuating voltages in the BIOS in a way that you and I agree contains the "information" of the software in the BIOS.

The last key piece is that there is some piece of hardware that is not stable: the CPU clock. The CPU clock is constantly changing voltages, and the other components agree to interpret those changing voltages as marching orders to move one step forward in whatever processing they're doing. And finally, at startup, the CPU is designed to come up with instructions to go get more instructions from the BIOS (and eventually from the harddrive).

The key is that, at the physical layer, all of the components interact with the physical implementation of the information. The "software" is nothing more than a way of thinking about that physical implementation as a bunch of information -- and that we agree on what that information means.