00 – 底层语言基础-逻辑门 (Gates)

在物理上,逻辑门返回的是Boolean,即True或者False。不像Java的逻辑判断,物理逻辑门返回值中,True为高电压(一般为5v),false为低电压(一般为0v)。用Boolean A, B代表输入变量,Boolean Y 代表输出变量,以下是几种常见的逻辑门与对应的predicate表达式:

AND Gates – “和”

\(Y=A\land B\)

OR Gates – “或”

\(Y = A \lor B\)

Not Gates – “非”

\(Y = \neg A\)

XOR Gates – “exclusive OR”

\(Y = (\neg A \land B) \lor (\neg B \land A)\)

NAND Gates – “Not AND”

\(Y = \neg A \lor \neg B\)

NOR Gate – “Not OR”

\(Y = \neg A \land \neg B \)

Buffer

~尚未cover

Scroll to Top