What converts binary code/machine code to electrical signals and how?

-1

2

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

Posted 2015-06-07T05:23:38.960

Reputation: 119

Question was closed 2015-06-07T16:36:57.993

Are you looking for an example of how a trivial piece of machine code is translated from its stored format to electrical activity in the CPU, and how that produces a result? – fixer1234 – 2015-06-07T07:49:22.330

You need to spend wayyyyyyy more time looking into what CPUs do (internally), how they interpret machine code (the actual instructions) and, as David points out, the make-up of a CPU... Think billions of transistors for a modern computer processor... But also look at basic processors like PIC processors... – Kinnectus – 2015-06-07T07:58:19.027

@fixer1234 Yes that would help. Please post the link if you have any. Thank you. – dev gr – 2015-06-07T11:54:52.707

Answers

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.

David Schwartz

Posted 2015-06-07T05:23:38.960

Reputation: 58 310

You agree that we write code in a text editor, how this code drIves the machine? Your code is not a physical thing but the machine is. Am I right? – dev gr – 2015-06-07T06:12:09.933

Even after your edits my question remains the same. We must have something which drives the machine according to the code we write. What are "Same Components" which are "Doing The Same Things" and how? – dev gr – 2015-06-07T06:21:41.977

1

You would like to go through this blog http://www.quora.com/How-exactly-is-the-machine-code-or-even-a-programming-language-converted-to-binaries-and-how-are-these-binaries-transmitted-as-electric-signals-or-rather-viceversa so that you understand what I am looking for. Thanks.

– dev gr – 2015-06-07T06:29:47.873

@devgr: Looks like your question is pretty much answered by Artem Boytsov's Quora post. – Karan – 2015-06-07T07:10:54.177

@devgr The code is both a physical thing and a conceptual thing at the same time. You may think of it as 1's and 0's or letters or other mathematical and conceptual symbols. But at the same time, there's a physical representation of that code in the form of voltages and currents inside the computer. One is how we humans think about the other. – David Schwartz – 2015-06-07T07:32:12.103

@DavidSchwartz I want to go from logical things to practical things. But the discussion we are having is purely logical. But anyway thanks. – dev gr – 2015-06-07T07:36:47.647

@devgr There is no component that does that because logical things are not physical objects, they're how humans think about physical objects. Every component can be thought of physically in terms of what physical stuff comes in and goes out and logically in terms of what the stuff that comes in means what the stuff that goes out means. – David Schwartz – 2015-06-07T07:45:50.520

@DavidSchwartz Sometimes logical designs lead to physical components design and vice versa. There must be a relation between them or in precise words an interface between them which actually turns things into real. – dev gr – 2015-06-07T07:56:04.440

2@devgr No, there cannot possibly be such an interface. There is no component that takes conceptual things in and spits physical things out. Every component can be thought about conceptually or thought about physically. For example, we can think of your ear as taking in words and music or as taking in vibrations of air. They are both ways to describe the input to your ear. – David Schwartz – 2015-06-07T08:00:01.487

@DavidSchwartz That's a real good example, let me describe myself using the same. The physical input to your ear is the air vibrations which are produced by another physical component called speakers. Logically the air vibrations may be music, speech etc for you. Now the MP3 file you have in you computer/mobile goes to some physical component which converts your MP3 contents into analogue sound signals. You have two things an MP3 file and an analogue converter, since MP3 file is an not a physical thing so who comes in between? – dev gr – 2015-06-07T08:14:44.317

@devgr The MP3 file is a logical thing that exists all the way from the beginning to the end. It is neither an input nor an output to or from any component but the way we think about the information represented in different ways at different places. (Just as "words" or "music" is how we think about both the air pressure going into your ears and the conscious sensations you have at the end of the hearing process.) – David Schwartz – 2015-06-07T08:35:59.613

As a programmer we write softwares using any language in a text editor not build circuits. So when this code is compiled you can feed this code to machine so that it performs required operation using physical components like transistors and diodes etc. which only understand voltage levels. So some component is switching the voltage levels according to the code you wrote that's why you are getting desired results. What's that component? – dev gr – 2015-06-07T08:40:32.743

Let us continue this discussion in chat.

– David Schwartz – 2015-06-07T08:42:10.793

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

Posted 2015-06-07T05:23:38.960

Reputation: 64 434

That's real close now I have a working image in my head, thanks. But the most interesting part is "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." I am real interested in what's that form the data stored in and who restores that data back to electrical signals? – dev gr – 2015-06-07T08:47:30.857

Ah, now that's another question entirely... http://www.explainthatstuff.com/harddrive.html

– Mokubai – 2015-06-07T09:03:03.677

post above describes converting magnetic signals to electrical signals in case of hard drive. When you say compiler is compiling a program to machine language what it actually does? Does it generate equivalent electrical signals? I guess no. – dev gr – 2015-06-07T10:09:42.917

The compiler generates data, data is stored in memory devices and there is a logical disconnect between what you see as a compiler and the electrical operations that are happening underneath it. The compiler is a data construct on top of a purely electrical system. That construct is capable of instructing the electrical system to create data in a particular order that can be stored and then processed by the electrical system. You need to get it out of your head that any conversion or generation of signals is necessary, one system is constructed on top of, and is a feature of, the other system. – Mokubai – 2015-06-07T11:50:50.353