Iotl Lab 3
Iotl Lab 3
3 (Group A)
Aim: Study of different GATES (AND, OR, XOR), Sensors and basic binary operations.
Theory:
A logic gate is a device that acts as a building block for digital circuits. They perform basic
logical functions that are fundamental to digital circuits. Most electronic devices we use
today will have some form of logic gates in them. For example, logic gates can be used in
technologies such as smartphones, tablets or within memory devices. In a circuit, logic gates
will make decisions based on a combination of digital signals coming from its inputs. Most
logic gates have two inputs and one output. Logic gates are based on Boolean algebra. At any
given moment, every terminal is in one of the two binary conditions, false or true. False
represents 0, and true represents 1. Depending on the type of logic gate being used and the
combination of inputs, the binary output will differ. A logic gate can be thought of like a light
switch, wherein one position the output is off -- 0, and in another, it is on -- 1. Logic gates are
commonly used in integrated circuits (IC).
There are seven basic logic gates: AND, OR, XOR, NOT, NAND, NOR, and XNOR.
AND Gate
The AND gate is so named because, if 0 is called "false" and 1 is called "true," the gate acts in the
same way as the logical "and" operator. The following illustration and table show the circuit
symbol and logic combinations for an AND gate. (In the symbol, the input terminals are at left and
the output terminal is at right.) The output is "true" when both inputs are "true." Otherwise, the
output is "false." In other words, the output is 1 only when both inputs one AND two are 1
Truth Table
2.OR Gate
The OR gate gets its name from the fact that it behaves after the fashion of the logical inclusive "or."
The output is "true" if either or both of the inputs are "true." If both inputs are "false," then the
output is "false." In other words, for the output to be 1, at least input one OR two must be 1.
Logic Diagram
Truth Table
3.XOR Gate
The XOR ( exclusive-OR ) gate acts in the same way as the logical "either/or." The output is "true" if
either, but not both, of the inputs are "true." The output is "false" if both inputs are "false" or if both
inputs are "true." Another way of looking at this circuit is to observe that the output is 1 if the
inputs are different, but 0 if the inputs are the same.
Logic Diagram
Truth Table
NOT Gate
A logical inverter, sometimes called a NOT gate to differentiate it from other types of electronic
inverter devices, has only one input. It reverses the logic state. If the input is 1, then the
output is 0. If the input is 0, then the output is 1.
Logic Diagram
Truth Table
NAND Gate
The NAND gate operates as an AND gate followed by a NOT gate. It acts in the manner of the
logical operation "and" followed by negation. The output is "false" if both inputs are "true."
Otherwise, the output is "true."
Logic Diagram
Truth Table
XOR Gate
The XNOR (exclusive-NOR) gate is a combination XOR gate followed by an inverter. Its output is
"true" if the inputs are the same, and "false" if the inputs are different
Logic Diagram
Truth Table
Complex operations can be performed using combinations of these logic gates. In theory, there is
no limit to the number of gates that can be arrayed together in a single device. But in practice,
there is a limit to the number of gates that can be packed into a given physical space. Arrays of
logic gates are found in digital ICs. As IC technology advances, the required physical volume
for each individual logic gate decreases and digital devices of the same or smaller size become
capable of performing ever-more-complicated operations at ever- increasing speeds.
High or low binary conditions are represented by different voltage levels. The logic state of a
terminal can, and generally does, often change as the circuit processes data. In most logic
gates, the low state is approximately zero volts (0 V), while the high state is approximately
five volts positive (+5 V).
Logic gates can be made of resistors and transistors or diodes. A resistor can commonly be used as
a pull-up or pull-down resistor. Pull-up and pull-down resistors are used when there are any
unused logic gate inputs to connect to a logic level 1 or 0. This prevents any false switching of the
gate. Pull-up resistors are connected to Vcc (+5V), and pull-down resistors are connected to ground
(0 V).
Sensors
Sensors can be found in the home, the office, in our cars, buses, trains, trams, computers, medical
facilities, labs, power plants, restaurants, food processing factories, production lines etc
A Sensor is used to take a measurement, the measurement will be processed and the result of the
process, an output will be given. The output will then cause something to change or move. A
simple example is the temperature sensor in a thermostat. The temperature sensor is constantly
monitoring the temperature, once the measurement taken reaches the desired temperature, the
measurement is processed and the output causes the boiler to switch off.
Types of Sensors
There are many different types of sensors, the main categories are
Position Sensors
Pressure Sensors
Temperature Sensors
Force Sensors
Vibration Sensors
Piezo Sensors
Fluid Property Sensors
Humidity Sensors
Strain gauges
Photo Optic Sensors
Flow and Level Switches
These categories can all be split further into subcategories for example, within position sensors
there are the following types;
Contacting
Non-contacting
Rotary
Linear
And these types of sensors can be split even further, within non-contacting you
have the following types of sensors;
Hall effect
Capacitive
Eddy Current
Ultrasonic
Laser
Proximity
As discussed above there are many varieties of position sensor; linear, rotary, contacting, non-
contacting and use a variety of different technologies. Position sensors are used to measure and
monitor the position or displacement of an object.
We have been supplying position sensors for over 40 years and have developed our own range of
position sensors which have been added to the comprehensive range from our suppliers and
partners. Our own range includes;
Pressure sensors are often split into the following two categories; Pressure transducers and
pressure switches. The main difference is that pressure transducers give accurate feedback on
real-time pressure and pressure switches have a set limit which causes them to switch. Both
pressure switches and pressure transducers have mechanisms which use the formula –
Pressure = force divided by area to detect pressure.
Pressure sensors can measure the pressure in gases, liquids or solids and are used in a variety
of industries. Underwater pressure transducers are referred to as level meters as the pressure
they measure is directly related to the level of the water.
Pressure can be gauge, differential, absolute or vacuum and can be measured in Bar or PSI.
Load Cells are available in a wide variety of shapes and sizes. They are used to measure various
types of force, the main one being weight. Load cells are used in all types of scales; from
bathroom scales to counting scales, industrial scales, truck scales, hopper scales and everything
in between.
Temperature Sensors
Temperature sensors are used to measure and monitor temperature, whether this is the main
variable requiring measuring or a secondary variable which requires monitoring as a safety
precaution within another application.
Different types of temperature sensors will require different approvals. Medical approvals will
be required for temperatures used for patient monitoring or within medical devices. Other
certifications will be required for temperature sensors in food and beverage applications.
The basic operations of mathematics- addition, subtraction, division and multiplication are
performed on two operands. Even when we try to add three numbers, we add two of them and
then add the third number to the result of the two numbers. Thus, the basic mathematical
operations are performed on two numbers and are known as binary operations
Binary Addition
Binary Subtraction
Binary Multiplication
Binary Division
Binary Addition
The result obtained after adding two binary numbers is the binary number itself. Binary
addition is the simplest method to add any of the binary numbers. It can be calculated easily if
we know the following rules.
Rules
0+0=0
0+1=1
1+0=1
1 + 1 =10
Let us take any two binary numbers and add them.
Rules
0–0=0
0 – 1 = 1 (with a borrow of 1)
1–0=1
1–1=0
Let us take any two binary numbers and subtract them.
Binary Multiplication
The binary multiplications are calculated similarly as the other arithmetics numerals are
calculated. Let us take any two binary numbers and multiply them.It can be calculated easily if
we know the following rules.
Rules
0×0=0
0×1=0
1×0=0
1×1=1
Example: 1101 * 1010 = 10000010
Binary Division
The method of binary division is similar to the 10 decimal system other than the base 2 system.
It can be calculated easily if we know the following rules.
1 ÷ 1=1
1 ÷ 0 =0
0 ÷ 1 = Meaningless
0 ÷ 0= Meaningless
Conclusion: - Thus, we have studied different GATES (AND, OR, XOR), Sensors and basic
binary operations