Biomedical Engineering  ·  Level 6
Digital Electronics
Chapter 3: Apply Logic gates and Boolean algebra concepts
📚 6 Topics
⚑ What you will be able to do

By the end of this chapter, you will be able to:

  • apply the principles of logic gates accurately following digital system and Boolean algebra design specifications
  • operate logic gates correctly according to digital system design specifications
  • apply Boolean algebra concepts accurately to solve digital system design problems
  • design and analyze logic circuits correctly based on digital system design specifications

Mastering these skills will help you build and troubleshoot digital systems confidently, a key ability in the world of electronics and technology.

3.1 Basic gates

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.

3.1.1 AND Gate

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 $$

Worked Examples

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).

3.1.2 OR Gate

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 $$

Worked Examples

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).

3.1.3 NOT Gate

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} $$

Worked Examples

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).

3.1.4 NAND Gate

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} $$

Worked Examples

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).

3.1.5 NOR Gate

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} $$

Worked Examples

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).

3.1.6 XOR Gate

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 $$

Worked Examples

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).

3.1.7 XNOR Gate

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} $$

Worked Examples

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).

Practice Questions

  1. 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)

  2. 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)

  3. A ventilator stops if the emergency stop button (\(A\)) is pressed (active low). Determine the NOT gate output when \(A=0\). (3 marks)

  4. 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)

  5. A hospital reset activates only when all sensors \(A=0\), \(B=0\), and \(C=0\) are false. Calculate the NOR gate output. (4 marks)

  6. A data transmission error is detected using XOR between transmitted bit \(A=1\) and received bit \(B=0\). Calculate the output. (3 marks)

  7. A biomedical system checks if sensor outputs \(A=1\), \(B=1\) match using XNOR gate. Find the output. (3 marks)

The rest of this chapter
🔒

Create a free account to open more of this chapter.

Free: practical guides, quick cards, workplace scenarios and more.

Create a free account
🔒3.2 Universal gates

Universal gates are fundamental in digital electronics because they can be used to implement any Boolean function without needing other gate types. In biomedical engineering, especially in designing medical diagnostic equipment or embedded systems in biomedica…

🔒3.3 Special purpose gates

Special purpose logic gates are essential in biomedical engineering digital systems for their ability to perform unique logical operations beyond basic AND, OR, and NOT gates. These gates include XOR, XNOR, NAND, and NOR, which are widely used in medical diagn…

🔒3.4 Laws of Boolean Algebra

In biomedical engineering digital systems, especially those embedded in diagnostic devices and patient monitoring equipment, mastering Boolean algebra laws is essential for simplifying logic circuits. Simplified logic reduces component count, power consumption…

🔒3.5 Logic expressions simplification

Logic expressions simplification is essential in biomedical engineering digital circuits design to minimize hardware complexity, reduce power consumption, and improve reliability of devices such as patient monitors, defibrillators, and medical imaging systems.…

🔒3.6 K-MAPS

In biomedical engineering, especially in the design of digital logic circuits for medical devices such as patient monitors, infusion pumps, and diagnostic equipment, simplification of Boolean expressions is crucial. Karnaugh Maps (K-Maps) provide a systematic…

Chapter Summary

This 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.

Self-Assessment

🔒 PDFDownload this self-assessment, with answers

Written Assessment

  1. 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)

  2. A pulse oximeter uses a NAND gate with inputs \(A = 1\) and \(B = 1\). Calculate the output. (1 mark)

🔒18 more in this section.

Chapter Examination Questions

🔒 PDFDownload these examination questions, with worked answers

SECTION A (40 Marks) - Answer ALL Questions

  1. In a biomedical signal processing device used at Kenyatta National Hospital, an AND gate receives two input signals representing sensor activations. If the inputs are \(A = 1\) and \(B = 0\), what is the output of the AND gate? (4 marks)
  2. Draw the logic symbol and truth table for a NAND gate used in a heart rate monitor circuit. (4 marks)
🔒18 more in this section.
Flashcards 21 cards Study deck ▾
Question
1

↻ Tap card to reveal answer
🔒

19 more in this section.

Create a free account
Test Yourself 19 questions Start quiz ▾
0%
0 / 2
🔒

17 more in this section.

Create a free account
Am I competent?

At the start of this chapter we promised you would be able to:

  • apply the principles of logic gates accurately following digital system and Boolean algebra design specifications
  • operate logic gates correctly according to digital system design specifications
  • apply Boolean algebra concepts accurately to solve digital system design problems
  • design and analyze logic circuits correctly based on digital system design specifications

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.