Logic Functions and Circuit Design
Imagine that at your house they want an alarm that sounds only when the door is opened and the system is armed. How do you turn that idea into a circuit with logic gates, and how do you make sure you use as few as possible? That is digital design: going from the problem statement to the truth table, from the table to the function, simplifying it, and drawing the circuit.
From a Problem Statement to the Truth Table
Each stage produces something that the next one uses: the variables come from the problem statement; the function, from the table; the drawing of the circuit, from the simplified function.
The steps for designing a digital circuit are out of order: (a) draw the circuit using gates, (b) write the truth table, (c) read the problem statement and identify…
The steps for designing a digital circuit are out of order: (a) draw the circuit using gates, (b) write the truth table, (c) read the problem statement and identify inputs and outputs, (d) write the logic function, (e) simplify the function. Put them in order and explain in one sentence what is done in each step.
Explain what each row of a truth table represents and what it means for the output to be 1 in only some rows, using this example to support your explanation: an…
Explain what each row of a truth table represents and what it means for the output to be 1 in only some rows, using this example to support your explanation: an indicator light turns on when there is smoke (H = 1) and the alarm is activated (A = 1).
A car beeps if the door is open (P = 1) and the ignition is off (C = 1). Identify the inputs and output of the system and write its logic function using letters.
A car beeps if the door is open (P = 1) and the ignition is off (C = 1). Identify the inputs and output of the system and write its logic function using letters.
Three smoke sensors (A, B, and C) monitor an industrial unit, and the alarm must trigger when at least two of them detect smoke at the same time. Write the complete…
Three smoke sensors (A, B, and C) monitor an industrial unit, and the alarm must trigger when at least two of them detect smoke at the same time. Write the complete truth table for the system.
From the Truth Table to the Logic Function
Read the functions in words: $S = A \cdot B$ means "S is 1 if A and B are 1" (AND gate); $S = A + B$ means "S is 1 if A or B is 1" (OR gate); $S = \overline{A}$ means "S is the opposite of A" (NOT gate). The bar over the letter indicates negation: it inverts the value, from 0 to 1 and from 1 to 0.
What is a logic function? Read these two and explain their meaning in words: $S = A \times B$ and $S = A + B$. Which gate implements each one?
What is a logic function? Read these two and explain their meaning in words: $S = A \times B$ and $S = A + B$. Which gate implements each one?
Match each expression to the gate that implements it: $S = A \times B$, $S = A + B$, and $S = \overline{A}$. Also explain what the bar over the letter means in the last…
Match each expression to the gate that implements it: $S = A \times B$, $S = A + B$, and $S = \overline{A}$. Also explain what the bar over the letter means in the last expression.
A car alarm must sound when a door is open (P = 1) and the key is removed from the ignition (C = 1). Write the complete truth table and, using the rows with output 1,…
A car alarm must sound when a door is open (P = 1) and the key is removed from the ignition (C = 1). Write the complete truth table and, using the rows with output 1, write the logic function.
A warning signal is required to sound when the tank is low (N = 1) or when the pump is stopped (B = 1) with the timer running (M = 1). Write the truth table with the…
A warning signal is required to sound when the tank is low (N = 1) or when the pump is stopped (B = 1) with the timer running (M = 1). Write the truth table with the three inputs and the logic function.
Simplifying a Function with Boolean Algebra
Simplifying a function means finding another, shorter one that gives exactly the same truth table. It is a good idea to do this before building the circuit because that way you use fewer gates: it costs less, there are fewer points that can fail, and less energy is consumed.
Explain what it means to simplify a logic function and give two reasons why it is useful to simplify before assembling the circuit.
Explain what it means to simplify a logic function and give two reasons why it is useful to simplify before assembling the circuit.
In a two-input truth table, the output S is 1 when A = 1 and B = 0, and also when A = 1 and B = 1. Write the function as a sum of products and explain which much simpler…
In a two-input truth table, the output S is 1 when A = 1 and B = 0, and also when A = 1 and B = 1. Write the function as a sum of products and explain which much simpler function it is equivalent to.
The function $S = A \times B + A \times \overline{B}$ is activated if 'A and B' or if 'A and not B'. Explain why it is simply equivalent to $S = A$ and what is saved in…
The function $S = A \times B + A \times \overline{B}$ is activated if 'A and B' or if 'A and not B'. Explain why it is simply equivalent to $S = A$ and what is saved in the circuit by noticing this.
Verify, by writing both truth tables, that $S = A \times (A + B)$ is equivalent to $S = A$. Explain the practical consequence of this result when building the circuit.
Verify, by writing both truth tables, that $S = A \times (A + B)$ is equivalent to $S = A$. Explain the practical consequence of this result when building the circuit.
A group of students assembles the safety circuit for operating a motorized shear in the workshop ($S = 1$ activates the motor). They use two signals: dead man's switch…
A group of students assembles the safety circuit for operating a motorized shear in the workshop ($S = 1$ activates the motor). They use two signals: dead man's switch ($A = 1$ pressed) and clear photoelectric safety light curtain ($B = 1$). They feed $A$ and $B$ into an AND gate, and connect its output to an OR gate along with the direct signal from $A$ itself. The group argues that "the OR gate adds an extra level of safety because it checks the switch twice".
- a) Write the logic function that models the circuit assembled and create its full truth table.
- b) Formally prove, using the laws of Boolean algebra, what radical simplification the function allows and refute the group's claim by explaining which physical components are completely redundant.
- c) Evaluate the consequences for occupational safety: if an operator puts their hand in, interrupting the photoelectric light curtain ($B = 0$) while keeping $A$ pressed, will the shear motor stop? Justify your answer based on the circuit analysis.
Two companies are bidding to mass-produce the alarm system for a fleet of vehicles ($S = 1$ activates the siren) using three signals: ignition contact off ($A = 1$),…
Two companies are bidding to mass-produce the alarm system for a fleet of vehicles ($S = 1$ activates the siren) using three signals: ignition contact off ($A = 1$), impact sensor ($B = 1$), and cabin volumetric sensor ($C = 1$).
-
Company Alpha proposes the circuit: $S_1 = A \times B + A \times C$
-
Company Beta proposes the circuit: $S_2 = A \times (B + C)$
An insurance assessor claims that Alpha's design is more reliable because "if the AND gate processing the impact sensor $B$ fails, the vehicle will still be protected against volumetric sensor $C$ thanks to the second independent AND gate".
- a) Algebraically prove the functional equivalence of both circuits, indicating the mathematical property applied.
- b) Critically evaluate the assessor's claim: in Beta's circuit, if the signal from sensor $B$ failed, would the alarm stop sounding in response to the signal from $C$? Justify whether there really is any actual redundancy advantage in Alpha's proposal compared to Beta's.
- c) Quantify the number and type of 2-input logic gates required for each design and justify with reasoning which of the two projects should be chosen for mass vehicle production, taking into account manufacturing costs and component count.
From the Function to the Circuit
To go the other way (from the circuit to the function), you write down the output of each gate, from left to right, until you reach $S$. If the circuit has a NOT on $A$ and its output goes together with $B$ into an AND, the function is $S = \overline{A} \cdot B$: it detects that $A$ is 0 and $B$ is 1.
A circuit has a NOT gate on input A and then an AND gate that receives that signal and input B. Write the logic function of the circuit and explain what situation it…
A circuit has a NOT gate on input A and then an AND gate that receives that signal and input B. Write the logic function of the circuit and explain what situation it detects (which combination of inputs activates the output).
The figure shows a two-gate circuit and its truth table, with the output of one row incomplete. Work out that value by analysing the circuit and write the overall logic…
The figure shows a two-gate circuit and its truth table, with the output of one row incomplete. Work out that value by analysing the circuit and write the overall logic function.
In a circuit, A and B enter an AND gate; C passes through a NOT gate; the two outputs enter an OR gate that yields S. Write the logic function and work out the value of…
In a circuit, A and B enter an AND gate; C passes through a NOT gate; the two outputs enter an OR gate that yields S. Write the logic function and work out the value of S for A = 1, B = 0, and C = 0.
In the emergency ejection system of an aerospace capsule, three independent overpressure sensors ($A$, $B$, and $C$) are used. To avoid accidental triggering due to the…
In the emergency ejection system of an aerospace capsule, three independent overpressure sensors ($A$, $B$, and $C$) are used. To avoid accidental triggering due to the isolated failure of a single sensor, the ejection mechanism ($S = 1$) must only be activated if at least two of the three sensors agree in reporting overpressure.
A preliminary report proposes the simplified function $S = A \times B + C$, claiming that it meets the specifications using only two logic gates.
- a) Formally refute the validity of this proposal: identify which specific combination of inputs will cause an erroneous ejection trigger and explain the consequences for the crew.
- b) Obtain the correct truth table and deduce the minimal logic function as a sum of products.
- c) Design the circuit indicating the type and minimum number of 2-input logic gates required, and predict how the system would respond if sensor $C$ suffered a permanent failure that left it stuck at a low level ($C = 0$).
A classmate has assembled the combinational circuit shown in the figure, believing that output $S$ would depend on the combination of both variables ($A$ and $B$). When…
A classmate has assembled the combinational circuit shown in the figure, believing that output $S$ would depend on the combination of both variables ($A$ and $B$). When checking the operation table in the laboratory, they suspect something is wrong.
- a) Deduce the missing value in the table for the combination $A = 1, B = 0$ and write the unsimplified logic function that exactly describes the gate diagram in the figure.
- b) Prove algebraically and experimentally (from the table) why one of the two variables has no real influence on output $S$, and indicate what radical simplification this circuit allows in practice.
- c) Predict what would happen if you swapped the positions of both logic gates (the AND gate in place of the OR gate, and the OR gate in place of the AND gate): would the resulting truth table change? Formally justify your answer.
The security system of an industrial warehouse has three digital sensors: door opening ($P = 1$), window opening ($V = 1$), and system arming switch ($A = 1$ when…
The security system of an industrial warehouse has three digital sensors: door opening ($P = 1$), window opening ($V = 1$), and system arming switch ($A = 1$ when surveillance is activated). The alarm ($S = 1$) must sound if the door or the window is opened, but only when the system is armed.
An installer connects the sensors according to the expression $S = P + V \times A$, arguing that "since the door is the main entrance, it must have a direct connection to the alarm annunciator".
- a) Identify with which combination of inputs the technician's installation will fail and explain the serious security or false alarm problem it will cause in the warehouse.
- b) Draw up the truth table that accurately models the requested specifications and obtain the canonical function as a sum of minterms.
- c) Simplify the resulting function using the properties of Boolean algebra and describe the optimal electronic circuit, indicating which specific logic gates and how many inputs each one requires.
The automatic watering system of a municipal park ($S = 1$ to open the solenoid valve) responds to the logic function $S = A \times \overline{B} + C$, where the inputs…
The automatic watering system of a municipal park ($S = 1$ to open the solenoid valve) responds to the logic function $S = A \times \overline{B} + C$, where the inputs correspond to:
-
$A$: soil moisture sensor ($A = 1$ if the soil is dry).
-
$B$: weather forecast sensor ($B = 1$ if rain is forecast in the coming hours).
-
$C$: manual push button for gardening staff ($C = 1$ if forced watering is activated).
- a) Interpret the technical meaning of the function: under what specific conditions does the park water in automatic mode ($C = 0$)? Justify why variable $B$ must appear inverted in the expression.
- b) Draw or describe the detailed connection of the logic circuit that implements this function, indicating which basic logic gates (NOT, AND, OR) are needed.
- c) If an electrical fault leaves the manual push button permanently activated ($C = 1$), predict what will happen to watering and reason whether the moisture and weather forecast readings will still have any effect on water consumption.
- d) Determine what would happen if, on the contrary, the rain sensor suffers a short circuit and remains stuck at $B = 1$: in what single situation will the park be watered?
You want to design the smart lighting system for a communal hallway using three signals: motion detector ($M = 1$), twilight night sensor ($N = 1$), and manual…
You want to design the smart lighting system for a communal hallway using three signals: motion detector ($M = 1$), twilight night sensor ($N = 1$), and manual maintenance switch ($I = 1$). The light ($L = 1$) must turn on automatically when it is night and motion is detected, or at any time if the manual switch is actuated.
- a) Draw the truth table of the system and derive the simplified logic function $L(M, N, I)$.
- b) The residents' association requests the addition of a "vacation mode" via a master switch $V$ ($V = 1$ vacation mode active). In this mode, automatic night-time activation must be completely disabled to save energy in case of drafts, but the manual switch $I$ must still be able to turn on the light for security personnel needs. Derive the new function $L_{vac}(M, N, I, V)$, justifying the modification without the need to construct a 16-row truth table.
- c) In the initial circuit (without vacation mode), residents report that the light remains continuously on 24 hours a day without anyone pressing switch $I$ or anyone being in the hallway. Reasonably deduce which two independent physical faults in the circuit inputs could be causing this failure.
The Circuit Inside an Automatic System
Logic gates almost never work alone. Doors that open by themselves, traffic lights, or robots that dodge obstacles are automatic systems, and the same elements appear in all of them.
Example: the water pump of a building in Guadalajara fills the rooftop water tank (tinaco). A float sensor indicates whether the tank is empty ($N = 1$) and another whether the cistern has water ($C = 1$). The controller applies $S = N \cdot C$: the pump (actuator) starts only if the tank needs water and the cistern has some. When the tank's float marks full, $N$ changes to 0 and the pump stops: that sensor checks the result, so there is feedback.
The figure summarizes the design process of a digital circuit, but one step is missing. State which step it is, explain what is obtained upon completing it, and where…
The figure summarizes the design process of a digital circuit, but one step is missing. State which step it is, explain what is obtained upon completing it, and where that information comes from.
A student designs a home alarm system combining two sensors: door magnetic contact ($A = 1$ if open, $A = 0$ if closed) and volumetric motion radar ($B = 1$ if presence…
A student designs a home alarm system combining two sensors: door magnetic contact ($A = 1$ if open, $A = 0$ if closed) and volumetric motion radar ($B = 1$ if presence is detected). To ensure all situations are covered, he writes in his technical report:
"The alarm ($S = 1$) must trigger if there is motion with the door open ($A \times B$), and also if there is motion with the door closed ($\overline{A} \times B$). Therefore, the function is $S = A \times B + \overline{A} \times B$, which I will implement with two AND gates, one NOT, and one OR."
- a) Prove by algebraic simplification and using the corresponding truth table what the actual minimum logic function of the system is.
- b) Explain the physical meaning of the mathematical result obtained: does the door sensor $A$ provide any useful information to activate the siren? Which components from the initial setup are redundant?
- c) Predict what would happen to the student's system if the door sensor $A$ breaks down and remains permanently disconnected (erroneous logic level): would the alarm stop sounding in the presence of an intruder or would security be compromised compared to the simplified circuit? Justify your answer.
Back to the beginning: the alarm that sounds only with the door open and the system armed is $S = P \cdot A$, a single AND gate, and we got there by following the five stages.