module onescnt1 title 'Count the ones in a 15-bit word' "ONESCNT1 device 'P22V10'; " Input and output pins D14..D0 pin 1..11, 13..15, 23; SUM3..SUM0 pin 17..20 istype 'com'; equations @CARRY 1; [SUM3..SUM0] = D0 + D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10 + D11 + D12 + D13 + D14; end onescnt1