module onesct32
title 'Combine outputs from two onescnt15 chips and two data bits' 
"ONESCT32 device 'P22V10'; 
" Note, this is really just a four-bit adder with two carry inputs.

" Input and output pins 
A3..A0, B3..B0, D0, D1    pin 1..10;
SUM4..SUM0                pin 17..21 istype 'com';
C1..C0                    pin 16, 22 istype 'com';

equations

@CARRY 1;
[C1..C0] = D0 + D1;
[SUM4..SUM0] = [0, A3..A0] + [0, B3..B0] + [0,0,0,C1..C0];

end onesct32
