I’m not very technical so apologies if I use terms interchangeably that don’t make sense but I will try to explain. What I understand and put very basic is: we write code, it then gets “converted” so that the computer understands it. This is represented by 1’s and 0’s that trigger current in the hardware that gets stored in memory, lights a LED, etc. through (I think it’s called) logic gates.
That’s my way of understanding it. What I don’t understand is how the current is triggered? What causes that interaction?
For example, when I click save in a document. How does that trigger it to be saved in the hardware. Is it that, when I physically click on my mouse. That physical interaction of clicking sends a current and the computer recognises that the proportion of the pixels on the screen represents saving the document, which then triggers it to send that current to the logic gates?
Edit: Thank you for all your answers.
In: Technology
You click a mouse button, and the mouse will send an electronic signal down the wire (or an infrared or bluetooth signal across the area to a receive). The specific nature of the electric signal differs depending on what you’re doing: the left mouse button being pressed, the left mouse button being released, the right mouse button being pressed or released, the mouse moving etc.
The electrical signal is sent to a specific device controller that will convert that signal and store it into registers. Registers are collections of transistors that can store and hold and electrical pulse so long as they are being provided power.
The device controller will send a signal to the CPU that basically means, “Hey, I got some new information about the mouse, come read all about it.” The CPU then reads the information in the registers.
At this point the operating system (and any open applications) are already running and their specific instructions are already in memory being carried out. Part of these instructions involve waiting until something happens with the mouse then doing something about it.
In this particular case, the operating system knows where the mouse curser was when the PC first started and has been tracking its motion every time you moved it, so it knows where the mouse cursor is when you left clicked. It also knows every application is running, what windows they’re running in, and the size and position of those windows. It sees that the position of the mouse cursor is over one of those windows, so passes that information to the running application.
The application takes that info and recognizes that the cursor is over the save button icon and has special instructions for a left-click when the mouse cursor is over the save button icon. It then sends instructions to the operating system to save the current file in memory to disk.
Latest Answers