Number System & Logic Gates: Indian Institute For Production Management

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 32

NUMBER SYSTEM

&
LOGIC GATES

Indian Institute for Production Management


NUMBER SYSTEM - 1
• Number System :
• A number is an abstract entity that represents a count or measurement.
A symbol for a number is called a numeral.

• A numeral is a symbol or group of symbols, or a word in a natural


language that represents a number.

• Number system is a set of numbers, or number-like objects, together


with one or more operations, such as addition or multiplication.

• Examples of number systems are : natural numbers, integers, rational


numbers, algebric numbers, real numbers, complex numbers etc.

Indian Institute for Production Management


NUMBER SYSTEM - 2
• Binary Numbers
• A binary number is made up of only 0s
and 1s.
• So each digit has only two possibilities:
0 or 1
• Bits
• In the computer world "binary digit" is
often shortened to the word "bit“.
• More Than One Digit
• So, if one digit has only two possible
"positions" (like "0" and "1", or "On" and
"Off"), how many positions are there with 2
or more binary digits?
• For example, how many different ways
could 4 digits be set.

Indian Institute for Production Management


NUMBER SYSTEM - 3
• And, in fact, we have created the first 16 binary numbers :
• Decimal:0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
• Binary :0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111

• This is quite a useful thing to remember. If ever you forget how the sequence of
binary numbers go, just think: "0" and "1", then "0" and "1" again but with a
"1" in front of each ("10" and "11") then take those four and put "1"s in front
("100","101","110","111") and so on.

• Binary Digits Double :


• Also notice that each time you add another binary digit you double the
possibilities.
• Why double?
• Because you have to take all the previous possible positions and match them with a
"0" and a "1" like above.
• So, if you had 5 things, then the total would be 32, 6 things would be 64, etc.

Indian Institute for Production Management


NUMBER SYSTEM - 4
• Using exponents, this can be shown as:
• No Of Digits Formula Settings
• 1 2¹ 2
• 2 2² 4
• 3 2³ 8
• etc etc etc
• Example 1: What is 11112 in Decimal?
• The "1" on the left is in the "2×2×2" position, so that means 1×2×2×2 (=8)
• The next "1" is in the "2×2" position, so that means 1×2×2 (=4)
• The next "1" is in the "2" position, so that means 1×2 (=2)
• The last "1" is in the units position, so that means 1
• Answer: 1111 = 8+4+2+1 = 15 in Decimal

Indian Institute for Production Management


NUMBER SYSTEM - 5
• Example 2: What is 10012 in Decimal ?
• The "1" on the left is in the "2×2×2" position, so that means 1×2×2×2 (=8)
• The "0" is in the "2×2" position, so that means 0×2×2 (=0)
• The next "0" is in the "2" position, so that means 0×2 (=0)
• The last "1" is in the units position, so that means 1
• Answer: 1001 = 8+0+0+1 = 9 in Decimal.

• Example 3: What is 1.12 in Decimal ?


• The "1" on the left side is in the units position, so that means 1.
• The 1 on the right side is in the "halves" position, so that means 1×(1/2)
• So, 1.1 is "1 and 1 half" = 1.5 in Decimal.

Indian Institute for Production Management


NUMBER SYSTEM - 6
• Example 4: What is 10.112 in Decimal?
• The "1" is in the "2" position, so that means 1×2 (=2)
• The "0" is in the units position, so that means 0
• The "1" on the right of the point is in the "halves" position, so that means 1×(1/2)
• The last "1" on the right side is in the "quarters" position, so that means 1×(1/4)
• So, 10.11 is 2+0+1/2+1/4 = 2.75 in Decimal.

• Definition of Decimal :
• The word "Decimal" means "based on 10" (From Latin decima : a tenth part).

• We sometimes say "decimal" when we mean anything to do with our numbering


system, but a "Decimal Number" usually means there is a Decimal Point.

Indian Institute for Production Management


