
This project is a 1x2 Tiny Tapeout VGA nearest-prototype visualizer. It uses a 25.175 MHz pixel clock to generate a 640×480 display. Four colored prototypes divide the left side of the screen into nearest-prototype regions, while the right side shows the active mode and training status.
The input metric selects how distance is measured:
ui_in[1:0] |
Metric |
|---|---|
00 |
Manhattan / L1 |
01 |
Chebyshev / L-infinity |
10 |
Octagonal L2 approximation |
11 |
Binary-coordinate Hamming distance |
White crosshairs show the prototype positions. Equal distances choose the lower-numbered prototype. The selected metric and training request update at a frame boundary so the displayed frame stays coherent.
| Pin | Function |
|---|---|
ui_in[1:0] |
Select the distance metric |
ui_in[2] |
Enable online training |
ui_in[4:3] |
Select prototype 0–3 |
ui_in[5] |
Select axis: 0 X, 1 Y |
ui_in[6] |
Select direction: 0 decrement, 1 increment |
ui_in[7] |
Step strobe for a manual move |
A rising edge on Step moves the selected coordinate by one logical unit at the next frame boundary. Online training uses an internal pseudo-random sample to slowly move the nearest prototype. Keep selector inputs stable around a Step pulse.
uo_out and a monitor that supports 640×480.ui_in[1:0] to select a metric and observe the region pattern change on the next frame.ui_in[7] to move its crosshair.ui_in[2] high to enable online training.ui_in; use a debounced source for StepThe VGA outputs are R1,G1,B1,VSync_n,R0,G0,B0,HSync_n on uo_out[0:7]. The bidirectional pins are unused.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | Metric request bit 0 (00 L1, 01 Linf, 10 octagonal L2, 11 Hamming) | TinyVGA red MSB (R1) | Unused (input only) |
| 1 | Metric request bit 1 | TinyVGA green MSB (G1) | Unused (input only) |
| 2 | Training enable request | TinyVGA blue MSB (B1) | Unused (input only) |
| 3 | Manual centroid select bit 0 | TinyVGA active-low vertical sync | Unused (input only) |
| 4 | Manual centroid select bit 1 | TinyVGA red LSB (R0) | Unused (input only) |
| 5 | Manual axis (0 X, 1 Y) | TinyVGA green LSB (G0) | Unused (input only) |
| 6 | Manual direction (0 decrement, 1 increment) | TinyVGA blue LSB (B0) | Unused (input only) |
| 7 | Manual step transaction strobe | TinyVGA active-low horizontal sync | Unused (input only) |