ブールAND計算機|論理ゲートと真理値表
このインスタント論理ゲート計算機を使用して、ブール AND 演算を実行し、完全な真理値表を生成し、バイナリ シーケンスを分析します。
演算タイプを選択し、ブール値を入力し、「計算」をクリックすると、AND 結果、真理値表、またはシーケンス出力が即座に表示されます。
ブールAND計算機|論理ゲートと真理値表
このインスタント論理ゲート計算機を使用して、ブール AND 演算を実行し、完全な真理値表を生成し、バイナリ シーケンスを分析します。
ブール AND 計算機について
The Boolean AND operation is one of the three fundamental logical operations that form the basis of all digital computing, alongside OR and NOT. Introduced by the mathematician George Boole in the nineteenth century, Boolean algebra provides the mathematical framework for reasoning about truth values and is the bedrock of digital circuit design, computer programming, and information theory.
The AND operation takes two or more inputs, each of which can be either true (represented as 1) or false (represented as 0), and produces an output that is true only when every single input is true. This strict requirement makes AND a natural coincidence detector: it signals 1 only when condition A is met AND condition B is met (AND condition C is met, and so on). In everyday language, the sentence 'You can enter if you have a ticket AND your name is on the list' expresses exactly an AND condition.
Mathematically, the AND operation is often written as A ∧ B, A · B, or simply AB in Boolean algebra. It satisfies several important algebraic laws. The commutative law states that A ∧ B = B ∧ A, so the order of operands does not matter. The associative law states that (A ∧ B) ∧ C = A ∧ (B ∧ C), so parentheses can be rearranged freely. The identity law says A ∧ 1 = A, meaning anding with 1 leaves any value unchanged. The annihilation law says A ∧ 0 = 0, meaning anding with 0 always gives 0. The idempotent law says A ∧ A = A, so repeating an input has no effect. De Morgan's theorem relates AND to OR: ¬(A ∧ B) = ¬A ∨ ¬B, which is critical for circuit simplification.
In hardware, AND gates are built from transistors connected in series: current can only flow through the circuit when both transistors are switched on, implementing the AND truth table directly in silicon. Modern processors contain billions of AND gates operating at gigahertz speeds. In software, the bitwise AND operator (&) applies AND independently to each pair of corresponding bits in two integers, while the logical AND operator (&&) applies it to entire boolean expressions and often uses short-circuit evaluation for efficiency.
Practical applications of AND logic are ubiquitous. In access control, a system grants entry only when the user is authenticated AND authorised. In image processing, AND masking extracts specific bit planes from pixel values. In network packet filtering, firewall rules combine multiple conditions with AND to decide whether to allow traffic. In embedded systems, microcontroller code reads sensor states and triggers actions only when all conditions are simultaneously satisfied.
This calculator covers three modes: a direct binary AND for up to three inputs, a full truth table generator showing all input combinations, and a sequential AND processor that applies the AND operation progressively through a binary string, helping you understand how AND accumulates over a data stream.
ブール AND の例
入力、出力、および実際のコンテキストを示す一般的な AND 演算。
| 入力 | 出力 | 説明 |
|---|---|---|
| A= 1 、B= 1 | 1 | Both inputs are true, so AND outputs 1. This is the only case where a two-input AND gate outputs 1. |
| A= 1 、B= 0 | 0 | One input is false. AND requires all inputs to be 1; since B=0 the result is 0. |
| A= 1 、B= 1 、C= 1 | 1 | Three-input AND gate. All inputs are 1, so the output is 1. Only 1 of the 8 possible input combinations gives output 1. |
| シーケンス: 1101 | ステップの結果: 1→1 、 1→1 、 0→0 、 1→0 | 実行 AND: 0が表示されると、実行 AND は0に低下し、後続のすべてのステップでそこに留まります。 |
ブール AND 計算機の使用方法
- 演算タイプを選択します。直接入力計算の場合は「バイナリ AND 演算」、完全な真理値表の場合は「真理値表生成」、逐次処理の場合は「バイナリ シーケンス AND」です。
- バイナリ演算の場合は、A、B、およびオプションで C の入力フィールドに0または1を入力します。 [計算] をクリックすると、AND 結果がすぐに表示されます。
- 真理値表モードの場合、入力の数 ( 2 、 3 、または4 ) を選択して、すべての入力の組み合わせとその AND 出力を示す完全なテーブルを生成します。
- シーケンス モードの場合、シーケンス フィールドにバイナリ文字列 (例: 1101 ) を入力します。計算機はシーケンス全体で AND を段階的に適用し、各ステップでの実行結果を表示します。
- [リセット] をクリックしてすべての入力をクリアし、同じまたは異なる操作モードで新しい計算を開始します。
ブール AND 計算機に関するよくある質問
AND 演算の出力が1になるのはいつですか?
The AND operation outputs 1 only when every single input is 1. For two inputs, only the combination A=1, B=1 gives output 1. For n inputs there is exactly one combination (all 1s) that produces a 1 output out of 2ⁿ possible combinations. All other combinations return 0.
ビットごとの AND と論理 AND の違いは何ですか?
論理 AND (&&) は、値全体を true または false として扱い、ブール値の結果を返します。ビットごとの AND (&) は、対応するビットの各ペアに対して独立して演算します。たとえば、バイナリの5 & 3は101 & 011 = 001 = 1ですが、 5 && 3は単に true です。ビット操作とマスキングにはビットごとの AND を使用します。条件付きロジックには論理 AND を使用します。
AND演算における短絡評価とは何ですか?
プログラミングでは、A && B を評価するときに、A が false の場合、B に関係なく結果は false でなければなりません。短絡評価はこれを利用し、A が false の場合に B の評価をスキップします。この最適化により、パフォーマンスが向上し、副作用が防止されます。たとえば、「object != null && object.property > 0 」での null ポインターの逆参照が回避されます。
AND は乗算とどのように関係しますか?
For binary values 0 and 1, AND behaves identically to integer multiplication: 0×0=0, 0×1=0, 1×0=0, 1×1=1. This analogy is useful for quick mental calculations. However, AND is a logical operation and multiplication is arithmetic, so the analogy breaks down for non-binary integers and should not be applied blindly.
AND に対するド モルガンの定理とは何ですか?
ド・モルガンの定理では、NOT(A AND B) = NOT(A) OR NOT(B) となります。つまり、すべての入力を反転し、出力を反転することで、AND ゲートを OR ゲートに変換できます。この等価性は、式を単純化し、ゲート数を減らし、最小限のゲート タイプのセットを使用して複雑な論理関数を実装するために、デジタル回路設計で頻繁に使用されます。
ビットごとのマスキングで AND はどのように使用されますか?
Bitwise AND with a mask extracts specific bits from a value. For example, ANDing any byte with 0b00001111 (decimal 15) zeroes out the upper four bits and preserves the lower four bits. This technique is used in networking to extract subnet addresses, in graphics to isolate colour channels, and in embedded systems to read individual sensor bits from a hardware register.