allez on met la totale
en principe, il y a toutes les possibilités :
Code : Tout sélectionner
;-
;- MACROS PORTE-LOGIQUE
;- http://fr.wikipedia.org/wiki/Porte_logique
;-
Macro _not(A)
(Not (A))
EndMacro
Macro _or(A, B)
((A) Or (B))
EndMacro
Macro _xor(A, B)
((A) Xor (B))
EndMacro
Macro _nor(A, B)
(_not(_or(A, B)))
EndMacro
Macro _xnor(A, B)
(_not(_xor(A, B)))
EndMacro
Macro _and(A, B)
((A) And (B))
EndMacro
Macro _nand(A, B)
(_not(_and(A, B)))
EndMacro
Debug "OU"
Debug _or(0, 0) ; 0 | 0 | 0
Debug _or(0, 1) ; 0 | 1 | 1
Debug _or(1, 0) ; 1 | 0 | 1
Debug _or(1, 1) ; 1 | 1 | 1
Debug "OU EXCLUSIF"
Debug _xor(0, 0) ; 0 | 0 | 0
Debug _xor(0, 1) ; 0 | 1 | 1
Debug _xor(1, 0) ; 1 | 0 | 1
Debug _xor(1, 1) ; 1 | 1 | 0
Debug "NON-OU"
Debug _nor(0, 0) ; 0 | 0 | 1
Debug _nor(0, 1) ; 0 | 1 | 0
Debug _nor(1, 0) ; 1 | 0 | 0
Debug _nor(1, 1) ; 1 | 1 | 0
Debug "NON-OU EXCLUSIF"
Debug _xnor(0, 0) ; 0 | 0 | 1
Debug _xnor(0, 1) ; 0 | 1 | 0
Debug _xnor(1, 0) ; 1 | 0 | 0
Debug _xnor(1, 1) ; 1 | 1 | 1
Debug "ET"
Debug _and(0, 0) ; 0 | 0 | 0
Debug _and(0, 1) ; 0 | 1 | 0
Debug _and(1, 0) ; 1 | 0 | 0
Debug _and(1, 1) ; 1 | 1 | 1
Debug "NON-ET"
Debug _nand(0, 0) ; 0 | 0 | 1
Debug _nand(0, 1) ; 0 | 1 | 1
Debug _nand(1, 0) ; 1 | 0 | 1
Debug _nand(1, 1) ; 1 | 1 | 0