Four bit adder: Difference between revisions

Content added Content deleted
(GP)
(→‎{{header|PARI/GP}}: incomplete.)
Line 1,466: Line 1,466:


=={{header|PARI/GP}}==
=={{header|PARI/GP}}==
{{incomplete|PARI/GP|Although output need not necessarily be shown, it is a requirement of the task that a test be at least coded.}}
<lang parigp>xor(a,b)=(!a&b)|(a&!b);
<lang parigp>xor(a,b)=(!a&b)|(a&!b);
halfadd(a,b)=[a&b,xor(a,b)];
halfadd(a,b)=[a&b,xor(a,b)];