Menu

Theme

Component reference · Reference · CHECKED ON 5.0.0

Logisim joystick, keyboard, TTY, LED matrix and video

The Logisim Keyboard keeps typed characters in a buffer and outputs the oldest one as a 7-bit ASCII code. Its available output is 1 while the buffer is not empty, and a clock trigger with read enable at 1 consumes that character. The TTY prints the 7-bit code on its data input at each clock trigger while write enable is 1. Wire keyboard data to TTY data, keyboard available to both enables, and one clock to both clocks. The Logisim joystick has two 4-bit outputs, one for each axis.
FOR
CPU builders and lab students who need text in, text out or a small display
CHECKED
12 Nov 2026
Checked against Logisim-evolution 5.0.0 on 1 machines
On this page

Echo typed keys on a TTY

The Keyboard and the TTY are a matched pair. Both have a clear input, a clock and an enable, and the Keyboard’s available output is exactly the signal the TTY wants as its write enable.

Keyboard1. Clearin 12. Clockin 13. Read enablein 14. Availableout 15. Dataout 7
Keyboard ports, from our measured geometry and the tooltips 5.0.0 shows (F44). crosshair = the loc Logisim stores
Ports as a table
#PortDirectionWidthOffset from anchor
1Clearin1(20, 10)
2Clockin1(0, 0)
3Read enablein1(10, 10)
4Availableout1(130, 10)
5Dataout7(140, 10)
TTY1. Clearin 12. Clockin 13. Write enablein 14. Datain 7
TTY ports. The data input is the 7-bit ASCII code of the next character. crosshair = the loc Logisim stores
Ports as a table
#PortDirectionWidthOffset from anchor
1Clearin1(20, 10)
2Clockin1(0, 0)
3Write enablein1(10, 10)
4Datain7(0, -10)
  1. Place the parts

    Put a Clock, a Keyboard and a TTY on the sheet (Input/Output library for the last two).

  2. Wire the handshake

    Send the same Clock to the Keyboard clock and to the TTY clock. Connect the Keyboard available output to the TTY write enable and to the Keyboard’s own read enable. Connect the Keyboard 7-bit data output to the TTY data input. Hold both clear inputs at 0.

  3. Turn ticks on and type

    Press Ctrl+K to switch ticks on, click the Keyboard component with the Poke tool so it has focus, then type. A character reaches the TTY about one clock period later.

LAB lab-lnx · Linux lab5.0.02026-11-12

Logisim-evolution 5.0.0 window at 2x zoom showing a Clock, a Keyboard component with a magenta focus ring and a grey TTY screen that displays the three typed characters, h, i and an exclamation mark.

A Keyboard wired to a TTY with ticks on. After clicking the Keyboard and typing three characters, the same three appear at the top left of the TTY.lab-lnx-le500-io-keyboard-tty-01
A Clock, a Keyboard with a magenta focus ring and a grey TTY screen showing the three typed characters.

What each port does

Part Port Meaning, in our words
Keyboard Clear A 1 empties the buffer.
Keyboard Clock A trigger removes the front character if read enable is 1.
Keyboard Read enable 0 stops the clock from consuming characters.
Keyboard Available 1 while the buffer holds a character.
Keyboard Data ASCII code of the front character, 7 bits.
TTY Clear A 1 clears the screen.
TTY Clock A trigger adds the character on the data input.
TTY Write enable 0 stops the clock from adding characters.
TTY Data ASCII code of the next character, 7 bits.

Keyboard and TTY attributes

Part Attribute Default Choices
Keyboard Buffer Length 32 a number
Keyboard Trigger Rising Edge Rising Edge, Falling Edge
TTY Rows 8 a number
TTY Columns 32 a number
TTY Trigger Rising Edge Rising Edge, Falling Edge
TTY Color black a colour
TTY Background transparent black a colour

Defaults read from the 5.0.0 jar (lab23). We did not test the limits of the number fields.

The data inputs are 7 bits wide, so only ASCII codes 0 to 127 are possible. In one run, typing a, b and Enter left ab on the first line and the cursor on the second, so Enter starts a new line. We did not test Backspace.

The command-line --tty tty format sends the TTY component’s text to standard output, which is useful for autograders. Add halt so the run ends by itself. Our hello circuit prints five letters and stops:

$ java -jar logisim-evolution-5.0.0-all.jar --tty tty,halt circ-io-tty-hello.circ
HELLO
circ-io-tty-hello · mainscroll to see all
clkclkCounteraddrclkqROMtextqdTTYttyclkd10cyhaltcy
A counter steps through a ROM that holds HELLO. The counter's carry output is the halt pin. CC BY 4.0 · SHA-256 64e463cf6a4c
Describe this circuit

