keyboard.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <html>
  2. <head>
  3. <title>Keyboard</title>
  4. </head>
  5. <body bgcolor="FFFFFF">
  6. <h1><img align="center" src="../../../../en/icons/keyboard.gif" width="32" height="32">
  7. <em>Keyboard</em></h1>
  8. <p><table>
  9. <tr><td><strong>Library:</strong></td>
  10. <td><a href="index.html">Input/Output</a></td></tr>
  11. <tr><td><strong>Introduced:</strong></td>
  12. <td>2.2.0</td></tr>
  13. <tr><td valign="top"><strong>Appearance:</strong></td>
  14. <td valign="top"><img src="../../../../en/img-libs/keyboard.png" width="148" height="28"></td></tr>
  15. </table></p>
  16. <h2>Behavior</h2>
  17. <p>This component allows the circuit to read keys typed from the keyboard -
  18. as long as the keys are representable in the 7-bit ASCII code.
  19. After clicking the component using the poke tool, the user can type characters,
  20. which accumulate in a buffer. At all times, the ASCII value for the leftmost
  21. character in the buffer is sent out the rightmost output. When the clock input
  22. is triggered, the leftmost character disappears from the buffer and the new
  23. leftmost character is sent on the rightmost output.</p>
  24. <p>The supported characters for the buffer include all the printable ASCII
  25. characters, as well as space, newline, backspace, and control-L. In addition,
  26. the left-arrow and right-arrow keys move the cursor within the buffer, and the
  27. delete key deletes the character to the right of the cursor (if any).</p>
  28. <p>The component is asynchronous in the sense that when the buffer is empty and
  29. the user types a character, that character is sent immediately as an output,
  30. without any wait for a clock pulse.</p>
  31. <h2>Pins</h2>
  32. <dl>
  33. <dt>West edge, marked by a triangle (input, bit width 1)</dt>
  34. <dd>Clock - when triggered while the read-enable pin isn't 0, the leftmost
  35. character from the buffer is deleted,
  36. and the outputs are updated to reflect the buffer's new status.</dd>
  37. <dt>South edge, leftmost pin (input, bit width 1)</dt>
  38. <dd>Read Enable - when 1 (or floating or error), a clock edge will consume
  39. the leftmost character from the buffer. The clock input is ignored when
  40. Read Enable is 0.</dd>
  41. <dt>South edge, second pin from left (input, bit width 1)</dt>
  42. <dd>Clear - when 1, the buffer is emptied and does not accept further
  43. characters.</dd>
  44. <dt>South edge, second pin from right (output, bit width 1)</dt>
  45. <dd>Available - this is 1 when the buffer contains at least one character
  46. and 0 when the buffer is empty.</dd>
  47. <dt>South edge, rightmost pin (output, bit width 7)</dt>
  48. <dd>Data - the 7-bit ASCII code for the leftmost character in the buffer,
  49. or 0 if the buffer is empty.</dd>
  50. </dl>
  51. <h2>Attributes</h2>
  52. <dl>
  53. <dt>Buffer Length</dt>
  54. <dd>The number of characters that the buffer can hold at once.</dd>
  55. <dt>Trigger</dt>
  56. <dd>If the value is <q>Rising Edge,</q> then when the clock input changes
  57. from 0 to 1, the leftmost character is consumed (when enabled by the Read
  58. Enable input). If it is <q>Falling Edge,</q>, then this happens when the
  59. clock input changes from 1 to 0.</dd>
  60. </dl>
  61. <h2>Poke Tool Behavior</h2>
  62. <p>Pressing the mouse button into the component gives keyboard focus to the
  63. component, and a vertical-bar cursor will be displayed.</p>
  64. <p>Each character typed will then be inserted into the buffer, as long as the
  65. buffer hasn't reached its capacity and the character is one of those that the
  66. component supports: the printable characters within the 7-bit ASCII code, as
  67. well as space, backspace, newline, and control-L. Additionally, the user may
  68. type the left-arrow and right-arrow keys to change the location of the cursor
  69. within the buffer, and the user may type the delete key to delete the buffer
  70. character (if any) just to the right of the cursor.</p>
  71. <h2>Text Tool Behavior</h2>
  72. <p>None.</p>
  73. <p><a href="../index.html">Back to <em>Library Reference</em></a></p>
  74. </body>
  75. </html>