Digital Logic

NabeelaNousheen 101 views 34 slides Aug 05, 2021
Slide 1
Slide 1 of 34
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34

About This Presentation

Didital logic|Number system|Binary|Decimal|Octal|Hexadecimal|Conversions


Slide Content

.
UNIT I:Number systems and Boolean algebra Number Systems -
Decimal, Binary, Octal, Hexadecimal and their inter conversions, -Binary
Arithmetic -1’s complement, 2’s complementand9’s complement
.Binary codes -BCD, Excess-3, Graycode. Boolean Algebra: Boolean
Laws-Simplification of Boolean Functions -Logic gates and Truth Table
–Universal Gates (NANDandNOR ) -The K-map method up to five
variables, don’t care conditions, POS & SOP forms.
UNIT-II: Combinational and Sequential Circuits Combinational Logic:
Half/Full adder/subtractor, code conversion, Multiplexers, de
multiplexers, encoders, decoders, Combinational design using MUX &
DEMUX. BCD adder, magnitude comparator. Sequential logic: Flip flops
(RS, Clocked RS, D, JK, JK Master Slave)-Counters & types Synchronous
and Asynchronous counters-Registers, Shift registers and their types.
THIRUVALLUVAR UNIVERSITY
B.Sc. COMPUTER SCIENCE SYLLABUS UNDER CBCS
PAPER –1 Digital Logic & Programming in C
Objective: Provide basic knowledge on Digital Electronics to understand the
working principles of Digital computer and to develop programming skill
using C language
SEMESTER I

NumberSystem

What are NumberSystems?
•Number systems are the technique to represent numbers
in the computer system architecture, every value that
you are saving into or getting from computer memory
has a defined number system. Computer architecture
supports following number systems.
•Binary Number System (2digits)
•Octal Number System (8digits)
•Decimal Number System (10 digits)
•Hexa-decimal Number System (16digits)

The digit value in the number system is calculated using:
1.The digit
2.The index, where the digit is present in the number.
3.Finally, the base numbers, the total number of digits available in the
number system.

DecimalBinaryOctal
Hexa-
Decimal
0 0 0 0
1 1 1 1
2 10 2 2
3 113 3
4 1004 4
5 1015 5
6 1106 6
7 1117 7
8100010 8
9100111 9
DecimalBinaryOctal
Hexa-
Decimal
10101012 A
11101113 B
12110014 C
13110115 D
14111016 E
15111117 F

Binary NumberSystem
•Digital computers represents all kinds of data and information in the
binarysystem.
•Binary Number System consists of two digits 0 and 1. Its base is 2.
Each digit or bit in binary number system can be 0 or1.
•Binary to Decimal ConversionTechniques:
•Multiply each bit by 2
n
, where n is the “weight” of thebit.
•The weight is the position of the bit, starting from 0 on theright.
•Add theresults.

Octal NumberSystem
•Octal number system is the base 8 number system and uses the
digits from 0 to7.
•This number system provides shortcut method to represent long
binarynumbers
•Thenumberafter7is10.thenumberafter17is20andsoforth.
•Octal to Decimal ConversionTechniques:
•Multiply each bit by 8
n
, where n is the “weight” of thebit.
•The weight is the position of the bit, starting from 0 on the
right.
•Add theresults.

Decimal NumberSystem
•Decimalnumbersystemisthebase10numbersystemandusesthe
digitsfrom0to
9. Using these digits you can express anyquantity.
•It is what we most commonlyuse.
•Decimal to Binary ConversionTechniques:
•Divide each bit by 2, keep track of theremainder
•First remainder is bit 0 (LSB, least-significantbit)

Hexa-decimal Number System
•Hexa-decimal number system is the base 16 and uses the digits from 0
to9 and A toF. This number system provides shortcut method to
represent long binarynumbers.
•Unlike binary and octal, hexa-decimal has six additional symbols that
it uses beyond the conventional ones found indecimal.
•Hexa-decimal to Decimal ConversionTechniques:
•Multiply each bit by 16
n
, where n is the “weight” of thebit.
•The weight is the position of the bit, starting from 0 on theright.
•Add theresults.

Conversion AmongBases
Hexadecimal
Decimal Octal
Binary

•Groupinto3'sstartingatleastsignificantsymbol(ifthe
numberofbitsisnotevenlydivisibleby3,thenadd0'sat
themostsignificantend)
•write1octaldigitforeachgroup
e.g.:(1010101)
2to()
8
001 010 101
1 2 5
Answer =125
8
Binary toOctal

Answer =(010101111)
2
Octal toBinary
•For each of the Octal digit write its binary equivalent
e.g.:(257)
8 to ()
2
2 57
010
101
111

Binary toHexadecimal
•Groupinto4'sstartingatleastsignificantsymbol(ifthe
numberofbitsisnotevenlydivisibleby4,thenadd0'sat
themostsignificantend)
•write1hexdigitforeachgroup.
e.g.:(1010111011)
2to()
16
10 10111011
B2 B
Answer =(2BB)
16

