ORUToI, OLDToI, LDToI, LToI, RUToI, LDToLD, ORUToLD, RUToRU, OLDToRU, ORUToL, ParallelInput, FlipFlop, Master, Inverter, Input, Output, LeftDown, RightUp => {
grain: Grain ← FetchGrain[];
SELECT bit.type
FROM
ORUToI => grain.ORUToI ← value;
OLDToI => grain.OLDToI ← value;
LDToI => grain.LDToI ← value;
LToI => grain.LToI ← value;
RUToI => grain.RUToI ← value;
LDToLD => grain.LDToLD ← value;
ORUToLD => grain.ORUToLD ← value;
RUToRU => grain.RUToRU ← value;
OLDToRU => grain.OLDToRU ← value;
ORUToL => grain.ORUToL ← value;
Tristate => grain.Tristate ← value;
ParallelInput => grain.parallelInput ← value;
FlipFlop => grain.flipFlop ← value;
Master => grain.master ← value;
Inverter => grain.invert ← value;
Input => grain.input ← value;
Output => grain.output ← value;
LeftDown => grain.leftDown ← value;
RightUp => grain.rightUp ← value;
ENDCASE => ERROR;
DieIfMoreThanOne[grain.ORUToI, grain.OLDToI, grain.LDToI, grain.LToI, grain.RUToI];
grain.inputSelect ←
SELECT
TRUE
FROM
grain.ORUToI => oru,
grain.OLDToI => old,
grain.LDToI => ld,
grain.LToI => l,
grain.RUToI => ru,
ENDCASE => none;
DieIfMoreThanOne[grain.ORUToL, grain.Tristate];
grain.longControl ←
SELECT
TRUE
FROM
grain.ORUToL => on,
grain.Tristate => old,
ENDCASE => off;
DieIfMoreThanOne[grain.LDToLD, grain.ORUToLD];
grain.leftDownSelectLeftDown ← grain.LDToLD;
DieIfMoreThanOne[grain.RUToRU, grain.OLDToRU];
grain.rightUpSelectRightUp ← grain.RUToRU;
ScheduleGrain[array, grain];
ScheduleGrain[array, grain.leftDownGrain];
ScheduleGrain[array, grain.rightUpGrain];
SchedulePerpendicularGrains[array, grain];
};
RAMEven, RAMOdd => {
minor: MinorArray;
temp: ArrayPositionRec ← bit^;
bit.type ← RAMEven;
bit.orientation ← Vertical;
minor ← NARROW[RefTab.Fetch[array.state.positionToEntity, bit].val];
bit^ ← temp;
SELECT bit.type
FROM
RAMEven => minor.RAMEven ← value;
RAMOdd => minor.RAMOdd ← value;
ENDCASE => ERROR;
ScheduleMinorArray[array, minor];
};