Discussion in 'Homework Help' started by feli, Sep 10, 2011.

  1. feli

    Thread Starter New Member

    Apr 24, 2011

    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
  2. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    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.

    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.