keyboard-mainmemory-microprocessor/keyboard-microprocessor?

Thread Starter

feli

Joined Apr 24, 2011
6
Hi,

Please explain please.

#1 When I enter data using keyboard, does it go to main memory and then microprocessor or it go to microprocessor straightly?

#2 Assume I tell a computer to print the number '46'. Does the number '46' goes to main memory and then microprocessor or does it go to microprocessor straightly?

Thank you
 

joeyd999

Joined Jun 6, 2011
4,434
Hi,

Please explain please.

#1 When I enter data using keyboard, does it go to main memory and then microprocessor or it go to microprocessor straightly?
If we are talking a PC here, actually the keyboard sends keycodes (via USB or PS/2 serial interface) to the CPU, and activates an interrupt. The interrupt code captures the keycode (which contains key press, key repeat, and key release codes) and stores it in a memory buffer. Then, the particular library using the keyboard data reads the buffer, and converts the code into a useful action (such as storing a character, or making your DOOM guy shoot, etc.)

In the processes, there are multiple data transfers between CPU and memory.

#2 Assume I tell a computer to print the number '46'. Does the number '46' goes to main memory and then microprocessor or does it go to microprocessor straightly?

Thank you
First, your '46' is on disk as a string embedded in your code. That is loaded into RAM and executed. During execution, the CPU reads the string, and sends it to the library that is handling output (could be frame buffer or graphical video).

Again, multiple transfers between CPU and RAM are required.
 
Top