162 lines
4.6 KiB
Typst
162 lines
4.6 KiB
Typst
= Experimental Low-Latency Tilesets
|
|
|
|
#let stylesheet = ```
|
|
.tile {
|
|
display: inline-block;
|
|
font-size: 1.4em;
|
|
width: 1em;
|
|
margin-block: -0.25em;
|
|
aspect-ratio: 1;
|
|
|
|
background-image: url('/wiki-schematic-sprite.png'), url('/wiki-schematic-sprite.png');
|
|
background-color: white;
|
|
background-size: 31.99em;
|
|
image-rendering: pixelated;
|
|
}
|
|
|
|
.r1-l { background-position: -8em -5em, -0em -2em; }
|
|
.r2-l { background-position: -9em -5em, -0em -2em; }
|
|
.r3-l { background-position: -10em -5em, -0em -2em; }
|
|
.r4-l { background-position: -11em -5em, -0em -2em; }
|
|
.c-l { background-position: -12em -7em, -0em -2em; }
|
|
.block { background-position: -7em -0em, -0em -2em; }
|
|
.wire-lr { background-position: -10em -2em, -0em -2em; }
|
|
|
|
```
|
|
|
|
#let tileset(file, summary: none, start: 1) = html.details(open: false)[
|
|
#if summary != none { html.summary(summary) }
|
|
|
|
#html.div(style: "font-size: larger", {
|
|
show "R1": html.i(class: "tile r1-l", title: "2gt Repeater")
|
|
show "R2": html.i(class: "tile r2-l", title: "4gt Repeater")
|
|
show "R3": html.i(class: "tile r3-l", title: "6gt Repeater")
|
|
show "R4": html.i(class: "tile r4-l", title: "8gt Repeater")
|
|
show "C": html.i(class: "tile c-l", title: "Comparator")
|
|
show "-": html.i(class: "tile wire-lr", title: "Redstone Wire (or opaque block)")
|
|
show " ": none
|
|
|
|
let lines = read(file).trim().split("\n").map(it => it.trim("-"))
|
|
enum(start: start, ..lines)
|
|
})
|
|
]
|
|
|
|
#html.style(stylesheet.text)
|
|
|
|
#link("chains.py", `chains.py`) enumerates generalized tilesets, accounting for priorities 0, -1,
|
|
and -3 with various delays. Note it does _not_ account for inverted components or pulses, so cannot
|
|
include priority -2.
|
|
|
|
Still, this means we have 3 priorities and 4 delays to work with. The number of chains with total
|
|
delay $n$ is $O(9^(n\/2))$. For example, at 8gt delay, there are 97 generalized tilesets but only
|
|
$2^4 = 16$ binary tileset.
|
|
|
|
The generalized tilesets are highly irregular, but they may be useful for static prefixes or
|
|
suffixes where latency is critical.
|
|
|
|
== Variable-length tilesets 2gt - 10gt.
|
|
|
|
I don't include them all explicitly here since the plain lists are unweildy, but at various delays
|
|
the number of general chains grows quickly:
|
|
|
|
#html.table(
|
|
{
|
|
html.colgroup({
|
|
html.col(style: "width: 15ch")
|
|
html.col(style: "width: auto")
|
|
html.col(style: "width: 15ch")
|
|
})
|
|
html.thead({
|
|
html.th[Total Delay]
|
|
html.th[\# General]
|
|
html.th[\# Binary]
|
|
})
|
|
html.tbody({
|
|
html.tr({
|
|
html.td[2gt]
|
|
html.td(tileset("tileset-2-n.txt", summary: [2]))
|
|
html.td[2]
|
|
})
|
|
html.tr({
|
|
html.td[4gt]
|
|
html.td(tileset("tileset-4-n.txt", summary: [7]))
|
|
html.td[4]
|
|
})
|
|
html.tr({
|
|
html.td[6gt]
|
|
html.td(tileset("tileset-6-n.txt", summary: [26]))
|
|
html.td[8]
|
|
})
|
|
html.tr({
|
|
html.td[8gt]
|
|
html.td(tileset("tileset-8-n.txt", summary: [97]))
|
|
html.td[16]
|
|
})
|
|
html.tr({
|
|
html.td[10gt]
|
|
html.td[361]
|
|
html.td[32]
|
|
})
|
|
html.tr({
|
|
html.td[12gt]
|
|
html.td[1343]
|
|
html.td[64]
|
|
})
|
|
html.tr({
|
|
html.td[14gt]
|
|
html.td[4997]
|
|
html.td[128]
|
|
})
|
|
})
|
|
},
|
|
)
|
|
|
|
== Uniform subsets
|
|
|
|
The variable-length tilesets are difficult to wire, so some useful subsets are those with a fixed
|
|
number of _blocks_. These still grow faster in $n$ than the equivalent binary tilesets.
|
|
|
|
Note that the output of #link("chains.py", `chains.py`) always includes a trailing redstone wire,
|
|
since the last diode in the tileset can never be facing another diode. You must then add one to the
|
|
block count to account for this extra wire. For example, the command to generate the "10gt, 5 block"
|
|
list below is `python chains.py 10 6`, and it produces output like "`- R1 C R2 - C`" (where the
|
|
signal flows right-to-left).
|
|
|
|
#html.table(
|
|
{
|
|
html.colgroup({
|
|
html.col(style: "width: 15ch")
|
|
html.col(style: "width: auto")
|
|
html.col(style: "width: 15ch")
|
|
})
|
|
html.thead({
|
|
html.th[Total Delay]
|
|
html.th[\# General]
|
|
html.th[\# Binary]
|
|
})
|
|
html.tbody({
|
|
html.tr({
|
|
html.td[8gt, 4 block]
|
|
html.td(tileset("tileset-8-4.txt", summary: [39]))
|
|
html.td[16]
|
|
})
|
|
html.tr({
|
|
html.td[10gt, 5 block]
|
|
html.td(tileset("tileset-10-5.txt", summary: [135]))
|
|
html.td[32]
|
|
})
|
|
html.tr({
|
|
html.td[12gt, 6 block]
|
|
html.td[481]
|
|
html.td[64]
|
|
})
|
|
html.tr({
|
|
html.td[14gt, 7 block]
|
|
html.td[1740]
|
|
html.td[128]
|
|
})
|
|
})
|
|
},
|
|
)
|
|
|