You are on page 1of 29

M E C H A N I C A L E N G I N E E R I N G D E PA R T M E N T

CHAPTER THREE
CHAPTER 4
BA S I C S O F D I G I TA L LO G I C S

1
DIGITAL SIGNALS
Digital logic is the fundamental concept underpinning all modern computer systems.
It is the system of rules that allow us to make extreamly complicated decisions
based on relatively simple ‘yes/no’ questions.
Digital devices convert digial inputs into one or more digital outputs.
Logic signal uses a digital signal
Digital Signals have two basic states:
They may represent levels of ON or OFF, OPEN or CLOSE, YES or NO, TRUE or
FALSE e.t.c.
A good example of binary is a light (only on or off)

2
BINARY
In Binary, there are only 0’s and 1’s

Voltages are used to represent logic values:


000 = 0
001 = 1
A voltage present (called Vcc )= 1
Binary to Decimal

010 = 2 Zero Volts or ground (called Gnd) = 0


011 = 3
100 = 4 A simple switch can provide a logic high or a logic low.

101 = 5
Vcc Vcc
110 = 6
Vcc, or 1 Gnd, or 0
111 = 7
… =…

3
LOGIC

They are made of six(if you include NOT gate) basic logic gates:
AND gate, OR gate, XOR gate, NAND gate, NOR gate and NOT gate

4
THE AND GATE
The AND logic:
 If all the inputs are high, the output is high
 If any input is low, the output is low

“If this input AND this input are high, the output is high”

Example: Machine tool interlock control system


 If the safeguard is in place and gives a 1 signal and the powers is on, giving a 1
signal, then there will be an output, a 1 signal, the machine operates.
 A burgler alarm gives an output when the alarm is switched on and when a door is
open to activate a sensor.

5
AND GATE
Symbol
A
Inputs Q Output
B

If both inputs are 1, the output is 1

If any input is 0, the output is 0

Boolean equation (to write in a simple mathematical format)

A.B = Q

6
AND GATE:- TRUTH TABLE
Are simple plots which explain the output of a circuit interms of the
possible inputs to that circuit.
They tabulate the relationship between the inputs and the output of a
logic gate

Inputs Output
0 0 0

Every possible 0 1 0
input combination
1 0 0
1 1 1

7
THE OR GATE
The OR gate:
 if any input is high, the output is high
 if all inputs are low, the output is low

“If this input OR this input is high, the output is high”

8
OR GATE
Symbol
A
Inputs Q Output
B

If any input is 1, the output is 1

If all inputs are 0, the output is 0

Boolean equation

A+B = Q

9
OR GATE:- TRUTH TABLE

Truth Table Inputs Output


0 0 0
0 1 1
1 0 1
1 1 1

10
THE NOT GATE

The NOT gate:


 Has just one input and one output
 If any input is high, the output is low
 If any input is low, the output is high

“The output is the opposite state of the input”


The NOT function is often called INVERTER.

11
NOT GATE
Symbol

Inputs A Q Output

If the input is 1, the output is 0

If the input is 0, the output is 1

Boolean equation

12
NOT GATE:- TRUTH TABLE

Truth Table
Input Output
0 1
1 0

13
THE NAND GATE
The NAND gate is the combination of an NOT gate with an AND gate.

Symbol
A
AND NOT NAND Q
B

Note: The circle in front of the NAND gate indicates an inverter.

Truth table
Boolean equation Inputs Output
A B Q
0 0 1
0 1 1
1 0 1
1 1 0
14
THE NOR GATE
The NOR gate is the combination of the NOT gate with the OR gate.

Symbol
A
OR NOT NOR Q
B

Note: The circle in front of the NAND gate indicates an inverter.

Truth table
Boolean equation Inputs Output
A B Q
0 0 1
0 1 0
1 0 0
1 1 0
15
THE XOR GATE
The EXCLUSIVE-OR gate can be considered to be an OR gate with a NOT gate
applied to one of the inputs to invert it before the inputs reach the OR gate.
Alternatively it can be considered as an AND gate with a NOT gate applied to one of
the inputs to invert it before the inputs reach the AND gate

Symbol A
A Q
B
Q

