MOS substitution: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
|||
| Line 68: | Line 68: | ||
Just as rotating the filling MOS while fixing the mode of the template MOS serves to distinguish different MOS substitution scales, we take the mode of the template MOS (treating the slot letter as the smaller step) and write it in UDP to indicate the mode of a given MOS substitution scale. | Just as rotating the filling MOS while fixing the mode of the template MOS serves to distinguish different MOS substitution scales, we take the mode of the template MOS (treating the slot letter as the smaller step) and write it in UDP to indicate the mode of a given MOS substitution scale. | ||
For example: Taking the 5|5 mode of the template MOS in subst 5'''L'''(2'''m'''4'''s''' 4 | For example: Taking the 5|5 mode of the template MOS in subst {{nowrap|5'''L'''(2'''m'''4'''s''' 4{{!}}0(2))}} ('''LmLsLsLmLss''') yields the mode '''sLmLsLsLmLs''', denoted {{nowrap|"subst 5'''L'''(2'''m'''4'''s''' 4{{!}}0(2))}} 5|5". | ||
== Examples == | == Examples == | ||
| Line 232: | Line 232: | ||
return result | return result | ||
# | # In UDP, brightness = number of generators up * gcd of the step counts}} | ||
# | # Function returns subst nX X (nY Y nZ Z (brightness_of_filling_mos) | (nY + nZ - gcd(nY, nZ) - brightness_of_filling_mos)) | ||
def mos_subst(nX, nY, nZ, sizeX, sizeY, sizeZ, brightness_of_filling_mos): | def mos_subst(nX, nY, nZ, sizeX, sizeY, sizeZ, brightness_of_filling_mos): | ||
template_mos = mos_word(nX, nY + nZ, "X", "W", brightness=nX + nY + nZ - gcd(nX, nY + nZ)) # MOS word with nX X's and nY + nZ W's; X is treated as L and W as s for purposes of brightness | template_mos = mos_word(nX, nY + nZ, "X", "W", brightness=nX + nY + nZ - gcd(nX, nY + nZ)) # MOS word with nX X's and nY + nZ W's; X is treated as L and W as s for purposes of brightness | ||
| Line 244: | Line 244: | ||
== Code == | == Code == | ||
Rust code for generating MOS substitution scales: | Rust code for generating MOS substitution scales: | ||
<syntaxhighlight lang="rs>pub type Letter = usize; | <syntaxhighlight lang="rs"> | ||
pub type Letter = usize; | |||
/// Return gcd(a, b) and the Bezout coefficients: (g, x, y). | /// Return gcd(a, b) and the Bezout coefficients: (g, x, y). | ||