adder.si

来自「GAL编译工具」· SI 代码 · 共 37 行

SI
37
字号
Name      Adder;
Partno    CA0016;
Date      10/08/85;
Rev       01;
Designer  Woolhiser;
Company   Assisted Technology;
Assembly  None;
Location  None;
Device    G16V8;

/****************************************************************/
/*                                                              */
/* Four bit adder using the CUPL function statement.            */
/*                                                              */
/* 4-bit asynchronous adder implemented as a ripple-carry       */
/* through four adder-slice circuits.  Each adder-slice         */
/* takes a pair of 1-bit numbers (X, Y) and the carry from      */
/* a previous slice (Cin) and produces their 1-bit sum (Z)      */
/* and carry (Cout).  Each adder-slice circuit is defined       */
/* using the CUPL function adder_slice(), which returns         */
/* the product directly and the carry as Cout.                  */
/****************************************************************/

Order: X4..1, %2, Y4..1, %4, Z4..1, %2, Carry, C3..1;

Vectors:
'0' '0'  "0" L***       /* 0  + 0  = 0,   Z = 0,  C = 0 */
'2' '1'  "3" L***       /* 2  + 1  = 3,   Z = 3,  C = 0 */
'4' '2'  "6" L***       /* 4  + 2  = 6,   Z = 6,  C = 0 */
'8' '3'  "B" L***       /* 8  + 3  = 11,  Z = B,  C = 0 */
'7' '4'  "B" L***       /* 7  + 4  = 11,  Z = B,  C = 0 */
'A' '5'  "F" L***       /* 10 + 5  = 15,  Z = F,  C = 0 */
'D' '6'  "3" H***       /* 13 + 6  = 19,  Z = 3,  C = 1 */
'F' '7'  "6" H***       /* 15 + 7  = 22,  Z = 6,  C = 1 */
'F' '1'  "0" H***       /* 15 + 1  = 16,  Z = 0,  C = 1 */
'F' 'F'  "E" H***       /* 15 + 15 = 30,  Z = E,  C = 1 */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?