Anonymous user
Four bit adder: Difference between revisions
→{{header|PARI/GP}}: test -- actually I wrote a full test of all 2^8 possibilities when writing, but I don't see the point of recording that here
(→{{header|PARI/GP}}: incomplete.) |
(→{{header|PARI/GP}}: test -- actually I wrote a full test of all 2^8 possibilities when writing, but I don't see the point of recording that here) |
||
Line 1,466:
=={{header|PARI/GP}}==
<lang parigp>xor(a,b)=(!a&b)|(a&!b);
halfadd(a,b)=[a&b,xor(a,b)];
Line 1,477 ⟶ 1,476:
s3=fulladd(a3,b3,s2[1]);
[s3[1],s3[2],s2[2],s1[2],s0[2]]
};
add4(0,0,0,0,0,0,0,0)</lang>
=={{header|Perl 6}}==
|