Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 137

1

Syllabus of Unit 3

Topic Unit Number System and Logic Gates


Group 3
3.1 Number System:
Decimal, Binary, BCD, Octal, Hexadecimal
Conversions:
1) Decimal Binary (2)
2) Decimal Octal (2)
3.2 3) Decimal Hexadecimal (2)
G3.1 4) Binary Octal (2)
5) Binary Hexadecimal (2)
6) Octal Hexadecimal (2)
Binary Arithmetic:
1) Addition
3.3 2) Subtraction (2’s Compliment Method)
3) Multiplication
4) Division
3
Decimal Number System
𝑁 = ⋯ (𝐷 2 × 𝑅 2 )+ (𝐷 1 × 𝑅 1 )+ (𝐷 0 × 𝑅 0 )+ (𝐷 −1 × 𝑅 −1 )+ (𝐷 − 2 × 𝑅 −2 )+ (𝐷 − 3 × 𝑅 −3 )…

Integer Portion Fractional Portion

Where,
N = decimal number with 3-digit integer and 3-digit fractional
portion

D = Decimal digits
= 0,1,2,3,4,5,6,7,8,9
R = Radix or base of the number system
For Decimal numbersystemR= 10 4
Decimal Number System
For Example:
N = (356.238)10
= (3 × 10 2 )+ (5 × 10 1 )+ (6 × 10 0 )+ (2 × 10 −1 )+ (3 × 10−2 )+ (8 × 10 −3 )

5
Binary Number System
𝑁 = ⋯ (𝐵 2 × 𝑅 2 )+ (𝐵 1 × 𝑅 1 )+ (𝐵 0 × 𝑅 0 )+ (𝐵 −1 × 𝑅 −1 )+ (𝐵 −2 × 𝑅 −2 )+ (𝐵 −3 × 𝑅 −3 )…

Integer Portion Fractional Portion

Where,
N = binary number with 3-digit integer and 3-digit fractional
portion

B = Binary digits
= 0,1

R = Radix or base of the number system


6
For Binary number system base is 2
Binary Number System
For Example:
N = (110.101)2
= (1 × 2 2 )+ (1 × 2 1 )+ (0 × 2 0 )+ (1 × 2−1 )+ (0 × 2−2 )+ (1 × 2−3 )

7
Octal Number System
𝑁 = ⋯ (𝑂 2 × 𝑅 2 )+ (𝑂 1 × 𝑅 1 )+ (𝑂 0 × 𝑅 0 )+ (𝑂 −1 × 𝑅 −1 )+ (𝑂 −2 × 𝑅 −2 )+ (𝑂 − 3 × 𝑅 −3 )…

Integer Portion Fractional Portion

Where,
N = Octal number with 3-digit integer and 3-digit fractional portion

O = Octal digits
= 0,1,2,3,4,5,6,7

R = Radix or base of the number system


For Octal number system R = 8
8
Octal Number System
For Example:
N = (152.617)8
= (1 × 8 2 )+ (5 × 8 1 )+ (2 × 8 0 )+ (6 × 8−1 )+ (1 × 8−2 )+ (7 × 8−3 )

9
Hexadecimal Number System
𝑁 = ⋯ (𝐻 2 × 𝑅 2 )+ (𝐻 1 × 𝑅 1 )+ (𝐻 0 × 𝑅 0 )+ (𝐻 − 1 × 𝑅 −1 )+ (𝐻 − 2 × 𝑅 −2 )+ (𝐻 − 3 × 𝑅 −3 )…

Integer Portion Fractional


Portion

Where,
N = Hexadecimal number with 3-digit integer and 3-digit
fractional portion

H = Hexadecimal digits
= 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

R = Radix or base of the number system 10


For Hexadecimal Number system=16
Hexadecimal Number System
For Example:
N = (F3B.9A2)16
= (𝐹 × 16 2 )+ (3 × 16 1 )+ (𝐵 × 16 0 )+ (9 × 16 −1 )+ (𝐴 × 16 −2 )+ (2 × 16 −3 )

