Four bit adder: Difference between revisions

→‎{{header|APL}}: use built-in NAND operator ⍲ instead of defining a new one.
(Added Easylang)
(→‎{{header|APL}}: use built-in NAND operator ⍲ instead of defining a new one.)
 
(2 intermediate revisions by 2 users not shown)
Line 517:
and ← { ⍺ ∧ ⍵ }
or ← { ⍺ ∨ ⍵ }
nand ← { ⍺ ⍲ ⍵ }
 
⍝ Build the complex gates
nand ← { not ⍺ and ⍵ } ⍝ similarly this can be built with composition as "nand ← not and"
xor ← { (⍺ and not ⍵) or (⍵ and not ⍺) }
 
Line 2,814:
 
[[File:Fōrmulæ - Four bit adder 06.png]]
 
<span>&nbsp;&nbsp;:</span>
 
[[File:Fōrmulæ - Four bit adder 07.png]]
Line 7,110 ⟶ 7,112:
=={{header|Wren}}==
{{trans|Go}}
<syntaxhighlight lang="ecmascriptwren">var xor = Fn.new { |a, b| a&(~b) | b&(~a) }
 
var ha = Fn.new { |a, b| [xor.call(a, b), a & b] }
1,479

edits