PageSourceSearch

https://simten.dev/assets/AddressingSection-Bw1yKRzg.js

js simten.dev collected 2026-09-29 07:17:32 UTC 1,767 bytes, 1 lines download raw bytes

1import{j as e}from"./main-5zZu2UcF.js";import{S as t}from"./circuits-CpRoy74_.js";import{C as r}from"./CircuitEmbed-BaKGR7p9.js";import"./useCircuitSimulator-Ocs-zDtT.js";import"./CircuitCanvas-9Oc83aTy.js";import"./index-C6v6OnJi.js";function n(){return e.jsxs("section",{className:"py-12",children:[e.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:"From Coordinates to Pixels"}),e.jsxs("div",{className:"prose-invert space-y-6",children:[e.jsxs("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed",children:["The snake moves on a 2D grid, but the framebuffer is a flat array of 64 bytes. We convert"," ",e.jsx("strong",{className:"text-gray-900 dark:text-white",children:"(X, Y)"})," to a linear address: ",e.jsx("code",{className:"text-blue-300",children:"address = (Y « 3) + X"}),"."]}),e.jsxs("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed",children:["Multiplying by 8 is a left shift by 3, and in hardware a constant shift costs"," ",e.jsx("strong",{className:"text-gray-900 dark:text-white",children:"zero gates"}),". It’s just wiring. Each bit of Y connects three places higher, the low three bits tied to zero. The only real gate is the final"," ",e.jsx("strong",{className:"text-gray-900 dark:text-white",children:"Adder"})," for X."]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed",children:"Change X and Y below. At (3, 2) you get address 19, row 2 column 3."})]}),e.jsx("div",{className:"mt-8",children:e.jsx(r,{circuit:t.coordToPixel.circuit,layout:t.coordToPixel.layout,showControls:!0,title:"Coordinate to Pixel Address",description:"(Y << 3) + X. The shift is just wiring; only the final add is a real gate"})})]})}export{n as AddressingSection};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.