11
Conversions
1) Decimal Binary
2) Decimal Octal
3) Decimal Hexadecima
4) Binary l Octal
5) Binary Hexadecimal
6) Octal Hexadecimal

12
1. Decimal to Binary
• The most popular way to convert a decimal
number into the binary is the double dabble
method.
• In this method, the given decimal number is
progressively divided by 2 and writing the
remainder after each division.
• When all the remainder is read in reverse
order, the binary number is obtained.

13
1. Decimal to Binary
Steps for Decimal to Binary Conversion
Step – 1 Divide the decimal number which is to be converted by
2 which is the base of the binary number. Step – 2 The
remainder which is obtained from step 1 is the least significant
bit of the new binary number. Step – 3 Divide the quotient
which is obtained from the step 2
and the remainder obtained from thisis the second least
significant bit of the binary number.
Step – 4 Repeat the process until the quotient remains zero. Step
– 5 The last remainder obtained from the division is the most
significant bit of the binary number. Hence arrange the number
from most significant bit to the least significant bit (i.e., from
bottom to top).

14
1. Decimal to Binary

15
1. Decimal to Binary
Conversion of Decimal to Binary for Fraction
Number
• For fractional decimal numbers, multiply it by
2 and record the carry in the integral position.
• The carries when read down produces the
equivalent binary fraction as explained by the
example given below.

16
1. Decimal to Binary
Consider the fractional decimal number 0.35

The process of multiplication by 2 will


continue till the desired accuracy is achieved.
17
2. Binary to Decimal
• The binary number system consists only
two digits 1 and 0.
• The base of the binary number system is
2, and it is increased by the factor of two.
• The first digit has 20 weights, the second
has
21
weights, the weight of the third digit is
22 and so on.
• In the binary number system each digit
position has a weight regarding powers of
two.
18
2. Binary to Decimal

The conversion of the binary number (10101)2 into its equivalent


decimal number

19
2. Binary to Decimal
The conversion of a fractional binary number
(0.0101)2 into its equivalent decimal number

20
3. Decimal to Octal
Steps for Decimal to Octal Conversion
Step – 1 Divide the decimal number which is to be converted by
8 which is the base of the octal number. Step – 2 The
remainder which is obtained from step 1 is the least significant
bit of the new octal number. Step – 3 Divide the quotient which
is obtained from the step 2
and the obtained from thisis the second least
remainder of the octal
significantbit
Step – 4 Repeat the process until the
number.
quotient remains zero. Step
– 5 The last remainder obtained from the division is the most
significant bit of the octal number. Hence arrange the number
from most significant bit to the least significant bit (i.e., from
bottom to top).

21
3. Decimal to Octal
Consider the conversion of the decimal
number (239.53)10 . The conversion of
integer part is shown below.

And the fraction part

(239.53)𝟏𝟎 = (354.4172)𝟖
22
4. Octal to Decimal
In octal number system, each digit
position has the weight eight regarding power
eight shown in the figure below.

Consider the octal number (354.42)8 into its equivalent decimal


number. The integer part 354 converts to octal shown below.

And the fractional parts 0.42 converts to octal

(354.42)8= (236.531255)𝟏𝟎 23
5. Decimal to Hexadecimal
Steps for Decimal to Hexadecimal Conversion
Step – 1 Divide the decimal number which is to be converted by
16 which is the base of the hexadecimal number. Step – 2 The
remainder which is obtained from step 1 is the least significant
bit of the new hexadecimal number. Step – 3 Divide the quotient
which is obtained from the step 2 and the remainder obtained
from this is the second least significant bit of the hexadecimal
number. Step – 4 Repeat the process until the quotient remains
zero. Step – 5 The last remainder obtained from the division is
the most significant bit of the hexadecimal number. Hence
arrange the number from most significant bit to the least
significant bit (i.e., from bottom to top).

24
5. Decimal to Hexadecimal
Consider the conversion of the decimal number (3749)10 into its
hexadecimal equivalent number.

(3749)𝟏𝟎 = (D97)𝟏𝟔

25
5. Decimal to Hexadecimal
For fractional decimal numbers, multiply it by 16 and record the carry in the integral
position.
The carries when read down produces the equivalent binary fraction as explained
by the example given below.

26
6. Hexadecimal to Decimal
The base of the hexadecimal number system is 16,
therefore the weights corresponding to various positions
of the digits will be as shown below.

For instance, consider the conversion of hexadecimal number


(E8F6.27)16 into its equivalent binary number.

(E8F6.27)𝟏𝟔 = (59638.1523437)𝟏𝟎
27
7. Binary to Octal
The conversion of binary to octal is a reversal of
the above procedure. For example, the binary
number (010100111.100011) can be converted
into an octal number by first written the bits in
the group of three and then awarding the
decimal number of to each of the group of three
bits as shown below.

(010100111.100011) 𝟐 = 𝟖
28
8. Octal to Binary
The base of the octal number system (8) is the third power of
base of a binary system (2), the interconversion of octal and a
binary number is very simple and direct as explained below.
Let converting the octal number 35.346 to its equivalent binary
number

(35.346)𝟖 = 𝟐
29
9. Binary to Hexadecimal
The base of the binary number system is two because it
is represented by two digits, i.e., 0 and 1. It is difficult to
represent the large number in the form of binary digit
and hence the hexadecimal system are used in the
digital electronics. The hexadecimal number systems
are easily converted into a binary system by using the
method explains below.

30
10. Hexadecimal to Binary
For converting any hexadecimal number to binary, the binary
representation as detailed above in Table is to be written for
each hexadecimal digit.

(2C6B.E2)16 = (0010 1100 0110 1011. 1110 0010)2

31
11. Octal to Hexadecimal
First convert an octal number to a binary
number, then convert it to a h
​ exadecimal.

32
12. Hexadecimal to Octal
In this method, each digits of the hexadecimal number is
replaced by its 4 bits equivalent, first we find the binary
equivalent of the digit. If, it is not in 3 bits ,then the zeroes are
placed before the binary equivalent to make it 4 bits
Convert (524.36)16 into its binary equivalent
First of all, convert each of the digits into its binary bits and then
group the subsequent bits into 4 bits .If, they all are not able
form the group of 4 then, zeroe’s (0) are left padded to form the
4 bit pair.
5 2 4 3 6
0101 0010 0011 0110 ( 4 bits
representation ) .
(524.36)16 = (0101 01000010 0100 . 0011 0110)2
33
12. Hexadecimal to Octal
Then convert the binary number (11011.1011) to its octal equivalent
This conversion is simple. In this case ,first the binary bits are grouped into 3
bits .If ,they are not forming then zeros are left padded.
After that each groups are converted into its octal equivalent using the table:
11011.1011
011 011 . 101 100
3 3 5 4
(11011.1011)16 =

(33.54)8

34
Binary Addition
There are four points or steps to remember before
proceeding through the operation.
These are

𝑭𝒐𝒓 𝑬 𝒙 𝒂 𝒎 𝒑 𝒍 𝒆 (𝟏𝟎𝟏𝟎𝟏) 𝟐 + (𝟏𝟎𝟏𝟏 𝟎) 𝟐

35
Binary Subtraction
Subtraction and Borrow, these two words will be used very
frequently for the binary subtraction. There are four rules of
binary subtraction.

𝑭𝒐𝒓 𝑬 𝒙 𝒂 𝒎 𝒑 𝒍 𝒆 (𝟏𝟏𝟎𝟎𝟏) 𝟐 − (𝟏𝟎𝟎𝟏𝟏) 𝟐

36
Binary Subtraction by 1’s
Complement Method
What is 1’s compliment of a Binary number?
- Replace all 1 to 0 and 0 to 1
- For example
1 1 0 0 1 Original Binary Number

0 0 1 1 0 1’s

Compliment of Original Binary Number

The steps to be followed in subtraction by 1’s complement are:


