Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Data Processing

  1. May 28, 2010 #1
    When the data reaches the CPU via keyboard (suppose I typed the letter "A")

    So, what are going to be the stages in the CPU. I mean where will data be going first ? !

    The Cache ?
    or RAM/ROM or registers ? !

    I know about all the data processing functions they have, but, I am confused by the sequence of Data Transfer in order to see the letter "A" on the screen


  2. jcsd
  3. May 28, 2010 #2


    User Avatar
    Gold Member

    I think no one is answering because it's like explaining how dial tone happens--seems to simple to users, but there are a whole lot of things going on behind the scene. Simplified version: the characters you type go into an input buffer in memory (handled by the interface the keyboard is attached to, which could be either a USB port/driver, or an older PS/2 port/driver), and the keyboard has to raise an interrupt to let the CPU know that chars are incoming. The CPU then lets the operating system "handle" the characters that were typed, and the manner in which they show up on the screen depends on the user program (if any) which the operating system considered to be active at the time when you typed the characters. The operating system allows the appropriate user program to decide what to do with the input chars, whether to display them, and how.
  4. May 29, 2010 #3
    haha, this is too complex for a short answer.

    read up on operating systems and architecture and you will understand *a little* more. The accurate short answer - it depends.
  5. May 30, 2010 #4


    User Avatar
    Science Advisor

    I've reported this thread to get it merged with the other one in homework--hopefully, they'll determine whether it ought to be in this forum or the homework one. If this is homework, I would suspect it's asking you to elaborate upon the interrupt service routine for whichever processor you're studying.

    There's a post over in EE wondering about the 'antiquated' microprocessor textbook they're studying, which dates from 1996 (the one I used in the course I took in 2004 dates to 1991!) The reality of the situation is that the fundamental basics of how things work in microprocessors haven't changed that much. The interrupt service routine is still how nearly every operating system handles a key press or mouse movement (outside of maybe some 'real-time' operating systems).
  6. May 30, 2010 #5


    User Avatar
    Homework Helper

    There's a cpu inside the keyboard itself that constantly scans the keys for a change in state. When key press occurs, the keyboard buffers up the keycode for an "A" key being pressed and generates an interrupt. The PC's keyboard interrupt driver then inputs the buffered keystroke, and places it into a keyboard buffer, used by the BIOS or the OS. If there's is a pending request to read the keyboard buffer, the keycode is sent to the caller, otherwise it remains buffered. Once the request is made, the keycode is read. Somewhere in the process after this, the keycode is converted into an Ascii character. Then there's some program that sends the ascii character code to the video driver, either in text mode (MSDOS console mode), or graphics mode. In text mode the character is converted to a VGA code if needed, then indexes into a bit pattern matrix in the video cards font table to convert it into an bit image that it then displayed on the screeen. In graphics mode, the font pattern data is from the OS as opposed to the video cards bios.
  7. May 30, 2010 #6
    The main problem that I got was in an Exam

    They asked about the processing which occurs inside the CPU after the data leaves the keyboard.

    I knew waht happens, but, unfortunately, got stucked in the end part of the question in which they had written in brackets that they needed the whole process in a proper sequence.

    On that point, I started to think, WHICH DEVICE IS FIRST ? !

    I thought it was RAM

    But I then had an idea about the Level 1 cache because it is on the microprocessor,

    In the END !!

    I came up with the sequence as

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook