By the end of this chapter, you will be able to:
Mastering these skills will help you build and troubleshoot digital systems confidently, a key ability in the world of electronics and technology.
Basic logic gates are the fundamental building blocks of digital circuits used in biomedical devices for decision-making and signal processing. Understanding these gates allows biomedical engineers to design and analyze control logic in equipment like ventilators and patient monitoring systems. This section covers the primary gates: AND, OR, NOT, NAND, NOR, XOR, and XNOR, with worked examples relevant to biomedical engineering.
The AND gate outputs true only when all inputs are true, modeling situations where multiple conditions must be met simultaneously in biomedical devices. The Boolean expression for an AND gate with two inputs \(A\) and \(B\) is:
$$ Y = A \times B $$
Example 1: A hospital infusion pump activates only when both the fluid reservoir is full (\(A=1\)) and the patient is ready (\(B=1\)). Determine the output when both inputs are 1.
Given: \(A=1\), \(B=1\)
$$ Y = A \times B $$
$$ Y = 1 \times 1 $$
$$ Y = 1 $$
Answer: The pump activates (output = 1).
Example 2: In an ECG machine, a signal is processed only when both the heart rate sensor (\(A\)) and the lead connection (\(B\)) are active. Find output when \(A=1\), \(B=0\).
Given: \(A=1\), \(B=0\)
$$ Y = A \times B $$
$$ Y = 1 \times 0 $$
$$ Y = 0 $$
Answer: Signal not processed (output = 0).
Example 3: A biomedical alarm system triggers when both oxygen level (\(A\)) is low (0) and CO2 level (\(B\)) is high (1). Calculate output.
Given: \(A=0\), \(B=1\)
$$ Y = A \times B $$
$$ Y = 0 \times 1 $$
$$ Y = 0 $$
Answer: Alarm not triggered (output = 0).
Example 4: A ventilator starts only if the pressure sensor (\(A\)), oxygen sensor (\(B\)), and temperature sensor (\(C\)) are all active. For \(A=1\), \(B=1\), \(C=0\), find output.
Given: \(A=1\), \(B=1\), \(C=0\)
$$ Y = A \times B \times C $$
$$ Y = 1 \times 1 \times 0 $$
$$ Y = 0 $$
Answer: Ventilator does not start (output = 0).
Example 5: A sterilization machine activates only when all three safety switches are engaged: door closed (\(A=1\)), temperature set (\(B=1\)), and timer ready (\(C=1\)). Find output.
Given: \(A=1\), \(B=1\), \(C=1\)
$$ Y = A \times B \times C $$
$$ Y = 1 \times 1 \times 1 $$
$$ Y = 1 $$
Answer: Machine activates (output = 1).
The OR gate outputs true if at least one input is true, useful in biomedical devices for alarms or alerts triggered by multiple independent conditions. The Boolean expression for two inputs \(A\) and \(B\) is:
$$ Y = A + B $$
Example 1: A patient monitoring system sounds an alarm if either the heart rate sensor (\(A\)) or the blood pressure sensor (\(B\)) detects an abnormal reading. Find output when \(A=0\), \(B=1\).
Given: \(A=0\), \(B=1\)
$$ Y = A + B $$
$$ Y = 0 + 1 $$
$$ Y = 1 $$
Answer: Alarm sounds (output = 1).
Example 2: A biomedical device powers on if either mains power (\(A\)) or battery backup (\(B\)) is available. Calculate output when \(A=0\), \(B=0\).
Given: \(A=0\), \(B=0\)
$$ Y = A + B $$
$$ Y = 0 + 0 $$
$$ Y = 0 $$
Answer: Device remains off (output = 0).
Example 3: An oxygen concentrator starts if either the oxygen purity sensor (\(A\)) or the flow sensor (\(B\)) is active. For \(A=1\), \(B=1\) find output.
Given: \(A=1\), \(B=1\)
$$ Y = A + B $$
$$ Y = 1 + 1 $$
$$ Y = 1 $$
Answer: Concentrator starts (output = 1).
Example 4: A hospital lighting control system turns on if either motion sensor (\(A\)) or manual switch (\(B\)) is activated. Find output when \(A=0\), \(B=1\).
Given: \(A=0\), \(B=1\)
$$ Y = A + B $$
$$ Y = 0 + 1 $$
$$ Y = 1 $$
Answer: Lights turn on (output = 1).
Example 5: A biohazard alarm activates if either toxic gas sensor (\(A\)) or smoke detector (\(B\)) triggers. For \(A=0\), \(B=0\), find output.
Given: \(A=0\), \(B=0\)
$$ Y = A + B $$
$$ Y = 0 + 0 $$
$$ Y = 0 $$
Answer: Alarm remains off (output = 0).
The NOT gate outputs the inverse of the input, essential for signal inversion in biomedical circuits such as safety interlocks. The Boolean expression for input \(A\) is:
$$ Y = \overline{A} $$
Example 1: An infusion pump stops when the reservoir is empty (\(A=0\)). Find output \(Y\) of a NOT gate controlling the pump.
Given: \(A=0\)
$$ Y = \overline{A} $$
$$ Y = \overline{0} $$
$$ Y = 1 $$
Answer: Pump is enabled (output = 1).
Example 2: A ventilator alarm is triggered when the oxygen sensor is off (\(A=0\)). Find output of NOT gate.
Given: \(A=0\)
$$ Y = \overline{A} $$
$$ Y = \overline{0} $$
$$ Y = 1 $$
Answer: Alarm triggered (output = 1).
Example 3: A biomedical device indicator LEDs are on when the device is off (\(A=1\)). Find output.
Given: \(A=1\)
$$ Y = \overline{A} $$
$$ Y = \overline{1} $$
$$ Y = 0 $$
Answer: Indicator LEDs off (output = 0).
Example 4: A safety interlock disables a machine when the door is open (\(A=1\)). Find output.
Given: \(A=1\)
$$ Y = \overline{A} $$
$$ Y = \overline{1} $$
$$ Y = 0 $$
Answer: Machine disabled (output = 0).
Example 5: An emergency stop button input is active low (\(A=0\) means pressed). Find NOT output.
Given: \(A=0\)
$$ Y = \overline{A} $$
$$ Y = \overline{0} $$
$$ Y = 1 $$
Answer: Emergency stop activated (output = 1).
The NAND gate outputs false only when all inputs are true; it is widely used in biomedical systems for fail-safe logic circuits. The Boolean expression for inputs \(A\) and \(B\) is:
$$ Y = \overline{A \times B} $$
Example 1: A sterilizer alarm activates unless both door closed (\(A=1\)) and temperature set (\(B=1\)) are true. Calculate output for \(A=1\), \(B=1\).
Given: \(A=1\), \(B=1\)
$$ Y = \overline{A \times B} $$
$$ Y = \overline{1 \times 1} $$
$$ Y = \overline{1} $$
$$ Y = 0 $$
Answer: Alarm off (output = 0).
Example 2: A biomedical device disables output unless safety interlock \(A=1\) and power supply \(B=0\). Find output.
Given: \(A=1\), \(B=0\)
$$ Y = \overline{A \times B} $$
$$ Y = \overline{1 \times 0} $$
$$ Y = \overline{0} $$
$$ Y = 1 $$
Answer: Output enabled (output = 1).
Example 3: An infusion pump stops if both reservoir full (\(A=1\)) and patient ready (\(B=1\)) are true; otherwise, it continues. Find output for \(A=0\), \(B=1\).
Given: \(A=0\), \(B=1\)
$$ Y = \overline{A \times B} $$
$$ Y = \overline{0 \times 1} $$
$$ Y = \overline{0} $$
$$ Y = 1 $$
Answer: Pump continues (output = 1).
Example 4: A ventilator alarm activates unless both oxygen sensor (\(A=1\)) and pressure sensor (\(B=1\)) are true. Find output for \(A=1\), \(B=0\).
Given: \(A=1\), \(B=0\)
$$ Y = \overline{A \times B} $$
$$ Y = \overline{1 \times 0} $$
$$ Y = \overline{0} $$
$$ Y = 1 $$
Answer: Alarm activated (output = 1).
Example 5: A biomedical control circuit outputs false only if all three inputs \(A=1\), \(B=1\), \(C=1\). Find output for \(A=1\), \(B=1\), \(C=0\).
Given: \(A=1\), \(B=1\), \(C=0\)
$$ Y = \overline{A \times B \times C} $$
$$ Y = \overline{1 \times 1 \times 0} $$
$$ Y = \overline{0} $$
$$ Y = 1 $$
Answer: Output true (output = 1).
The NOR gate outputs true only when all inputs are false, often used in biomedical systems for reset or initialization logic. The Boolean expression for two inputs \(A\) and \(B\) is:
$$ Y = \overline{A + B} $$
Example 1: A hospital alarm is off only when both smoke detector (\(A=0\)) and toxic gas sensor (\(B=0\)) are false. Find output.
Given: \(A=0\), \(B=0\)
$$ Y = \overline{A + B} $$
$$ Y = \overline{0 + 0} $$
$$ Y = \overline{0} $$
$$ Y = 1 $$
Answer: Alarm off (output = 1).
Example 2: A biomedical device reset activates only when neither power supply (\(A=1\)) nor battery backup (\(B=0\)) is available. Find output.
Given: \(A=1\), \(B=0\)
$$ Y = \overline{A + B} $$
$$ Y = \overline{1 + 0} $$
$$ Y = \overline{1} $$
$$ Y = 0 $$
Answer: Reset inactive (output = 0).
Example 3: A ventilator alarm activates only if neither oxygen sensor (\(A=0\)) nor pressure sensor (\(B=0\)) is active. Calculate output.
Given: \(A=0\), \(B=0\)
$$ Y = \overline{A + B} $$
$$ Y = \overline{0 + 0} $$
$$ Y = \overline{0} $$
$$ Y = 1 $$
Answer: Alarm activated (output = 1).
Example 4: A biomedical control circuit outputs true only when all three inputs \(A=0\), \(B=0\), \(C=0\). Find output for \(A=0\), \(B=1\), \(C=0\).
Given: \(A=0\), \(B=1\), \(C=0\)
$$ Y = \overline{A + B + C} $$
$$ Y = \overline{0 + 1 + 0} $$
$$ Y = \overline{1} $$
$$ Y = 0 $$
Answer: Output false (output = 0).
Example 5: A biohazard alarm activates only when neither gas sensor (\(A=0\)) nor smoke detector (\(B=0\)) detects a hazard. Find output for \(A=1\), \(B=1\).
Given: \(A=1\), \(B=1\)
$$ Y = \overline{A + B} $$
$$ Y = \overline{1 + 1} $$
$$ Y = \overline{1} $$
$$ Y = 0 $$
Answer: Alarm off (output = 0).
The XOR (exclusive OR) gate outputs true when inputs differ, useful in biomedical error detection and parity checking. The Boolean expression for two inputs \(A\) and \(B\) is:
$$ Y = A \oplus B = A \times \overline{B} + \overline{A} \times B $$
Example 1: A data transmission system in a hospital uses XOR to detect bit errors between transmitted bit \(A=1\) and received bit \(B=0\). Find output.
Given: \(A=1\), \(B=0\)
$$ Y = A \times \overline{B} + \overline{A} \times B $$
$$ Y = 1 \times \overline{0} + \overline{1} \times 0 $$
$$ Y = 1 \times 1 + 0 \times 0 $$
$$ Y = 1 + 0 $$
$$ Y = 1 $$
Answer: Error detected (output = 1).
Example 2: For \(A=0\), \(B=0\) find XOR output.
Given: \(A=0\), \(B=0\)
$$ Y = 0 \times \overline{0} + \overline{0} \times 0 $$
$$ Y = 0 \times 1 + 1 \times 0 $$
$$ Y = 0 + 0 $$
$$ Y = 0 $$
Answer: No error (output = 0).
Example 3: In a biomedical sensor, XOR gate compares two signals \(A=1\), \(B=1\). Find output.
Given: \(A=1\), \(B=1\)
$$ Y = 1 \times \overline{1} + \overline{1} \times 1 $$
$$ Y = 1 \times 0 + 0 \times 1 $$
$$ Y = 0 + 0 $$
$$ Y = 0 $$
Answer: Signals match (output = 0).
Example 4: For \(A=0\), \(B=1\), find XOR output.
Given: \(A=0\), \(B=1\)
$$ Y = 0 \times \overline{1} + \overline{0} \times 1 $$
$$ Y = 0 \times 0 + 1 \times 1 $$
$$ Y = 0 + 1 $$
$$ Y = 1 $$
Answer: Output = 1 (signals differ).
Example 5: A parity checker uses XOR for three bits \(A=1\), \(B=0\), \(C=1\). Calculate output \(Y = A \oplus B \oplus C\).
Given: \(A=1\), \(B=0\), \(C=1\)
First compute \(D = A \oplus B\):
$$ D = 1 \times \overline{0} + \overline{1} \times 0 = 1 \times 1 + 0 \times 0 = 1 + 0 = 1 $$
Then compute \(Y = D \oplus C\):
$$ Y = 1 \times \overline{1} + \overline{1} \times 1 = 1 \times 0 + 0 \times 1 = 0 + 0 = 0 $$
Answer: Parity check output = 0 (even parity).
The XNOR gate outputs true when inputs are equal, used in biomedical devices for equality detection and error correction. The Boolean expression is:
$$ Y = \overline{A \oplus B} = A \times B + \overline{A} \times \overline{B} $$
Example 1: A biomedical system checks if two sensor outputs \(A=1\), \(B=1\) match using XNOR. Find output.
Given: \(A=1\), \(B=1\)
$$ Y = A \times B + \overline{A} \times \overline{B} $$
$$ Y = 1 \times 1 + \overline{1} \times \overline{1} $$
$$ Y = 1 + 0 \times 0 $$
$$ Y = 1 + 0 $$
$$ Y = 1 $$
Answer: Signals match (output = 1).
Example 2: For \(A=0\), \(B=0\), find XNOR output.
Given: \(A=0\), \(B=0\)
$$ Y = 0 \times 0 + \overline{0} \times \overline{0} $$
$$ Y = 0 + 1 \times 1 $$
$$ Y = 0 + 1 $$
$$ Y = 1 $$
Answer: Signals match (output = 1).
Example 3: For \(A=1\), \(B=0\), find XNOR output.
Given: \(A=1\), \(B=0\)
$$ Y = 1 \times 0 + \overline{1} \times \overline{0} $$
$$ Y = 0 + 0 \times 1 $$
$$ Y = 0 + 0 $$
$$ Y = 0 $$
Answer: Signals differ (output = 0).
Example 4: For \(A=0\), \(B=1\), find XNOR output.
Given: \(A=0\), \(B=1\)
$$ Y = 0 \times 1 + \overline{0} \times \overline{1} $$
$$ Y = 0 + 1 \times 0 $$
$$ Y = 0 + 0 $$
$$ Y = 0 $$
Answer: Signals differ (output = 0).
Example 5: A biomedical parity checker uses XNOR for three bits \(A=1\), \(B=0\), \(C=1\). Calculate output \(Y = \overline{A \oplus B \oplus C}\).
Given: \(A=1\), \(B=0\), \(C=1\)
First compute \(D = A \oplus B\):
$$ D = 1 \times \overline{0} + \overline{1} \times 0 = 1 \times 1 + 0 \times 0 = 1 + 0 = 1 $$
Then compute \(E = D \oplus C\):
$$ E = 1 \times \overline{1} + \overline{1} \times 1 = 1 \times 0 + 0 \times 1 = 0 + 0 = 0 $$
Finally, compute \(Y = \overline{E}\):
$$ Y = \overline{0} = 1 $$
Answer: Parity check output = 1 (even parity confirmed).
A biomedical sensor activates only when both temperature sensor (\(A\)) and pressure sensor (\(B\)) are active. Calculate the AND gate output for \(A=1\), \(B=0\). (3 marks)
An alarm sounds if either the smoke detector (\(A\)) or toxic gas sensor (\(B\)) is triggered. Find the OR gate output when \(A=0\), \(B=1\). (3 marks)
A ventilator stops if the emergency stop button (\(A\)) is pressed (active low). Determine the NOT gate output when \(A=0\). (3 marks)
A sterilizer alarm activates unless both door closed (\(A\)) and temperature set (\(B\)) inputs are true. Find the NAND gate output for \(A=1\), \(B=1\). (4 marks)
A hospital reset activates only when all sensors \(A=0\), \(B=0\), and \(C=0\) are false. Calculate the NOR gate output. (4 marks)
A data transmission error is detected using XOR between transmitted bit \(A=1\) and received bit \(B=0\). Calculate the output. (3 marks)
A biomedical system checks if sensor outputs \(A=1\), \(B=1\) match using XNOR gate. Find the output. (3 marks)
Create a free account to open more of this chapter.
Free: practical guides, quick cards, workplace scenarios and more.
Create a free accountThis chapter covered the fundamental building blocks of digital electronics starting with basic gates such as AND, OR, and NOT, which perform simple logical operations. It then introduced universal gates like NAND and NOR, which can be used to implement any logic function. Special purpose gates, including XOR and XNOR, were discussed for their unique logical behavior in specific applications. The chapter also explained the essential laws of Boolean algebra that govern the manipulation of logical expressions. Techniques for simplifying complex logic expressions were explored to optimize circuit design. Finally, the use of Karnaugh Maps (K-Maps) was demonstrated as a graphical method for minimizing Boolean functions efficiently. Together, these topics provide the foundation for designing and analyzing digital logic circuits.
A biomedical sensor outputs two binary signals \(A\) and \(B\). Using an AND gate, determine the output when \(A = 1\) and \(B = 0\). (1 mark)
A pulse oximeter uses a NAND gate with inputs \(A = 1\) and \(B = 1\). Calculate the output. (1 mark)
At the start of this chapter we promised you would be able to:
Tick each one you can genuinely do.
So, are you there yet?
You're competent when you can confidently do 50% or more of what this chapter promised.
Sign in to record how you're doing.