i) Write down 1’s complement of the subtrahend.
ii) Add this with the minuend.
iii)If the result of addition has a carry over then it is dropped and an 1 is
added in the last bit.
iv) If there is no carry over, then 1’s complement of the result of addition
is 37
obtained to get the final result and it is negative.
Binary Subtraction by 1’s
Complement Method
For Example
1011.001 – 110.10
1’s complement of 110.10 is 1001.011 Hence
Minuend - 1011.001
1’s complement of subtrahend - 1001.011
Carry over - 1 0 1 0 0 . 1 0 0
1 010
0.101
The required difference is 1 0 0 . 1 0 1
When Carry over generates, result is +ve and obtained
by adding carry over in the result 38
Binary Subtraction by 1’s
Complement Method
10110.01 – 11010.10
1’s complement of 11010.10 is 00101.01 Hence
Minuend - 10110.01
1’s complement of subtrahend - 00101.01
Carry over - 0 1 1 0 1 1 . 1 0

1’s complement of result 00100.01


The required difference is 1 0 0 . 0 1
When Carry over do not generates, result is -ve and
obtained by taking 1’s compliment of the result
39
Binary Subtraction by 2’s
Complement Method
What is 2’s compliment of a Binary number?
- Get 1’s compliment of subtrahend
- Add 1 to LSB
- For example

1 1 0 0 1 Original Binary Number

0 0 1 1 0 1’s Compliment of Original Binary

1 Number Add 1 to LSB of 1’s

0 0 1 1 1 Compliment

2’s
Compliment of subtrahend

40
Binary Subtraction by 2’s
Complement Method
The operation is carried out by means of the following steps:
(i) At first, 2’s complement of the subtrahend is found.
(ii) Then it is added to the minuend.
(iii)If the final carry over of the sum is 1, it is dropped and the
result is positive.
(iv) If there is no carry over, the two’s complement of the sum
will be the result and it is negative.

41
Binary Subtraction by 2’s
Complement Method
1010.11 – 1001.01
2’s complement of 1001.01 is 0110.11. Hence
Minuend -

2’s complement of1subtrahend


010.11 - 0110.11
Carry over 1 0001.10

The required difference is 0001.10

If carry over generates, then result is +ve and it is as it is


42
Binary Subtraction by 2’s
Complement Method
10100.01 – 11011.10
2’s complement of 11011.10 is 00100.10. Hence
Minuend -

10100.01

2’s complement of subtrahend - 01100.10


Result of addition - 11000.11
As there is no carry over the result of subtraction is negative and
is obtained by writing the 2’s complement of 11000.11.
Hence the required result is – 00111.01.
in 2’s compliment form 43
Binary Multiplication
Binary multiplication is similar to decimal multiplication. It is
simpler than decimal multiplication because only 0s and 1s are
involved. There are four rules of binary multiplication.

44
Binary Division
Binary division is similar to decimal division. It is called as
the long division procedure.

45
Questions on G3.1

1. Convert
(10101.1101)2 to Decimal
(432.14)10 to Hexadecimal
(462.27)8 to Hexadecimal
(2BA.0C)16 to Octal
(B89A.03)16 to Decimal

2. Perform the following arithmetic


operations (110011 – 011011) using 2s
compliment method
(1101  110)
(110011 /101)
(111011.11 + 100100.01)
(110011-111001) using 2s compliment
method
Syllabus of Unit 3

Topic Unit
Group 3 Number System and Logic Gates

3.6 Basic Gates:- Symbol, Truth Table, Boolean Algebra Rules (AND, OR, NOT)
1. AND
3.7 2. OR
3.8 3. NOT
3.9 4. XOR
G3.2
3.10 5. XNOR

3.11 Universal Gate- Why they are known as Universal Gates?


1. NAND
3.12 2. NOR
3.13 De-Morgan’s theorem: Statement and Proof
Binary as a Voltage
Voltages are used to represent logic values:

A voltage present (called Vcc or Vdd) = 1

Zero Volts or ground (called gnd or Vss) = 0

A simple switch can provide a logic high or a logic low.


Digital Logic
◊ Basic Digital logic is based on 3
primary functions (the basic gates):

◊ NOT (INVERTER)

◊ AND

◊ OR
The NOT function
◊ The NOT function:
◊ 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
NOT Logic Symbol

Input Output

If the input is 1, the output is 0

If the input is 0, the output is 1


NOT Logic Symbol

Output
Input 0 1

Determine the output


NOT Logic Symbol

Output
Input 1 0

Determine the output


NOT Truth Table
◊ Truth Table

Input Output
0 1
1 0

NOT Function
The AND function
◊ The AND function:
◊ If all the inputs are high is 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”
AND Logic Symbol

Inputs Output

If both inputs are 1, the output is 1

If any input is 0, the output is 0


AND Logic Symbol

0
Inputs 0 Output

0
Determine the output
AND Logic Symbol

0
Inputs 0 Output

1
Determine the output
AND Logic Symbol

1
Inputs 1 Output

1
Determine the output
AND Truth Table
◊ To help understand the function of a
digital device, a Truth Table is
used: Input Output
Every possible input
combination 0 0 0
0 1 0
1 0 0
1 1 1
AND Function
AND Gates
◊ It is possible to have AND gates
with more than 2 inputs. The same
logic rules apply – “if any input…”
The OR function
◊ The OR function:
◊ 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”
OR Logic Symbol

Inputs Output

If any input is 1, the output is 1

If all inputs are 0, the output is 0


OR Logic Symbol

0
Inputs 0 Output

0
Determine the output
OR Logic Symbol

0
Inputs 1 Output

1
Determine the output
OR Logic Symbol

1
Inputs 1 Output

1
Determine the output
OR Truth Table
◊ Truth Table

Input Output
0 0 0
0 1 1
1 0 1
1 1 1
OR Function
Basic logic Gates

AND Gate OR Gate NOT Gate


X X
Z Z X Z
Y Y

X Y Z X Y Z X Z
0 0 0 0 0 0
0 1 0 0 1 1 0 1
1 0 0 1 0 1 1 0
1 1 1 1 1 1

68
Combinational logic
◊ How would your describe the output
of this combinational logic circuit?
NAND Gate
◊ The NAND gate is the combination
of an NOT gate with an AND gate.

The Bubble in front of the gate is an inverter.


Combinational logic
◊ How would your describe the output
of this combinational logic circuit?
NOR gate
◊ The NOR gate is the combination of
the NOT gate with the OR gate.

The Bubble in front of the gate is an inverter.


Universal logic Gates

NAND Gate NOR Gate


X X
Z Z
Y Y

X Y Z X Y Z
0 0 1 0 1
0 1 1 0 0
1 1 0 0
0 0 1 0
1 1 1 0
1
73
1
Derived logic Gates

Ex-OR Gate Ex-NOR Gate

X Y Z X Y Z
0 0 0 0 0 1
0 1 1 0 1 0
1 0 1 1 0 0
1 1 0 1 1 1

74
Boolean Laws
1. Commutative law

Commutative laws tells us we can


reverse the order of variables that are
either added together or multiplied
together without changing the truth of
expression: 75
Boolean Laws
1. Commutative law
Boolean Laws
2. Associative law

This laws tells us we can associate


groups of added or multiplied variables
together with parentheses without
altering the truth of the equations.
Boolean Laws
2. Associative law
Boolean Laws
3. Distributive law

79
Boolean Laws

To summarize, here are the three basic laws:


commutative, associative, and distributive.
De-Morgan’s Theorem
Theorem 1: AB = A + B (NAND = Bubbled OR)
It states that the, complement of a product is equal to addition of the
complements.
De-Morgan’s Theorem
Theorem 2: A + B = A . B (NOR = Bubbled AND)
It states that the, complement of a sum is equal to product of the
complements.
A A+B
A+B

B . . . . is equivalent to . . . .

A A

A.B

B
B
De-Morgan’s Theorem
Proof of De-Morgan’s
Theorem
Theorem 1: It states that the, complement of a product is equal to sum of the
complements. AB = A + B

A B AB AB A B A+B

0 0 0 1 1 1 1

0 1 0 1 1 0 1

1 0 0 1 0 1 1

1 1 1 0 0 0 0
Proof of De-Morgan’s
Theorem
Theorem 2: It states that the, complement of a sum is equal to product of the
complements. A+B = A B