NUMBER SYSTEM - 7
• Example 1: What is 2.3 ?
• On the left side is "2", that is the whole number part.
• The 3 is in the "tenths" position, meaning "3 tenths", or 3/10
• So, 2.3 is "2 and 3 tenths“.

• Example 2: What is 13.76 ?


• On the left side is "13", that is the whole number part.
• There are two digits on the left side, the 7 is in the "tenths"
position, and the 6 is the "hundredths" position
• So, 13.76 is "13 and 7 tenths and 6 hundredths"
• Or, you could think of a decimal number as a whole number plus
a Decimal Fraction, in which case we would say that 13.76 was:
• 13 and 76 / 100

Indian Institute for Production Management


NUMBER SYSTEM - 8
• Hexadecimals :
• A Hexadecimal Number is based on the number 16.
• The number just to the left of the point is a whole number, we call this place units.
• As we move left, every number place gets 16 times bigger.
• The first digit on the right of the point means sixteenths (1/16).
• As we move further right, every number place gets 16 times smaller (one sixteenth
as big).

Indian Institute for Production Management


NUMBER SYSTEM - 9
• 16 Different Values :
• The hexadecimal numbers look the same as the decimal numbers up to 9,
but then there are the letters ("A',"B","C","D","E","F") in place of the
decimal numbers 10 to 15:

• Decimal: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
• Hexadecimal: 0 1 2 3 4 5 6 7 8 9 A B C D E F

• So a single hexadecimal digit can show 16 different values instead of the


normal 10.

Indian Institute for Production Management


NUMBER SYSTEM - 10
• Example 1: What is 2E6 (Hexadecimal)?
• The "2" is in the "16×16" position, so that means 2×16×16
• The "E" is in the "16" position, so that means 14×16
• The "6" is in the "Units" position so that means 6.
• Answer: 2E6 = 2×16×16 + 14×16 + 6 (=742 in Decimal).

• Example 2: What is 2.3 (Hexadecimal)?


• On the left side is "2", that is the whole number part.
• The 3 is in the "sixteenths" position, meaning "3 sixteenths", or 3/16
• So, 2.3 is "2 and 3 sixteenths" (=2.1875 in Decimal)

Indian Institute for Production Management


LOGIC GATES - 1
• Logic Gates :
• Logic states (True/ False)(1 / 0)(High / Low) (+Vs /0V) (On/Off) Logic
gates process signals which represent true or false.

• Normally the positive supply voltage +Vs represents true and 0V


represents false.

• Other terms which are used for the true and false states are shown in the
table on the right.

• It is best to be familiar with them all. Gates are identified by their


function: NOT, AND, NAND, OR, NOR, EX - OR and EX - NOR.

• Capital letters are normally used to make it clear that the term refers to
a logic gate.

Indian Institute for Production Management


LOGIC GATES - 2
• Contd.
• Note that logic gates are not always required because simple
logic functions can be performed with switches or diodes:

• Switches in Series (AND function)

• Switches in Parallel (OR function)

• Combining Chip Output With Diodes (OR function)

Indian Institute for Production Management


LOGIC GATES - 3
• Logic Gate Symbols :
• There are two series of symbols for
logic gates :
• The traditional symbols have
distinctive shapes making them easy
to recognise so they are widely used
in industry and education.

• The IEC (International Electro


technical Commission) symbols are
rectangles with a symbol inside to
show the gate function.

Indian Institute for Production Management


LOGIC GATES - 4
• Inputs & Outputs :
• Gates have two or more inputs,
except a NOT gate which has only
one input.

• All gates have only one output.

• Usually the letters A, B, C and so on


are used to label inputs, and Q is
used to label the output.

• The inputs are shown on the left and


the output on the right.

Indian Institute for Production Management


LOGIC GATES - 5
• The Inverting Circle (o) :

• Some gate symbols have a circle on their


output which means that their function
includes inverting of the output.

• It is equivalent to feeding the output through


a NOT gate.

• For example the NAND (Not AND) gate


symbol shown on the right is the same as an
AND gate symbol but with the addition of an
inverting circle on the output.

Indian Institute for Production Management


LOGIC GATES - 6
• Truth Tables :
• A truth table is a good way to show the function of a logic gate.

• It shows the output states for every possible combination of input states.
The symbols 0 (false) and 1 (true) are usually used in truth tables.

• The example truth table on the right shows the inputs and output of an
AND gate.

• Input A Input B Output Q


• 0 0 0
• 0 1 0
• 1 0 0
• 1 1 1

Indian Institute for Production Management


LOGIC GATES - 7
• NOT gate (Inverter) :
• The output Q is true when the input
A is NOT true, the output is the
inverse of the input: Q = BAR A
• A NOT gate can only have one input.

• A NOT gate is also called an inverter. Traditional Symbol


• Input A Output Q
• 0 1
• 1 0

IEC Symbol

Indian Institute for Production Management


LOGIC GATES - 8
• AND Gate :
• The output Q is true if input A AND input B
are both true: Q = A . B

• An AND gate can have two or more inputs, its


output is true if all inputs are true.
Traditional Symbol
• Input A Input B Output Q
• 0 0 0
• 0 1 0
• 1 0 0
• 1 1 1

IEC Symbol

Indian Institute for Production Management


LOGIC GATES - 9
• Switches In Series (AND function) :

• If several on-off switches are connected


in series they must all be closed (on) to
complete the circuit.

• The diagram shows a simple circuit with


two switches connected in series to
control a lamp.

• Switch S1 AND Switch S2 must be


closed to light the lamp.

Indian Institute for Production Management


LOGIC GATES - 10
• NAND Gate (NAND = Not AND) :
• This is an AND gate with the output inverted, as
shown by the 'o' on the output.

• The output is true if input A AND input B are


NOT both true: Q = NOT(A AND B)=BAR (A.B)

• A NAND gate can have two or more inputs, its


Traditional Symbol
output is true if NOT all inputs are true.

• Input A Input B Output Q


• 0 0 1
• 0 1 1
• 1 0 1 IEC Symbol
• 1 1 0

Indian Institute for Production Management


LOGIC GATES - 11
• OR Gate :
• The output Q is true if input A OR input B
is true (or both of them are true):
Q = A OR B = A+B

• An OR gate can have two or more inputs, its


output is true if at least one
input is true. Traditional Symbol
• Input A Input B Output Q
• 0 0 0
• 0 1 1
• 1 0 1
• 1 1 1
IEC Symbol

Indian Institute for Production Management


LOGIC GATES - 12
• Switches In Parallel (OR function):

• If several on-off switches are connected


in parallel only one needs to be closed
(on) to complete the circuit.

• The diagram shows a simple circuit with


two switches connected in parallel to
control a lamp.

• Switch S1 OR Switch S2 (or both of


them) must be closed to light the lamp.

Indian Institute for Production Management


LOGIC GATES - 13
• NOR Gate (NOR = Not OR) : Input A Input B Output Q
• This is an OR gate with the output 0 0 1
inverted, as shown by the 'o' on the
output. 0 1 0
• The output Q is true if NOT inputs A 1 0 0
OR B are true: Q = NOT (A OR B)=
BAR(A+B) 1 1 0
• A NOR gate can have two or more
inputs, its output is true if no inputs
are true.
Traditional Symbol IEC Symbol

Indian Institute for Production Management


LOGIC GATES - 14
• EX-OR (EXclusive-OR) Gate : Input A Input B Output Q
• The output Q is true if either input A is 0 0 0
true OR input B is true, but not when 0 1 1
both of them are true:
Q = Q = (A BAR B) + (B BAR A) 1 0 1
• This is like an OR gate but excluding 1 1 0
both inputs being true.

• The output is true if inputs A and B are


DIFFERENT.
Traditional Symbol IEC Symbol
• EX-OR gates can only have 2 inputs.

Indian Institute for Production Management


LOGIC GATES - 15

• EX-NOR (Exclusive-NOR) Gate : Input A Input B Output Q


• This is an EX-OR gate with the output
inverted, as shown by the 'o' on the 0 0 1
output. 0 1 0
1 0 0
• The output Q is true if inputs A and B
are the SAME (both true or both false): 1 1 1

• Q = BAR OF [(A BAR B) + (B BAR A)]

• EX-NOR gates can only have 2 Traditional Symbol IEC Symbol


inputs.

Indian Institute for Production Management


LOGIC GATES - 16
• Summary for all 3-Input Gates :
• Inputs Output Of Each Gate
• A B C AND NAND OR NOR
• 0 0 0 0 1 0 1
• 0 0 1 0 1 1 0
• 0 1 0 0 1 1 0
• 0 1 1 0 1 1 0
• 1 0 0 0 1 1 0
• 1 0 1 0 1 1 0
• 1 1 0 0 1 1 0
• 1 1 1 1 0 1 0

Indian Institute for Production Management


LOGIC GATES - 17
• Combinations Of Logic Gates :
• Logic gates can be combined to produce
more complex functions. They can also be
combined to substitute one type of gate for
another.
• For example to produce an output Q which is
true only when input A is true and input B is
false, as shown in the truth table, we can
combine a NOT gate and an AND gate like Q = A AND NOT B
this:
• Input A Input B Output Q
• 0 0 0
• 0 1 0
• 1 0 1
• 1 1 0

Indian Institute for Production Management


LOGIC GATES - 18
• The function Of A Combination Of Inputs Outputs
Gates A B C D E Q
• Truth tables can be used to work out the
function of a combination of gates. 0 0 0 1 0 1
• For example the truth table on the right 0 0 1 1 0 1
show the intermediate outputs D and E
as well as the final output Q for the 0 1 0 0 0 0
system shown below.
0 1 1 0 1 1
1 0 0 0 0 0
1 0 1 0 0 0
1 1 0 0 0 0
D = NOT (A OR B)
E = B AND C 1 1 1 0 1 1
Q = D OR E = (NOT (A OR B)) OR (B AND C)

Indian Institute for Production Management


LOGIC GATES - 19
• Substituting One Type Of Gate For Another :
• Logic gates are available on ICs which usually
contain several gates of the same type, for example
four 2-input NAND gates or three 3-input NAND
gates.
• This can be wasteful if only a few gates are required
unless they are all the same type.
• To avoid using too many ICs you can reduce the
number of gate inputs or substitute one type of gate
for another.
• Reducing The Number Of Inputs :
• The number of inputs to a gate can be reduced by
connecting two (or more) inputs together. nandnot

• The diagram shows a 3-input AND gate operating as


a 2-input AND gate.

Indian Institute for Production Management


LOGIC GATES - 20
• Making a NOT gate from a NAND or NOR gate :
• Reducing a NAND or NOR gate to just one input creates a NOT gate.
• The diagram shows this for a 2-input NAND gate.

• Any Gate Can Be Built From NAND Or NOR Gates :


• As well as making a NOT gate, NAND or NOR gates can be combined to
create any type of gate.
• This enables a circuit to be built from just one type of gate, either NAND
or NOR.
• For example an AND gate is a NAND gate then a NOT gate (to undo the
inverting function).
• Note that AND and OR gates cannot be used to create other gates
because they lack the inverting (NOT) function.

Indian Institute for Production Management


LOGIC GATES - 21
• To change the type of gate, such as changing OR to AND,
you must do three things:

• Invert (NOT) each input.

• Change the gate type (OR to AND, or AND to OR)

• Invert (NOT) the output.

• For example an OR gate can be built from NOTed inputs fed into a
NAND (AND + NOT) gate

Indian Institute for Production Management

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy