hardware: show the 64 cells as an 8 x 8 lamp matrix, not a ring
ci / linux-arm64 (push) Successful in 5m2s
ci / linux-arm64 (push) Successful in 5m2s
The ISA says nothing about how long memory is -- ">" and "<" are just moves, so the model is an unbounded line of cells. Our implementations bound it: the build option sets a ring of N cells (default 259, the machine 64) and the pointers wrap modulo N. Measured peaks over every tape we ship are 155 cells (flagship), 51 (calculator), 49 (hello), 27 (term), so 64 never wraps in practice and the wrap costs nothing in hardware: a six bit counter just rolls over. The panel display follows the model rather than a circle: an 8 by 8 matrix of lamps, one per cell, showing that cell LSB -- the only bit biz and rnz ever look at -- with the pointer blinking like a cursor so dp is visible without a number. The small dial in column one still shows the whole byte of the pointed cell, so the two displays answer different questions: which cells are set, and what is in the one the machine is standing on. Hardware side this is the classic lamp matrix: eight row lines and eight column lamp drivers, plus one gate that ORs the cursor into the pointed column and row. Bulbs, not LEDs, but the drive is the same.
This commit is contained in:
1 parent
9693c3eb88
commit
4b225a4320
2 files changed
+31
-22
No files matched your search
Binary file not shown.
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 97 KiB |
@@ -133,28 +133,37 @@ def main():
|
||||
fill=(200, 90, 62) if lit else (52, 31, 27),
|
||||
outline=(78, 43, 37), width=p(0.2))
|
||||
|
||||
# ---- column 3: the data ring -------------------------------------------
|
||||
cx, cy, r = CX[2] + 28.0, ROW[0] + 9.0, 17.5
|
||||
d.ellipse([p(cx - r), p(cy - r), p(cx + r), p(cy + r)], outline=(52, 57, 62),
|
||||
width=p(0.25))
|
||||
for i in range(64):
|
||||
a = -math.pi / 2 + 2 * math.pi * i / 64
|
||||
px, py = cx + r * math.cos(a), cy + r * math.sin(a)
|
||||
lit = i == 33
|
||||
rr = 0.78 if lit else 0.44
|
||||
if lit:
|
||||
g.ellipse([p(px - rr * 2.0), p(py - rr * 2.0), p(px + rr * 2.0),
|
||||
p(py + rr * 2.0)], fill=NEON + (215,))
|
||||
d.ellipse([p(px - rr), p(py - rr), p(px + rr), p(py + rr)], fill=NEON)
|
||||
else:
|
||||
d.ellipse([p(px - rr), p(py - rr), p(px + rr), p(py + rr)],
|
||||
fill=(62, 31, 26))
|
||||
a = -math.pi / 2 + 2 * math.pi * 33 / 64
|
||||
d.line([p(cx), p(cy), p(cx + r * math.cos(a)), p(cy + r * math.sin(a))],
|
||||
fill=(198, 162, 96), width=p(0.35))
|
||||
d.text((p(CX[2] + 1.0), p(cy + r + 2.6)), "DATA RING 64 · dp lit",
|
||||
font=font(1.35), fill=ENGRAVE_DIM)
|
||||
|
||||
# ---- column 3: the 64 cells as a lamp matrix ----------------------------
|
||||
# The memory is an unbounded line in the ISA ("> and < just move), and this
|
||||
# machine implements it as a ring of 64 cells. The matrix shows all 64: one
|
||||
# lamp per cell, showing that cell's LSB -- the only bit biz and rnz look at --
|
||||
# and the pointer blinks, like a cursor, so dp is visible without a number.
|
||||
head(d, CX[2], 23.6, "DATA 64 · LSB PER CELL")
|
||||
mx, my, pitch, lrad = CX[2] + 2.0, ROW[0] - 1.0, 5.4, 1.75
|
||||
pattern = [0x9C, 0x71, 0x23, 0xC8, 0x4E, 0x96, 0x3B, 0xA5]
|
||||
for row in range(8):
|
||||
for col in range(8):
|
||||
idx = row * 8 + col
|
||||
bit = (pattern[row] >> (7 - col)) & 1
|
||||
x = mx + col * pitch
|
||||
y = my + row * pitch
|
||||
if idx == 33: # the pointer: hollow, blinking
|
||||
g.ellipse([p(x - lrad * 1.9), p(y - lrad * 1.9),
|
||||
p(x + lrad * 1.9), p(y + lrad * 1.9)],
|
||||
fill=NEON + (150,))
|
||||
d.ellipse([p(x - lrad - 0.5), p(y - lrad - 0.5),
|
||||
p(x + lrad + 0.5), p(y + lrad + 0.5)],
|
||||
outline=NEON, width=p(0.5))
|
||||
elif bit:
|
||||
g.ellipse([p(x - lrad * 1.4), p(y - lrad * 1.4),
|
||||
p(x + lrad * 1.4), p(y + lrad * 1.4)], fill=BULB + (185,))
|
||||
d.ellipse([p(x - lrad), p(y - lrad), p(x + lrad), p(y + lrad)],
|
||||
fill=BULB, outline=(122, 90, 34), width=p(0.22))
|
||||
else:
|
||||
d.ellipse([p(x - lrad), p(y - lrad), p(x + lrad), p(y + lrad)],
|
||||
fill=(38, 34, 28), outline=(70, 65, 55), width=p(0.22))
|
||||
d.text((p(CX[2] + 2.0), p(my + 8 * pitch + 1.6)),
|
||||
"8 x 8 · LSB OF EACH CELL · POINTER BLINKS", font=font(1.25), fill=ENGRAVE_DIM)
|
||||
# ---- row 2: controls ----------------------------------------------------
|
||||
for cx_, label in ((18.0, "RUN"), (34.0, "STEP"), (50.0, "RESET")):
|
||||
d.ellipse([p(cx_ - 4.6), p(58.5 - 4.6), p(cx_ + 4.6), p(58.5 + 4.6)],
|
||||
|
||||
Reference in new issue
Block a user