A B A+B A+B A B AB

0 0 0 1 1 1 1

0 1 1 0 1 0 0

1 0 1 0 0 1 0

1 1 1 0 0 0 0
Examples:
 A + AB = A

Solution:
LHS = A + AB
= A (1 + B) …. (1 + B = 1)
=A
= RHS…. Proved
Examples:

 A + A’B = A + (A’ indicates A )


B

Solution:
LHS = A + A’B Since A = A +
AB
= (A+AB) + A’B
AB + A’B
= A + B(A+A’) …….
take
A+ B A’
common
=
=A+ B 1
= RHS ….. Proved
Examples:
 (A + B) (A + C) = A +
BC

Solution:
LHS = (A+B) (A+C)
= AA + AC +AB + …. AA =
BC A
= A + AC + AB + BC …. 1 + C = 1
= A (1 +C) + AB + BC
= A + AB + BC …. 1 + B = 1
= A (1 + B) + BC
= A + BC
= RHS ….
Proved
Exercise:
 A + A’B + AB = A + B

 AB + ABC + AB’ = A

 A’B’C’D’ + A’B’C’D + A’B’CD’ +A’B’CD’ = A’B’

 (A + B’ +AB) (A + B) A’B’ = 0

 AB’C + B + BD’ + ABD’ + A’C = B + C


NAND & NOR Gate as Universal Gate
 NOT Gate using NAND & NOR Gate
 AND Gate using NAND & NOR Gate
 OR Gate using NAND & NOR Gate
 NOR Gate using NAND Gate
 NAND Gate using NOR Gate
Questions on G3.2

1. With the help of truth table, explain operation of AND, OR, EX-OR,
EX-NOR, NOT gates

2.Define Universal Logic Gates. Why they known as Universal


Logic Gates?

3. State and prove De-Morgan’s Theorem


Syllabus of Unit 3

Topic Unit
Group 3 Number System and Logic Gates

3.14 Half adder


3.15 Full adder
3.16 Flip Flops : SR
G3.3 3.17 JK
3.18 T and D

3.19 Introduction to
1. Microprocessor (Only block diagram and explanation)
3.20 2. Microcontroller (Only block diagram and explanation)
Binary Addition
• The addition of two binary numbers is performed in exactly
the same manner as the addition of decimal numbers.
• Least-significant-digit first.
• “Carry” of 1 into the next position may be needed.
• 4 different cases for binary addition

A B Addition Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1

• The operations of subtraction, multiplication, and division


actually use only addition as their basic operation
97
HALF ADDER
•Half Adder is a combinational logic circuit with
two inputs & two output.
•It is the basic building block for addition of two
“Single” bit numbers. (Called Single Bit Adder)
• It has two outputs namely SUM & CARRY.
• Block Diagram :
A Sum (S)

Inputs
H.A Outputs
Carryout (C)
B

98
Truth Table for Adding
Two 1-Bit Numbers
INPUTS OUTPUTS

A B SUM CARRY

0 0 0 0

0 1 1 0

1 0 1 0

1 1 0 1

99
For Sum : For Carry :
Sum = A B + A B Carry = A B
=A + B

100
Logic Diagram for the Half Adder

A
Sum
B =A + B

CarryOut
=A.B

101
DISADVANTAGES OF HALF ADDER
For Ex : A1 A0 Number A
+ B1 B0 Number
+ B
Carry generated from A0 + B0
C0 S0
C1
S1 from this example, for the addition of
A1, B1 & C0 i.e. for three bits, is not possible to
perform by using half adder because it adds
only two bits. Hence we cannot use half adder
in practice.
102
FULL ADDER
• It is a 3 single bit adder circuit .

•It has three inputs (A, B & Cin) & two


outputs (Sum, Carry out) combinational
circuit.

•As it consider carry for next addition


hence it overcomes the drawback of half
adder circuit.
103
Block Diagram of Full Adder

A Sum (S)

3 Inputs
F. A.
B Carryout (Co)

Cin

