An environmental scientist uses sensors to gather data from a river.
Using ANALOGUE-TO-DIGITAL converters (ADC), analogue data from the sensors is converted into digital signals and processed by a microprocessor.
The following table describes the digital signals that are generated by the ADC according to the state of the river:
| sensor | condition | binary value |
|---|---|---|
| ph | >5 | 1 |
| <=6 | 0 | |
| temp | <=15oC | 0 |
| >15oC | 1 | |
| gas | normal | 1 |
| abnormal | 0 |
A digital circuit must now be designed such that the alarm will sound if both
The pH level is less than 6 or the gas level is abnormal
and
The temperature is greater than 15oC
Use circuitverse to design the circuit.
We can represent the logic required to solve these kinds of puzzles by producing logic statments.
A logic statement describes the output of a system. It uses the logical operators and, or, nand, nor, exor and not to describe how the system's input(s) produce the system's output(s).
For example, in the above circuit, the output will be 1 if:
To further codify how to write logic statements, we can replace temp = 1 with simply temp.
We can also replace the statement gas is 0 with NOT gas
So the above statement can be written as:
To make it clear that the output will be 1 if the above condition is true, the full expression is often written as: