0

I went through lots of blogs and posts but could not exactly figure out how the machine code is converted to electrical signals?

Any software program is compiled to machine code which is nothing but lots of 1s and 0s. 1 means high voltage e.g 5V and 0 means comparatively low voltage e.g. 0V or ground, what's the component which understands that okay I got 1(one) so I need to step up up the voltage to 5V and for 0(zero) I need to step down to lower voltage level and how it does that?

dev gr
  • 129

2 Answers2

1

There is no such component, nor could there be. 1's and 0's are purely theoretical objects, and there is no component that turns theoretical things into physical effects. Physical objects can only cause physical effects of one kind into other kinds of physical effects. 1's and 0's only live in people's minds.

You can look at computers at an abstract level as manipulating 1's and 0's or you can look at them at a physical level manipulating voltages and currents. But these are two different ways of looking at the same components doing the same things.

1's and 0's are real things that can be fed into a physical device to be converted into something else.

0

Your machine code is not "converted" into electrical signals at all. It is a set of electrical signals. The fact that you see numbers and letters on your screen is irrelevant, all of that data is simply the processing of very precisely arranged electrical signals under a strict set of rules.

Your machine code is represented by bytes of data, sets of 0's and 1's, in some kind of memory device. In reading a byte from memory, which is simply a set of electrical signals, the processor is set up in specific ways to handle the next batch of electrical signals it will see. This process repeats itself millions of times and you see something on the screen.

The problem that you are having is that you are misreading the results (seeing an image on screen) as the result of some final conversion stage, it is not. What you see is the result of a massive number of electrical state changes within some massively complex devices.

For a visual indication of what is actually happening within a processor I'd recommend having a look at Visual Simulation of a 6502 processor

The closest to "conversion" is when data is written to storage devices such as a HDD where it is stored magnetically on the platter. Even there though it is stored in a way that makes it easier to restore it to an exact electrical replica of the original.

Basically everything you see on your screen is just electrons being moved around quickly, the fact that your brain can "see" patterns and images is down to how we told those electrons to move. The pictures are the product of electrical operations, not a conversion from one to the other.

Mokubai
  • 95,412