104
Truth Table for Full Adder
A B Cin S Co
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
105
Sum = S = A + B + Cin

Carryout = Co = A B + A Cin + B
Cin

106
Logic Diagram For Full Adder
A B Cin 74LS86N
1 3
2 4
6
5 Sum
74LS86N
1
2 3
1
74LS08J 2 3
4
6 74LS32N
5 4

74LS08J
5 6
Carryout
9 74LS32N
10 8

107
Full Adder using Half Adder:

H.A. 1 H.A. 2

A A2 S2 S
A1 S1

B B1 C1 B2 C2
1

Cin
Co
2
3
74LS32
N
108
Flip-Flops
 Flip-flop is a bistable logic device i.e. its outputs have two stable
states.

 The state of the flip-flop is change only with the inputs and clock
signal.

 The clock signal is only edge triggered clock. Either positive edge
negative
or edge triggered clock. High

 Flip-flop is basic sequential circuit.

Positive Edge Low

Negative Edge
110
Flip-Flops

I/P CLK
Flip-Flop O/P

Types: 1. S – R Flip-Flop
2. J – K Flip-Flop
3. D Flip-Flop
4. T Flip-Flop

110
S- R Flip-Flop

S Q

I/P CLK S-R O/P


Flip-Flop
R Q

111
SR Flip Flop
S-R Flip-Flop OR S-R Latch

S R Qn+1 Qn+1
No
0 0 Qn Qn Change

0 1 0 1 Reset

1 0 1 0 Set

1 1 1 1
Race

113
S-R Flip-Flops

When S = 0 & R = 0
S R Qn+1 Qn+1
No
0 0 Qn Qn Change

S = 0 & R = 0 : No Change

114
S-R Flip-Flops

When S = 0 & R = 1
S R Qn+1 Qn+1

0 0 Qn Qn No
Change
0 1 0 1
Reset

S = 0 & R = 1 : Flip-Flop is RESET

115
S-R Flip-Flops

When S = 1 & R = 0
S R Qn+1 Qn+1

0 0 Qn Qn No
Change
0 1 0 1
Reset
1 0 1 0 Set

S = 1 & R = 0 : Flip-Flop is SET

116
S-R Flip-Flops

When S = 1 & R = 1
S R Qn+1 Qn+1
No
0 0 Qn Qn Change

0 1 0 1 Reset

Set
1 0 1 0

1 1 1 1 Race

S = 1 & R = 1 : Race

117
J-K Flip-Flop

J Q

CLK J-K O/P


Flip-Flop
K Q

118
J-K Flip-Flop

J K Qn+1 Qn+1
No
0 0 Qn Qn Change

0 1 0 1 Reset

1 0 1 0 Set

1 1 Qn Qn Toggl

119
J-K Flip-Flop

When J = 0 & K = 0
J K Qn+1 Qn+1
No
0 0 Qn Qn Change

J = 0 & K = 0 : No Change

120
J-K Flip-Flops

When J = 0 & K = 1
J K Qn+1 Qn+1

0 0 Qn Qn No
Change
0 1 0 1
Reset

J = 0 & J = 1 : Flip-Flop is RESET

121
J-K Flip-Flops

When J = 1 & K = 0
J K Qn+1 Qn+1

0 0 Qn Qn No
Change
0 1 0 1
Reset
1 0 1 0 Set

J = 1 & K = 0 : Flip-Flop is SET

122
J-K Flip-Flops

When J = 1 & K = 1
J K Qn+1 Qn+1
No
0 0 Qn Qn Change

0 1 0 1 Reset

Set
1 0 1 0

1 1 Qn Qn Toggl
e

J = 1 & K = 1 : Toggle

123
D Flip-Flop

D
J Q
1

CLK J-K O/P


Flip-Flop
2

K Q

D Q D Qn Qn’
D
CLK Flip-flop 0 0 1
Q
1 1 0

124
T Flip-Flop

T
J Q

CLK J-K O/P


Flip-Flop
K Q

T Q T Qn Qn’
T
CLK Flip-flop 0 1 0
Q
1 0 1

