Logic gates

    Cards (39)

    • Not gate - 1 input = output 0, 0 input = 1 output
    • What is Boolean Logic primarily concerned with?

      Boolean Logic is concerned with true or false values.
    • What do Logic Gates do in Boolean Logic?

      Logic Gates apply Boolean Operations to Inputs.
    • How many inputs does a NOT gate take?

      A NOT gate takes a single input.
    • What is the output of a NOT gate when the input is 0?

      The output is 1.
    • What is the output of a NOT gate when the input is 1?

      The output is 0.
    • What does the truth table for a NOT gate look like?

      • Input: 0, Output: 1
      • Input: 1, Output: 0
    • How many inputs does an AND gate take?

      An AND gate takes two inputs.
    • What is the output of an AND gate when both inputs are 1?

      The output is 1.
    • What is the output of an AND gate if at least one input is 0?

      The output is 0.
    • What does the truth table for an AND gate look like?

      • Input A: 0, Input B: 0, Output: 0
      • Input A: 0, Input B: 1, Output: 0
      • Input A: 1, Input B: 0, Output: 0
      • Input A: 1, Input B: 1, Output: 1
    • How many inputs does an OR gate take?

      An OR gate takes two inputs.
    • What is the output of an OR gate when at least one input is 1?

      The output is 1.
    • What is the output of an OR gate if both inputs are 0?

      The output is 0.
    • What does the truth table for an OR gate look like?

      • Input A: 0, Input B: 0, Output: 0
      • Input A: 0, Input B: 1, Output: 1
      • Input A: 1, Input B: 0, Output: 1
      • Input A: 1, Input B: 1, Output: 1
    • What are the expressions and notations for the basic logic gates?
      • NOT: Expression: NOT A, Notation: ¬A
      • AND: Expression: A AND B, Notation: A∧B
      • OR: Expression: A OR B, Notation: A∨B
    • How can the output of a two-input logic circuit be expressed using Boolean operators?

      The output can be expressed as R = A ∨ B.
    • How many rows are needed in the truth table for a circuit with two inputs?

      Four rows are needed.
    • What is the formula to determine the number of rows in a truth table based on inputs?

      The formula is \(2^n\), where \(n\) is the number of inputs.
    • What is the process for creating truth tables for complex logic diagrams?

      1. Follow each gate step by step.
      2. Write down the output using brackets and terms AND, OR, and NOT.
      3. Complete operations in brackets first.
    • What does the circuit NOT (A AND B) represent?

      It represents the output of a NOT gate following an AND gate.
    • What does the circuit NOT (C OR D) represent?

      It represents the output of a NOT gate following an OR gate.
    • How many inputs can a logic circuit have?

      A logic circuit can have more than two inputs.
    • How can a two-level logic circuit with three inputs be expressed using Boolean operators?

      It can be expressed as R = (A OR B) AND (NOT C).
    • How many rows are needed in the truth table for a circuit with three inputs?

      Eight rows are needed.
    • What is the output of the circuit R = (A OR B) AND (NOT C) when A, B, and C are all 0?

      The output is 0.
    • What is the order of operations for Boolean operations?

      1. Brackets
      2. NOT
      3. AND
      4. OR
    • What Boolean operators are needed in programming?

      AND, OR, and NOT are the only Boolean operators needed.
    • How are Boolean operators represented in programming?

      • AND: &&
      • OR: ||
      • NOT: !
    • Why is it important to use brackets in long Boolean expressions?

      Brackets clarify which part of the expression to evaluate first.
    • How can Boolean operators enhance programming efficiency?

      • They make selection statements more efficient.
      • They make iteration statements more versatile.
    • What is the algorithm to keep score in a 'best out of 10' game?

      Use a loop to track rounds and check conditions for ending the game.
    • What conditions must be met for the game to end in the 'best out of 10' game?

      The game ends when one player wins 6 rounds or both win 5 rounds.
    • What is the algorithm to determine a character's status based on hunger, hydration, and comfort?

      Check conditions for each variable to determine if the character is alive or dead.
    • What conditions lead to a character's death in the algorithm provided?

      Any variable equals 0, any two variables less than 20, or all three less than 40.
    • What is the output of the character's status if all three variables are less than 40?

      The character is dead.
    • What happens if any of the variables are equal to 0 in the character's status algorithm?

      The character is dead.
    • What is the output of the character's status if hunger is 0 and hydration is 10?

      The character is dead.
    • What is the output of the character's status if hunger is 10, hydration is 10, and comfort is 10?

      The character is dead.
    See similar decks