Data Processing Transfer Sequence in CPU for Keyboard Input

  • Thread starter Thread starter Ali Inam
  • Start date Start date
  • Tags Tags
    Data Processing
Click For Summary

Discussion Overview

The discussion revolves around the sequence of data processing in a CPU following keyboard input, specifically when a key such as "A" is pressed. Participants explore the stages of data transfer and the roles of various components like cache, RAM, ROM, and registers in this process.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related
  • Debate/contested

Main Points Raised

  • One participant asks about the sequence of data transfer in the CPU after typing a character, expressing confusion about whether the data goes to cache, RAM, or registers first.
  • Another participant suggests that the characters typed go into an input buffer in memory, with the keyboard raising an interrupt to notify the CPU of incoming characters, which the operating system then handles.
  • A different participant notes that the answer is complex and suggests that understanding operating systems and architecture would provide more clarity, indicating that the sequence can vary.
  • One participant mentions the existence of a CPU inside the keyboard that scans for key presses, buffers the keycode, and generates an interrupt, detailing the subsequent steps involving the BIOS or OS and the conversion of keycodes to ASCII characters.
  • A participant shares their experience with an exam question that required a proper sequence of processing steps, ultimately proposing a sequence involving ROM, cache, RAM, and registers, but expresses uncertainty about the correct order.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the exact sequence of data processing stages, with multiple viewpoints and uncertainties expressed regarding the roles of different components in the process.

Contextual Notes

Some participants highlight the complexity of the topic, indicating that the sequence may depend on various factors, including the specific architecture of the CPU and the operating system in use.

Ali Inam
Messages
99
Reaction score
0
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


Hopeful

:confused:
 
Technology news on Phys.org
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 let's 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.
 
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.
 
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).
 
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.
 
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 what 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
ROM
CACHE
RAM
REGISTERS

:blushing:
 

Similar threads

Replies
48
Views
5K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 18 ·
Replies
18
Views
4K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K
  • · Replies 7 ·
Replies
7
Views
4K
Replies
10
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K