Hexadecimal toBinary
•For each of the Hex digit write its binary equivalent (use 4 bitsto
represent).
e.g.:(25A0)
16 to ()
2
2 5 A0
0010
01011010
0000
Answer =(0010010110100000)
2

•Steps:
1.Convert octal number to its binaryequivalent
2.Convert binary number to its hexadecimal equivalent
e.g.:(635.27)
8to ()
16
6 3 5 . 2 7
110 011 101 . 010 111000 00
1 9 D . 5 C
Octal toHexadecimal

•Steps:
1.Converthexadecimalnumber to its binaryequivalent
2.Convert binary number to its octal equivalent
e.g.:
Hexadecimal toOctal
A 3 B . 7
1010 0011 1011 . 0111 00
5 0 7 3 . 3 4

Any Base toDecimal
Converting from any base to decimal is done by multiplying
each digit by its weight andsumming.
e.g.:
Binary toDecimal
1011.11
2 = (1x2
3 ) + (0x2
2 )+(1x2
1) + (1x2
0) + (1x2
-1) +(1x2
-2)
=8 +0 +2 +1 +0.5+0.25
=11.75
10

BinarytoDecimal
(1010.01)
2
1×2
3
+ 0x2
2
+ 1×2
1
+ 0x2
0
+ 0x2
-1
+ 1×2
-2
= 8+0+2+0+0+0.25 = 10.25
(
(1010.01)
2= (10.25)
10

Decimal to AnyBase
Steps:
1.Convert integerpart
( Successive Division Method)
2.Convert fractionalpart
( Successive Multiplication Method)

e.g.: (125)
10to ()
2
Answer :(1111101)
2

1. Decimal to Binary
(10.25)
10
Note:Keep multiplying the fractional part with 2 until decimal part 0.00 is obtained.
(0.25)
10= (0.01)
2
Answer:(10.25)
10= (1010.01)
2

Binary Arithmetic
•Binary arithmetic is essential part of all the digital computers and
many other digital system.
In the binary number system, there are only two digits 0 and 1, and
any number can be represented by these two digits. The arithmetic of
binary numbersmeans the operation of
•Binary Addition,
•Binary Subtraction,
•Binary Multiplicationand
•Binary Division.

BinaryAddition
consistsoffourpossibleelementary
Theadditin
operations:
Srno. Operations
0. 0+0=0
1. 0+1=1
2. 1+0=1
3. 1+1=10 (0 with carry of1)
In the last case, sum is of two digits: Higher Significant bit is
called Carry and lower significant bit is calledSum.

BinaryAddition
e.g.:
1
+ 0
1
1
0
1
0
0
10 0 1 0
Carr
y

The subtraction consists of four possible elementary
operations:
BinarySubtraction
In case of second operation the minuend bit is smaller
than the subtrahend bit, hence 1 isborrowed.
Srno. Operations
0. 0-0=0
1. 0-1=1(borrow1)
2. 1-0=1
3. 1-1=0

BinarySubtraction
e.g.:
0
- 0
1
1
0
1
1
0
1 1 11

BinaryMultiplication
Rules for Binary Multiplicationare:
Srno. Operations
0. 0*0=0
1. 0*1=0
2. 1*0=0
3. 1*1=1
*
e.g.:Multiply 110 by10
1 1
1
0
0
0 0 0
+1 1 0 0
1 1 0 0

BinaryDivision
Rules for Binary Divisionare:
Srno. Operations
0. 0/0=0
1. 1/0=0
2. 0/1=0
3. 1/1=1
e.g.:Divide 110 by10
1 1
1 0 1 1 0
1 0
0 1 0
1 0
0 0

complement
•Complements are used in the digital computers in order to
simplify the subtraction operation and for the logical
manipulations. For each radix-r system (radix r represents
base of number system) there are two types of complements.
S.N.Complement Description
1Radix Complement The radix complement is referred to as
the r's complement
2Diminished Radix
Complement
The diminished radix complement is
referred to as the (r-1)'s complement

1’sComplement
The1’scomplementofabinarynumberisthenumberthat
resultswhenwechangeall1’stozerosandthezerostoones.
1 1 0 1 0 0 1 0
NOTOPEARATION
0 0 1 0 1 1 0 1

2’sComplement
The 2’s complement the binary number that results when
add 1 to the 1’s complement. It’s givenas,
2’s complement = 1’s complement +1
Example: Express 35 in 8-bit 2’s complement form.
Solution:
35 in 8-bit form is00100011
00100011
11011100
+ 1
11011101

9’sComplement
Thenines'complementofadecimaldigitisthenumberthat
mustbeaddedtoittoproduce9.Thecomplementof3is6,
thecomplementof7is2.
Example: Obtain 9’s complement of 7493
Solution:
9 9 99
-7 4 93
2 5 06 9’scomplement

10’sComplement
The 10’s complement of the given number is obtained by
adding 1 to the 9’s complement. It isgiven as,
10’s complement = 9’s complement +1
Example: Obtain 10’s complement of 7493
Solution:
9 9 99 2 5 06
-7 4 93 + 1
2 5 06 2 5 07
10’scomplement
Tags