What happens physically when the user interacts with the computer, when a button is pressed on the keyboard for example?

338 views

The question is the basics of how a computer works, most people seem to think it is magic or something, I would like to understand.

Is it an electric charge that goes on a chip? how does that translate into a screen?

In: 2

10 Answers

Anonymous 0 Comments

How deep down the rabbit hole do you want to go? Computers are complicated Rube-Goldberg machines with many layers of abstraction from decades of advancement. There are lots of different points of view to look at, this is just one:

1. You press the “E” button on your keyboard.
2. Your button press closes an electric circuit which activates a certain combination of wires.
3. A micro-controller in the keyboard converts that signal to one or more packets of the USB protocol.
4. Those packets are sent to the USB controller inside the computer (or rather, I believe the controller regularly polls for those packets from the keyboard).
5. The USB controller sends an interrupt signal to the CPU.
6. The software running on the CPU (eg. the Operating System) determines what to do with those interrupts.
7. The OS receives data (via USB drivers) that a USB Human Interface Device sent an “E” key event (at this point it has probably interpreted a combination of “key down”/”key up” events as a single “press” event).
8. The OS sends the “E” key press to the application with the active window (and potentially other processes which are registered to receive such events).
9. The application tells the OS to render the letter “E” at a certain position on screen.
10. The OS tells the graphics processor (via graphics drivers) what image to display.
11. The CPU sends signals via the PCI bus to the GPU about what image data to render.
12. The GPU outputs electric signals via the HDMI interface to the monitor about what pixels to render.
13. The micro-controller in the monitor activates certain wires in its circuitry to change the colour and brightness of specific pixels.

Do you want to know which specific wires/pins are being activated? How much charge is going through them on each clock cycle? How the charge passes through the electric field?

You are viewing 1 out of 10 answers, click here to view all answers.