add_component
Add a built-in Logisim component at a specified location and return its absolute port positions; use it to construct and wire circuits programmatically.
Instructions
Add a built-in library component (east-facing) and return its absolute ports.
kind: dff | tff | jkff | srff (flip-flops: D/T or J,K / S,R, clock, Q, Qn, async
reset / preset / enable), register (data, clock, clear, enable, out), counter
(clock, count, load, data, clear, out, carry), mux (in0.., select, out;
select_bits 1..4), adder (A, B, carry_in, out, carry_out), subtractor (A, B,
borrow_in, out, borrow_out). width applies to register/counter/mux/adder/
subtractor data. trigger (memory parts): rising | falling | high | low.
ram: addr_bits x width RAM, separate ports (addr, data = read out, din, we = store
on rising clock, clock, optional cs/oe/clear); load contents with ram_image in
simulate_sequential or write_ram_image for the GUI. decoder: select -> out0..
out(2**select_bits - 1). splitter: combined (width bits) <-> split0.. with group
sizes splits LSB first, e.g. [5, 3]. bit_extender: in (in_width) -> out (width),
zero-extended. Optional ports (Qn, reset, preset, enable, carry...) may stay
unconnected; note an unconnected counter count input counts every cycle.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"kind": "<kind>",
"x": "<x>",
"y": "<y>"
},
"name": "add_component"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | ||
| y | Yes | ||
| kind | Yes | ||
| path | Yes | ||
| label | No | ||
| width | No | ||
| splits | No | ||
| circuit | No | ||
| trigger | No | rising | |
| in_width | No | ||
| addr_bits | No | ||
| select_bits | No |