Sie sind auf Seite 1von 27

Chapter-4

Digital Logics

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 1


4. Digital Logics
Digital logic deals with the representation, transmission,
manipulation, and storage of digital information.
4.1 Number Systems and Codes
Quantitative information is represented by a number
system. A character that represents quantitative
information is called a digit.
The number of different values which a digit may have is
called the radix, designated by R.
Numbers that require more than one digit can be
represented in different formats.
Different formats facilitate execution of different
procedures.
December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 2
Introduction
 In order to understand the behavior of systems,
mathematical models are needed.
 Such a model is created using equations and can
be used to enable predictions to be made of the
behavior of a system under specific conditions.
 The basics for any mathematical model is provided
by the fundamental physical laws that govern the
behavior of the system.

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 3


Decimal Number System
In a decimal system (base-10), 10 symbols or digits are used to
construct any number.
The symbols are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
. . . 103102 101 100
thousands hundreds tens units
How do you read 3456.789?
3000 plus 400 plus 50 plus 6 plus 7 tenth plus 8 hundredth plus
9 thousandth
That is: 3X103 + 4X102 + 5X101 + 6X101 + 7X10-1
+ 8X10-2 + 9X10-3

3 4 5 6 . 7 8 9

MSB decimal LSB


point
December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 4
Binary Number System
In a binary system (base-2), 2 symbols or digits are
used to construct any number.
The symbols are: 0 & 1
... 23 22 21 20
bit 3 bit 2 bit 1 bit 0

1 1 0 1 0 1

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 5


Example:
To convert a number from decimal to binary, you
successively divide the number by 2 and keep track of the
remainder
Ex: convert 13 to binary.

Number Result of division by 2 remainder


13 13/2 = 6 1
6 6/2 = 3 0
3 3/2 = 1 1
1 1/2 = 0 1
The final result is 110 1

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 6


Example-1:
Convert the following decimal numbers to binary.
a) 53, b) 211, c) 347
Solution:---
a) 53=32+16+4+1
=1X25 + 1X24 + 0X23 + 1X22 + 0X21+ 1X20
=110101
b) 211=128+64+16+2+1
=1X27 + 1X26 + 0X25 + 1X24 + 0X23+ 0X22
+ 1X21+ 1X20
=11010011
b) 347=256+64+16+8+2+1
= 1X28 + 0X27 + 1X26 + 0X25 + 1X24 + 1X23
+ 0X22 + 1X21+ 1X20
=101011011
December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 7
Example-2:
Convert the following binary numbers to decimal.
a) 10011010, b) 00101001, c) 1011.101
Solution:---
a) 10011010 = 1X27 + 0X26 + 0X25 + 1X24 + 1X23 + 0X22
+ 1X21+ 0X20
=128+16+8+2
=15410
b) 00101001 = 0X27 + 0X26 + 1X25 + 0X24 + 1X23
+ 0X22 + 0X21+ 1X20
=32+8+1
=4110
c) 1011.101 = 1X23 + 0X22 + 1X21 + 1X20 + 1X2-1 + 0X2-2 +1X2-3
= 8 + 0 + 2 + 1 + 0.5 + 0 + 0.125
= 11.62510

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 8


Octal Number System
In an octal system (base-8), 8 symbols or digits are used to
construct any number. The symbols are: 0, 1, 3, 4, 5, 6, 7
... 83 82 81 80
bit 3 bit 2 bit 1 bit 0
Example-3:
Convert the following decimal numbers to octal.
a) 53, b) 211, c) 347
Soln.
a) Number Result of division by 8 remainder
53 53/8 =6 5
6 6/8 = 0 6
The final result is 6 5
Ans.
b) 21110= 3238
c) 34710= 5338
December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 9
Hexadecimal Number System
In a hexadecimal system (base-16), 16 symbols or digits are
used to construct any number. The symbols are: 0, 1, 3, 4, 5,
6, 7, 8, 9, A, B, C, D, E, F
... 163 162 161 160
bit 3 bit 2 bit 1 bit 0
Example-4: Convert the following decimal numbers to HEX.
a) 53, b) 211, c) 347
Soln.
a) Number Result of division by 16 remainder
53 53/16 =3 5
3 3/16 = 0 3
The final result is 3 5
Ans.
b) 21110= D316
c) 34710= 15B16
December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 10
Binary-to-octal conversion
To convert from binary to octal, group each three digits
into one octal digit
Example:
Convert 101110111.100010 to octal.
Soln.
101110111.100010

