Or8Way :

(8 位的輸入經過Or Gate輸出一位)

這個 Gate 需要注意,會導致在實現 ALU 的時候遇到困難!

|     in     | out |
|  00000000  |  0  |
|  11111111  |  1  |
|  00010000  |  1  |
|  00000001  |  1  |
|  00100110  |  1  |

/**
 * 8-way Or: 
 * out = (in[0] or in[1] or ... or in[7])
 */

 CHIP Or8Way
  {
    IN in[8];
    OUT out;

    PARTS:
    Or(a=in[0], b=in[1], out=out01);
    Or(a=in[2], b=in[3], out=out23);
    Or(a=in[4], b=in[5], out=out45);
    Or(a=in[6], b=in[7], out=out67);
    Or(a=out01, b=out23, out=out0123);
    Or(a=out45, b=out67, out=out4567);
    Or(a=out0123, b=out4567, out=out);
}

results matching ""

    No results matching ""