Demultiplexor.rose
Last Edited by: Barth, July 1, 1985 5:50:20 pm PDT
Imports IO, RoseExtras;
Library SSI;
CELLTYPE "CrossDemultiplexor"
PORTS [Vdd, Gnd<BOOL, Address<INT[3], Select>INT[8]]
Expand
nAdr0, nAdr1, nAdr2: BIT;
Cedar
RoseExtras.Flatten[thisCell, to, "Address", 3];
RoseExtras.Flatten[thisCell, to, "Select", 8];
;
invert0: Inverter[Input: Address0, Output: nAdr0];
invert1: Inverter[Input: Address1, Output: nAdr1];
invert2: Inverter[Input: Address2, Output: nAdr2];
Cedar
FOR and: CARDINAL IN [0..8) DO
in1: ROPEIF EBFW[and, 0, 3] THEN "Address0" ELSE "nAdr0";
in2: ROPEIF EBFW[and, 1, 3] THEN "Address1" ELSE "nAdr1";
in3: ROPEIF EBFW[and, 2, 3] THEN "Address2" ELSE "nAdr2";
[] ← to.class.CellInstance[erInstance: to.instance, instanceName: IO.PutFR["and%g", IO.int[and]], typeName: "And3", interfaceNodes: IO.PutFR["Input1: %g, Input2: %g, Input3: %g, Output: Select%g", IO.rope[in1], IO.rope[in2], IO.rope[in3], IO.int[and]]];
ENDLOOP;
;
ENDCELLTYPE