Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How does a keyboard translate words typed to the computer?  (Read 12575 times)

0 Members and 1 Guest are viewing this topic.

m_seipp

    Topic Starter


    Newbie

    How does a keyboard translate words typed to the computer?
    « on: September 14, 2009, 10:26:02 AM »
    I have had a heck of a time locating a reasonable answer to this question. I don't need super specific answer and not a completely general one either. Please help!

    Allan

    • Moderator

    • Mastermind
    • Thanked: 1260
    • Experience: Guru
    • OS: Windows 10
    Re: How does a keyboard translate words typed to the computer?
    « Reply #1 on: September 14, 2009, 10:38:35 AM »
    Perhaps it's me, but I don't understand your question.

    Aegis



      Expert

      Thanked: 67
      • Yes
      • Yes
      • Brian's Mess Of A Web Page
    • Experience: Experienced
    • OS: Windows 10
    Re: How does a keyboard translate words typed to the computer?
    « Reply #2 on: September 14, 2009, 10:51:26 AM »
    THESE search results should get you off to a good start.


    "For you, a thousand times over." - "The Kite Runner"

    m_seipp

      Topic Starter


      Newbie

      Re: How does a keyboard translate words typed to the computer?
      « Reply #3 on: September 14, 2009, 11:03:03 AM »
      What I need to find out is how are computers able to take the words entered on a keyboard and translate it into digital information? I hope that helps?

      Aegis



        Expert

        Thanked: 67
        • Yes
        • Yes
        • Brian's Mess Of A Web Page
      • Experience: Experienced
      • OS: Windows 10
      Re: How does a keyboard translate words typed to the computer?
      « Reply #4 on: September 14, 2009, 11:07:00 AM »
      Did you try any of the links referenced in my previous post?


      "For you, a thousand times over." - "The Kite Runner"

      Allan

      • Moderator

      • Mastermind
      • Thanked: 1260
      • Experience: Guru
      • OS: Windows 10
      Re: How does a keyboard translate words typed to the computer?
      « Reply #5 on: September 14, 2009, 11:08:45 AM »
      Well every time a key is depressed the OS reads that key as an electro-mechanical signal representing a specific keyboard character and converts it to machine language. It's that simple. The Operating System is no more than a user friendly (usually) interface between the human and the computer.

      Aegis



        Expert

        Thanked: 67
        • Yes
        • Yes
        • Brian's Mess Of A Web Page
      • Experience: Experienced
      • OS: Windows 10
      Re: How does a keyboard translate words typed to the computer?
      « Reply #6 on: September 14, 2009, 11:11:17 AM »
      Oh, that's a nice and concise answer, Allan.


      "For you, a thousand times over." - "The Kite Runner"

      Allan

      • Moderator

      • Mastermind
      • Thanked: 1260
      • Experience: Guru
      • OS: Windows 10
      Re: How does a keyboard translate words typed to the computer?
      « Reply #7 on: September 14, 2009, 11:13:41 AM »
      Concise is my middle name :)

      Salmon Trout

      • Guest
      Re: How does a keyboard translate words typed to the computer?
      « Reply #8 on: September 14, 2009, 02:17:03 PM »
      Concise is my middle name :)

      I knew it began with a C.

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: How does a keyboard translate words typed to the computer?
      « Reply #9 on: September 14, 2009, 06:54:34 PM »
      Oh, that's a nice and concise answer, Allan.

      concise but not precise.




      A keyboard consists of a set of switches mounted in a grid or an array called the key matrix. When a switch is pressed, a processor in the keyboard identifies which key is pressed by determining which grid location in the matrix shows continuity. The keyboard processor, which also interprets how long the key is pressed, can even handle multiple keypresses at the same time. A 16-byte hardware buffer in the keyboard can handle rapid or multiple keypresses, passing each one to the system in succession.

      When you press a key, the contact bounces slightly in most cases, meaning that several rapid on/off cycles occur just as the switch makes contact. This is called bounce. The processor in the keyboard is designed to filter this, or debounce the keystroke. The keyboard processor must distinguish bounce from a double key strike the keyboard operator intends to make. This is fairly easy, though, because the bouncing is much more rapid than a person could simulate by striking a key quickly several times.

      The keyboard in a PC is actually a computer itself. It communicates with the main system in one of two ways:

      -Through a special serial data link if a standard keyboard connector is used

      -Through the USB port

      The serial data link used by conventional keyboards transmits and receives data in 11-bit packets of information, consisting of 8 data bits, plus framing and control bits. Although it is indeed a serial link (in that the data flows on one wire), the keyboard interface is incompatible with the standard RS-232 serial port commonly used to connect modems.

      The processor in the original PC keyboard was an Intel 8048 microcontroller chip. Newer keyboards often use an 8049 version that has built-in ROM or other microcontroller chips compatible with the 8048 or 8049. For example, in its Enhanced keyboards, IBM has always used a custom version of the Motorola 6805 processor, which is compatible with the Intel chips. The keyboard's built-in processor reads the key matrix, debounces the keypress signals, converts the keypress to the appropriate scan code, and transmits the code to the motherboard. The processors built into the keyboard contain their own RAM, possibly some ROM, and a built-in serial interface.

      In the original PC/XT design, the keyboard serial interface is connected to an 8255 Programmable Peripheral Interface (PPI) chip on the motherboard of the PC/XT. This chip is connected to the interrupt controller IRQ1 line, which is used to signal to the system that keyboard data is available. The data is then sent from the 8255 to the processor via I/O port address 60h. The IRQ1 signal causes the main system processor to run a subroutine (INT 9h) that interprets the keyboard scan code data and decides what to do.

      In an AT-type keyboard design, the keyboard serial interface is connected to a special keyboard controller on the motherboard. This controller was an Intel 8042 Universal Peripheral Interface (UPI) slave microcontroller chip in the original AT design. This microcontroller is essentially another processor that has its own 2KB of ROM and 128 bytes of RAM. An 8742 version that uses erasable programmable read-only memory (EPROM) can be erased and reprogrammed. In the past, when you purchased a motherboard ROM upgrade for an older system from a motherboard manufacturer, the upgrade included a new keyboard controller chip as well because it had somewhat dependent and updated ROM code in it. Some older systems might use the 8041 or 8741 chips, which differ only in the amount of built-in ROM or RAM. However, recent systems incorporate the keyboard controller into the main system chipset.

      In an AT system, the (8048-type) microcontroller in the keyboard sends data to the (8042-type) keyboard controller on the motherboard. The motherboard-based controller also can send data back to the keyboard. When the keyboard controller on the motherboard receives data from the keyboard, it signals the motherboard with an IRQ1 and sends the data to the main motherboard processor via I/O port address 60h, just as in the PC/XT. Acting as an agent between the keyboard and the main system processor, the 8042-type keyboard controller can translate scan codes and perform several other functions as well. The system also can send data to the 8042 keyboard controller via port 60h, which then passes it on to the keyboard. Additionally, when the system needs to send commands to or read the status of the keyboard controller on the motherboard, it reads or writes through I/O port 64h. These commands usually are followed by data sent back and forth via port 60h.

      In older systems, the 8042 keyboard controller is also used by the system to control the A20 memory address line, which provides access to system memory greater than 1MB. More modern motherboards typically incorporate this functionality directly into the motherboard chipset. The AT keyboard connector was renamed the "PS/2" port after the IBM PS/2 family of systems debuted in 1987. That was the time when the connector changed in size from the DIN to the min-DIN, and even though the signals were the same, the mini-DIN version became known from that time forward as the PS/2 port.

      Keyboards connected to a USB port work in a surprisingly similar fashion to those connected to conventional DIN or mini-DIN (PS/2) ports after the data reaches the system. Inside the keyboard a variety of custom controller chips is used by various keyboard manufacturers to receive and interpret keyboard data before sending it to the system via the USB port. Some of these chips contain USB hub logic to enable the keyboard to act as a USB hub. After the keyboard data reaches the USB port on the system, the USB port routes the data to the 8042-compatible keyboard controller, where the data is treated as any other keyboard information.

      It is important to understand that when the motherboard receives a keypress from the keyboard (after being interrupted by the keyboard IRQ) a hardware interrupt is generated. The Operating System generally installs hooks on the hardware of all forms, and of course the keyboard is no exception. In the case of windows, for example, the keyboard driver interprets the passed scan code, and converts it to the appropriate windows virtual scan code. After calling all installed Hook Procedures (which may change the scan code, this is often how keyboard utility programs work), it also performs some additional processing of the scancode, since in some cases the message will not be WM_KEYDOWN (for example, in the case of certain keys such as F10, Alt (In fact any extended code involving alt) the passed message will be "WM_MENUCHAR") it then sends the message to the currently focused window, which interprets it accordingly.

      It is important to note that "machine code" is not data but rather executable code... I believe the intended term was "scan" code.

       it then sends a WM_KEYDOWN message to the currently focussed window. the operation is repeated when the key is released, via a WM_KEYUP message,

      I was trying to dereference Null Pointers before it was cool.

      computeruler



        Egghead

        Thanked: 63
        • Yes
        • Yes
      • Experience: Experienced
      • OS: Mac OS
      Re: How does a keyboard translate words typed to the computer?
      « Reply #10 on: September 14, 2009, 07:39:31 PM »
      Only bc can give a super long answer to a question like that

      Allan

      • Moderator

      • Mastermind
      • Thanked: 1260
      • Experience: Guru
      • OS: Windows 10
      Re: How does a keyboard translate words typed to the computer?
      « Reply #11 on: September 15, 2009, 06:00:44 AM »
      BC - while your explanation is clearly correct, mine was intended to be understood by earthlings  ;D

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: How does a keyboard translate words typed to the computer?
      « Reply #12 on: September 15, 2009, 06:10:24 AM »
      touche...   
      I was trying to dereference Null Pointers before it was cool.

      Salmon Trout

      • Guest
      Re: How does a keyboard translate words typed to the computer?
      « Reply #13 on: September 15, 2009, 06:45:32 AM »
      BC - while your explanation is clearly correct, mine was intended to be understood by earthlings  ;D

      It is practically meaningless. It was as if somebody asked "How does an automobile work?" and you answered, "It has an engine which converts the energy in the fuel into motion which moves the car along". Not untrue, but not terribly informative either.

      Also more than somewhat inaccurate; and what is an "electro-mechanical signal"?

      Mulreay

      • Guest
      Re: How does a keyboard translate words typed to the computer?
      « Reply #14 on: September 15, 2009, 07:45:44 AM »
      It is practically meaningless. It was as if somebody asked "How does an automobile work?" and you answered, "It has an engine which converts the energy in the fuel into motion which moves the car along". Not untrue, but not terribly informative either.

      Also more than somewhat inaccurate; and what is an "electro-mechanical signal"?


      That's a bit harsh.. he's only trying to explain and were all friends here. Lets all stop with the nit picking about someone's help.
      BC is correct but Allan is just trying to help. So a simple modification like BC did will do not ripping out Allans comment as if he has done something wrong.
      Salmon Trout next time back it up with some knowledge of your own rather than jump on someone for getting a miner thing wrong.

      (edit) I will start reporting anyone who disses other people there is no need and makes us all look like school children. Were here to help not attack each other.