Components: Clock 1; Counter addr; ROM text; TTY tty; Constant 1; Constant 2; Output pin halt.

  • Clock 1 connects to Counter addr, TTY tty (net clk).
  • Counter addr connects to ROM text (net q), 8 bits wide.
  • Counter addr connects to Output pin halt (net cy, halt).
  • ROM text connects to TTY tty (net d), 8 bits wide.
  • TTY tty connects to Constant 2.
  • TTY tty connects to Constant 1.

Download circ-io-tty-hello.circ. It was saved by 5.0.0 and does not open in 2.7.1. The halt message goes to the error stream, so standard output holds only the text. A fuller guide to the format is in the command line page.

Common keyboard and TTY problems

  • Nothing is printed. Write enable is 0, no clock reaches the TTY, or clear is held at 1.
  • Characters print twice. Write enable stayed high for two triggers. Drive it from the Keyboard available output.
  • The buffer empties by itself. The Keyboard clear input is wired to a floating or active signal. Tie it to a constant 0.
  • Characters are missing. The buffer may be full. Raise Buffer Length; we did not test the full-buffer case.

LED matrix

The LED matrix component is named DotMatrix in the file. With the default Columns input format it has five inputs, each 7 bits wide, one per column.

DotMatrix1. inin 72. inin 73. inin 74. inin 75. inin 7
Default LED matrix: five 7-bit column inputs. crosshair = the loc Logisim stores
Ports as a table
#PortDirectionWidthOffset from anchor
1inin7(0, 0)
2inin7(10, 0)
3inin7(20, 0)
4inin7(30, 0)
5inin7(40, 0)

In our test the five constants 0x7e, 0x11, 0x11, 0x11 and 0x7e drew a tall bar on each side joined by a middle bar. Bit 0 is the bottom row and bit 6 the top row.

LAB lab-lnx · Linux lab5.0.02026-11-12

A 5 by 7 LED matrix component in Logisim-evolution 5.0.0 drawn in green and grey, fed by five constants 0x7e, 0x11, 0x11, 0x11 and 0x7e shown below it.

The LED matrix with the Columns input format. The first and last columns are 0x7e (rows 1 to 6 lit) and the three middle columns are 0x11, so bit 0 is the bottom row.lab-lnx-le500-io-led-matrix-01
A 5 by 7 LED matrix in green and grey, driven by five constants shown below it.

Defaults we read: 5 columns, 7 rows, on colour green, off colour grey, Light Persistence 0 ticks, Dot Shape square (choices circle, square, cluster segment). Other input formats are Rows and Select. We did not test them or drive the matrix from a ROM. The ROM page shows how to store the pattern.

RGB Video

RGB Video1. inin 12. inin 13. inin 14. inin 75. inin 76. inin 24
RGB Video default ports: three 1-bit inputs, two 7-bit inputs and one 24-bit input. crosshair = the loc Logisim stores
Ports as a table
#PortDirectionWidthOffset from anchor
1inin1(0, 0)
2inin1(10, 0)
3inin1(20, 0)
4inin7(40, 0)
5inin7(50, 0)
6inin24(60, 0)

The ports, in order, are reset, clock, write enable, X (7 bits), Y (7 bits) and colour (24 bits). The default colour model is 888 RGB (24 bit). The Color Model attribute also offers 555, 565, 444, 8-colour, Atari 2600, XTerm16, XTerm256, Grayscale and VGA256. Resolution defaults to 128 by 128 and offers 256x256, 320x240, 640x480, 960x540, 1024x768, 1280x720, 1920x1080 and Custom. Cursor, Reset Behavior and Scale are also attributes.

LAB lab-lnx · Linux lab5.0.02026-11-12
One pixel written to RGB Video at X 10, Y 10 with colour 0xFF0000.lab-lnx-le500-io-video-pixel-01
The RGB Video screen, black, with a single red pixel near the top left corner.

Joystick, buttons and switches

LAB lab-lnx · Linux lab5.0.02026-11-12

A Logisim sheet with a Button, a Joystick, an 8-way DIP switch, an RGB Video screen with one red pixel near its top left corner, and output pins showing their values.