5 6 7 . 4 2
Copy binary
point

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 11


Octal-to-binary conversion
To convert from octal to binary, simply expand each octal
digit into 3 binary digits
Example:
Convert 236.43 to binary.
Soln.

010 011 110 . 100 011


copy
binary
point

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 12


Binary-to-Hexadecimal conversion
To convert from binary to hexadecimal, simply
group each 4 binary digits into one hex-digit

Example: Convert 101111111.100010 to hex.

Soln. 000101111111.10001000

1 7 F . 8 8
Copy binary
point
December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 13
Hexadecimal-to-binary conversion
To convert from hex. to binary, simply expand each
hexadecimal digit into 4 binary digits
Example: Convert F5C.46 to binary.

Soln.
F5C.46

1111 0101 1100 . 0100 0110


copy
binary
point

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 14


Hexadecimal-to-binary conversion
To convert from hex. to binary, simply expand each
hexadecimal digit into 4 binary digits
Example: Convert F5C.46 to binary.

Soln.
F5C.46

1111 0101 1100 . 0100 0110


copy
binary
point

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 15


4.2 Logic Gates
Gates are main building blocks for computer systems and
their subsystems.
Understanding of logic gets is necessary in order to
understand the fundamentals of electronic circuits.
Two types of digital logics:
Combinatorial logic: output is a function of inputs
Sequential logic: output is a complex function of
inputs, previous inputs and previous outputs

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 16


Types of logic gates
AND gate
OR gate
NOT gate
NAND gate
NOR gate
XOR gate
Combining gates

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 17


AND gate
Produces 1 only when A=1 and B=1;
other combinations will result in zero.
A A &
B B
Q=A·B Q=A·B

i Truth Table
A A B Q=A·B
0 1 0 1 0
t 0 0 0
B 0 1 0
0 1 0
t 1 0 0
Q
0 1 0 1 1 1
December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 18
OR gate
Produces 0 only when A=0 and B=0;
other combinations will result 1.
A A ≥1
B B
Q=A+B Q = A +B

i A
0 1 0 1 0
t A B Q=A+B
0 0 0
B
0 1 0 0 1 1
t
1 0 1
Q
Q 0 1 0 1 0
1 1 1
December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 19
NOT gate
Gives 1 only when input is zero and vise-versa.

A Q=A A &
Q=A

A X=A
0 1
1 0

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 20


NAND gate
This is the AND gate with the outputs inverted.

Q=AB

A
Q=AB
B
A B A  B A  B
0 0 0 1
A 0 1 0 1
& Q=AB
B 1 0 0 1
1 1 1 0
December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 21
NOR gate
This is the OR gate followed by the NOT gate

A
Q=A+B
B
A
Q=A+B
B
A B A + B A + B
0 0 0 0
A 0 1 1 1
≥1 Q=A+B
B 1 0 1 1
1 1 1 1
December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 22
XOR gate
Gives 1 if the inputs are different and 0 if they are
identical or the output is equal to 1 if an odd number
of input values are 1 and 0 if an even number of
input values are 1. A
Q=A+B
B
A A B Q
Q=A+B
0 0 0
B
0 1 1
A 1
=1 Q=A+B
1 0
B 1 1 0
December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 23
Combining gate
Combination of three NOR gates
C
A
Q
B
D A B C D Q
0 0 1 1 0
C 0 1 1 0 0
A P1 1 0 0 1 0
P1 Q 1 1 0 0 1
B P1
D

AND gate

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 24


Combining gate
Combination of three NAND gates

C
A
Q
B
D A B C D Q
0 0 1 1 0
C 0 1 1 0 1
A & 1 0 0 1 1
& Q 1 1 0 1 1
B &
D

OR gate
December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 25
Integrated circuit (7408)
1 14

2 13

3 12

4 11

5 10

6 9

7 8

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 26


Types of ICs
Type IC Type gate Number of gates Number of
Input
7402 NOR 4 2
7408 AND 4 2
7411 AND 3 3
7421 AND 2 4
7425 NOR 2 4
7427 NOR 3 3

Note:
 74XX ICs are transistor-transistor logic (TTL) circuits; 0-5Volt
CMOS family have the numbers 40XX
High speed CMOS family are numbered as 74HCXX

December 31, 2020 CHAPTER-4 DIGITAL LOGICS D.K.RAO 27

Das könnte Ihnen auch gefallen