B NOT
Truth table
Boolean equation Inputs Output
A B Q
0 0 0
0 1 1
1 0 1
1 1 0
17
DIFFERENT IC CHIP DIAGRAMS

18
BOOLEAN ALGEBRA
Defines the rules for expressing and simplifing binary logic statements.The basic
Boolean laws and identities follows

Fundamental laws
OR AND NOT

Comutative laws

Associative laws

Distributive laws
19
DE MORGAN’S LAWS
Useful in rearranging or simplifying longer boolean expressions or converting
between AND and OR gate:

 If we invert both sides of these equations and apply the double


NOT law we can write De Morgan’s law in the alternative form:

20
EXERCISE
1) Simplify the Boolean expression

2) Prove whether the following Boolean equations are valid or not:

21
DESIGN OF LOGIC NETWORKS
The following steps facilitate the design of a digital circuit to solve a problem:
1) Define the problem in words.
2) Write the quasi-logic statement in English that can be translated in to Boolean
expression
3) Write the Boolean expression
4) Simplify and optimize the Boolean expressions if possible
5) Write an all-AND, all-NAND, all-OR, or all-NOR realization of the circuitto
minimise the number of required logic gate IC components.
6) Draw the logic schematic for the electronic realization of the circuit.

22
EXAMPLE: SIMPLE SECURITY PROTECTION SYSTEM FOR A HOUSE
Design a circuit for a simple secutity protection system for a home.
The home owner wants an alarm to sound if someone breaks into the house through a
door or window or if something is moving around in the house while the occupants
are away.Under certain conditions, the users may also want to disable portions of
the alarm system.We assume that there are sensors to detect if windows or doors
are disturbed and to detect motion. To accomplish the goals of this security system,
design a combinational logic circuit using two switches that can be set by the owner.

23
STEP 1:DEFINE THE PROBLEM IN WORDS
1) An active state where the alarm will sound only if the windows or doors are
disturbed.This state is useful when the occupants are sleeping.
2) An active state where the alarm will sound if the windows or doors are
disturbed or if there is motion in the house.This state is useful when occupants
are away.
3) A disable state where the alarm will not sound.This state is useful during normal
household activity.
 Define Boolean variables that will represent the inputs and outputs of the circuit.
A (input): state of the door and window sensors
B (input): state of the motion detectors
Y (output): output used to sound the alarm
CD(input): 2bit code set by the user to select the operating state
defined by
Operating state 1
Operating state 2
Operating state 3
STEP 2: WRITE QUASI-LOGIC STATEMENTS

We further translate the word statements into logic like statements.The quasi-logic
statements for the security system are:
Activate the alarm (Y=1) if A is high and the code CD is 01 or activate the
alarm if A or B is high and the code is 10.
Note the italicized quasi-Boolean operators, which should aid in writing the Boolean
expression.

25
STEP 3&4: WRITE THE BOOLEAN EXPRESSION & SIMPLIFY
To create a product of 1 for the active control code 10, we need to form the
expresssion . Based on this, the complete Boolean expression for the security
system is

 The alarm will sound (Y = 1) if the expression is 1 or


is 1; otherwise, the alarm will not sound (Y = 0).
 The first expression will be 1 if and only if A is 1 and C is 0 and D
is 1;the second expression will be 1 if and only if C is 1 and D is 0
and A or B is 1.

 Note that and


For the given control code combinations,If we dis
0 0 0 0 allow CD=1 1 the above equation can be
1 0 0 1 simplified as
0 1 1 0
26
STEP 5: AND REALIZATION
It is desirable to convert all operations to a prefered type of gate(AND or OR). The
reason for this is that logic gates come packaged on integrated circuit chips in
groups of four, six, or eight. Therefore, we may be able to reduce the total number
of chips required by using all of one type of gate.
Converting from one gate type to another is easily accomplished with a repeated
application of De Morgan’s laws.

27
STEP 6: DRAW THE CIRCUIT DIAGRAM
There are a total of 4 AND gates and 6 INVERTERS, the circuit can be constructed
with two ICs: one Quad AND gate IC (7408) and one Hex Inverter IC(7404) which
contains six inverters.

A B C D

A.D

Y
~END~

29

You might also like