The poke sheet: a Button, Joystick, DIP switch and RGB Video, each wired to output pins.lab-lnx-le500-io-poke-panel-01
A sheet with a Button, Joystick, DIP switch and RGB Video screen showing one red pixel, plus output pins.
Part Outputs Behaviour we saw Attributes we read
Button one, 1 bit 1 while the mouse is held on it, 0 after release Logic level: active on press or passive
Joystick two, x and y, 4 bits each 1000 at rest; smaller values toward the top left; returns to the centre on release Bit Width 2 to 5
DIP Switch 8 one-bit outputs by default a click toggles a switch and it stays in position Number of Switch
Matrix Keypad four row inputs, four column outputs holding a key connects its row input to its column output; unpressed columns stay undefined Operating mode: raw or Pmod KYPD
LAB lab-lnx · Linux lab5.0.02026-11-12
Pressing the Joystick toward its top left gave small x and y values; at rest both read 1000.lab-lnx-le500-io-joystick-poke-01
The Joystick pressed toward its top left: the red stick sits at the upper left and both 4-bit output pins show small values.

Matrix Keypad

The keypad has four inputs along the bottom edge and four outputs on the right edge. The inputs are rows, left to right for the keypad rows from top to bottom, and the outputs are columns, top to bottom for the keypad columns from left to right. Holding a key connects the input of its row to the output of its column, so a circuit scans it like a real keypad: drive one row, read the four columns. A column with no key held on a driven row reads undefined (U), not 0, so add a pull-down or treat U as no key.

LAB lab-lnx · Linux lab5.0.02026-11-12

The Matrix Keypad poke panel: four row input pins below the keypad, four column output pins on the right. With the second row input set to 1 and key 5 held with the mouse, the second column output shows 1 and the other three show U for undefined.

Row input 2 is 1 and key 5 is held: the second column output reads 1 and the other three outputs stay undefined.lab-lnx-le500-matrix-keypad-poke-01
A Matrix Keypad with key 5 held, the second row input at 1 and one column output showing 1.

In Logisim 2.7.1 the same two parts behaved the same way (F133): the Button read 1 while held and 0 after release, and the Joystick read 1000 on both outputs at rest, 0100 on both with the knob pulled toward the top left, and 1100 toward the bottom right, then returned to 1000 on release.

LAB lab-lnx · Linux lab2.7.12026-11-12

A Logisim 2.7.1 window cut down to the Joystick with its knob toward the top left and the two 4-bit output pins JX and JY both showing 0100.

Logisim 2.7.1: the Joystick pulled toward the top left, both outputs 0100 (4).lab-lnx-l271-io-joystick-poke-01
Classic 2.7.1 Joystick held toward the top left, with both outputs reading 0100.

The Button is momentary and the DIP Switch keeps its position. We saw the Joystick values only roughly (about 2 for the top left and 8 at rest); read the pins yourself for exact numbers. For a plain on/off input see the pins page.

Version differences

Feature2.7.15.0.0
Keyboard, TTY, LED matrix2.7.1: yessame port layout in our data5.0.0: yestested (F116)
Button and Joystick2.7.1: yespoked (F133)5.0.0: yespoked (F125)
RGB Video, DIP Switch, Matrix Keypad2.7.1: nonot in 2.7.15.0.0: yesDIP switch and video (F125), keypad (F132)

On a real board these parts are mapped in the FPGA guide window. See also all components and the 8-bit CPU project, which uses a TTY for output.

Frequently asked questions

How do I use the keyboard in Logisim?

Wire it to a TTY as described above, switch ticks on with Ctrl+K, click the Keyboard component and type. In our test three typed characters reached the TTY.

Why does my TTY not print anything?

The usual causes are write enable at 0, no clock reaching the TTY, or clear held at 1. Check each with the Poke tool.

Why are my characters printed twice?

A character is written at every clock trigger while write enable is 1. If the enable stays high for two triggers the TTY prints the character twice, so drive write enable from the keyboard's available output.

How do I use the joystick in Logisim?

The Joystick has two outputs, x and y, each 4 bits wide by default (the Bit Width attribute allows 2 to 5). At rest both read 1000 (8); pressing toward a corner gave small values for the top left (F125).

Does Logisim have a screen or VGA output?

It has an RGB Video component: a pixel screen with clock, write enable, reset, 7-bit X and Y and a 24-bit colour input by default. One pixel written at X 10, Y 10 with colour 0xFF0000 appeared as a red dot (F125).

How do I make a push button in Logisim?

Use the Button component. It has one 1-bit output and a Logic level attribute with the choices active on press and passive.

Sources

  1. Keyboard, TTY and LED matrix tests on Logisim-evolution 5.0.0, logisim.dev lab data: test-data/lab23-2026-11-12-io/, src/content/circuits/circ-io-tty-hello
  2. Measured port positions and names, logisim.dev lab data: test-data/lab2-2026-11-09-components/component-port-names-le500.tsv

Try: , , ,