搞笑的XORAndOr的解释

一、XOR

The truth table for the XOR gate is:

A

B

C

TRUE

TRUE

FALSE

TRUE

FALSE

TRUE

FALSE

TRUE

TRUE

FALSE

FALSE

FALSE

This can be written as:

C = A XOR B

Jumper A

Jumper B

Result

Cleared the high jump

Cleared the high jump

Competition not over

Cleared the high jump

Knocked down the bar

Competition over

Knocked down the bar

Cleared the high jump

Competition over

Knocked down the bar

Knocked down the bar

Competition not over

 

也即,这个运算用于判断比赛是否结束。

二、AND

Truth table for the AND gate.

A

B

C

TRUE

TRUE

TRUE

TRUE

FALSE

FALSE

FALSE

TRUE

FALSE

FALSE

FALSE

FALSE

Note that the truth table for the two inputAND gate is bigger than the truth table for the NOT gate. This is because wehave to take into account that each of the two inputs can be in one of two differentstates, so there are four possible combinations of inputs.

Another way of writing this is C = AAND B.

RAIN

HEAT

WEATHER

Dry

Hot

Good

Dry

Cold

Bad

Wet

Hot

Bad

Wet

Cold

Bad

The weather is good if it is hot AND dry.

三、OR

Truth table for the OR gate.

A

B

C

TRUE

TRUE

TRUE

TRUE

FALSE

TRUE

FALSE

TRUE

TRUE

FALSE

FALSE

FALSE

Another way of writing this is:

C = A OR B

You can enter the house if either the backdoor or the front door is unlocked. Only if both are locked will you be left onthe doorstep.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值