125
Applications of Flip-Flops
 Acts as one bit memory

 Building block of counter (preferred T Flip-flop)

 In the shift registers

 In the timers

 In the clock or frequency dividers

126
Why do we need to learn
Microprocessors/controllers?
 The microprocessor is the core of
computer systems.
 Nowadays many communication, digital
entertainment, portable devices, are
controlled by them.
 A designer should know what types of
components he needs, ways to reduce
production costs and product reliable.
127
The necessary tools for a

microprocessor/controller
 CPU: Central Processing Unit
 I/O: Input /Output
 Bus: Address bus & Data bus
 Memory: RAM & ROM
 Timer
 Interrupt
 Serial Port
 Parallel Port
128
Microprocessor (MPU)
 A group of electronic
circuits fabricated on a
semiconductor chip that
can read binary
instructions written in
memory and process
binary data according
to those instructions
 CPU and MPU

129
Microprocessors:
General-purpose microprocessor
 CPU for Computers
 No RAM, ROM, I/O on CPU chip itself
 Example : Intel’s x86, Motorola’s
680x0

Many chips on mother’s board


Data Bus
CPU
General-
Serial
Purpose RAM ROM I/O Timer COM
Micro- Port
Port
processor
Address Bus

General-Purpose Microprocessor System

130
Microcontroller :

 A smaller computer
 On-chip RAM, ROM, I/O ports...
 Example : Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and
PIC 16X

CPU RAM ROM


A single chip
Serial
I/O Timer
Port COM
Port Microcontroller

131
Microcontroller
 Microcontrollers

⎯ A microcontroller is a simple
computer implemented in a
single VLSI chip.

⎯ In general, microcontrollers
are cheap and have low
performance

⎯ Microcontrollers are widely


used in industrial control,
automobile and home
applications

Block diagram of a microcontroller


Microprocessor Microcontroller
Microprocessor is the heart of Computer system. Micro Controller is the heart of an embedded
system.
It is only a processor, so memory and I/O Micro Controller has a processor along with internal
components need to be connected externally memory and I/O components.
Memory and I/O has to be connected externally, so Memory and I/O are already present, and the
the circuit becomes large. internal circuit is small.
You can't use it in compact systems You can use it in compact systems.
Cost of the entire system is high Cost of the entire system is low
Due to external components, the total power As external components are low, total power
consumption is high. Therefore, it is not ideal for the consumption is less. So it can be used with devices
devices running on stored power like batteries. running on stored power like batteries.

It is mainly used in personal computers. It is used mainly in a washing machine, MP3 players,
and embedded systems.
Microprocessor has a smaller number of registers, so Microcontroller has more register. Hence the
more operations are memory-based. programs are easier to write.
It has no RAM, ROM, Input-Output units, timers, and It has a CPU along with RAM, ROM, and other
other peripherals on the chip. peripherals embedded on a single chip.
It's used for general purpose applications that allow It's used for application-specific systems.
you to handle loads of data.
It's complex and expensive, with a large number of It's simple and inexpensive with less number of
instructions to process. instructions to process in130
I
Microprocessor vs. Microcontroller

Microprocessor Microcontroller
 CPU is stand-alone, RAM, •
CPU, RAM, ROM, I/O and
ROM, I/O, timer are timer are all on a single chip
separate • fix amount of on-chip ROM,
 designer can decide on the
RAM, I/O ports
amount of ROM, RAM and • for applications in which cost,
I/O ports. power and space are critical
 expansive
• single-purpose
 versatility

 general-

purpose
134
Applications of Microprocessor-Based Systems

 Computers
⎯ System performance is normally the most important design concern

Other

... ...
Keyboard Monitor Disk
peripherals
Bus

Micro- Timing & Interrupt


Memory
processor control control

Block diagram of a computer

1-135
Questions on G3.3

1.Explain in detail the working of a full adder with the help of a


truth table and give its sum and carry.

2. Explain different types of flip-flops and state one application


of each.

3.Draw block diagram of Microprocessor and explain function


of each block.

4. Draw block diagram of Microcontroller and explain function


of each block.
137

You might also like