Top Banner
A VERY GOOD MORNING TO ALL OF U
93
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 1 Ppt

A VERY

GOOD

MORNING TO

ALL

OF

U

Page 2: Chapter 1 Ppt

BINARY SYSTEMS

CHAPTER 1

DIGITAL LOGIC DESIGN

Page 3: Chapter 1 Ppt

TOPICS

• DIGITAL SYSTEMS• NUMBER SYSTEMS• NUMBER BASE CONVERSIONS• OCTAL AND HEXADECIMAL NUMBERS• COMPLEMENTS• SIGNED BINARY NUMBERS• BINARY CODES• BINARY STORAGE AND REGISTERS• BINARY LOGIC

Page 4: Chapter 1 Ppt

DIGITAL SYTEMS

• SYSTEM• TYPES OF SYSTEMS• CLASSIFICATION OF SYSTEMS• APPLICATIONS OF DIGITAL SYSTEMS• ADVANTAGES OF DIGITAL SYSTEMS• DISADVANTAGES OF DIGITAL SYSTEMS• DIGITAL COMPUTER• DESIGN OF DIGITAL SYSTEMS• SWITCHING CIRCUITS• WHY BINARY IN DIGITAL SYSTEMS?

Page 5: Chapter 1 Ppt

SYSTEM

Accepts various Inputs Performs a particular task Generates output

Page 6: Chapter 1 Ppt

Classification of SystemsAnalog Systems

(Continuous)Digital Systems(Discrete step

by step)

Physical quantities or signals may vary continuously over a specified range.

Physical quantities or signals can assume only discrete values .

Hence represented by continuously variable indicator

Represented by symbols called digits

Thermometer Digital Clock

Page 7: Chapter 1 Ppt

Applications of Digital Systems

• Communication

Page 8: Chapter 1 Ppt

Applications of Digital Systems

• Business Transactions

Page 9: Chapter 1 Ppt

Applications of Digital Systems

• Traffic Control

Page 10: Chapter 1 Ppt

Applications of Digital Systems

• Space Guidance• Weather

Monitoring

Page 11: Chapter 1 Ppt

Applications of Digital Systems

• Medicine

Page 12: Chapter 1 Ppt

Applications of Digital Systems

• Internet

Page 13: Chapter 1 Ppt

Applications of Digital Systems

• Commercial

Page 14: Chapter 1 Ppt

Applications of Digital Systems

• Commercial

Page 15: Chapter 1 Ppt

Applications of Digital Systems

• Commercial

Page 16: Chapter 1 Ppt

Applications of Digital Systems

Commercial

Page 17: Chapter 1 Ppt

Applications of Digital Systems

Industry

Page 18: Chapter 1 Ppt

Applications of Digital Systems

• Scientific Enterprises

Page 19: Chapter 1 Ppt

Applications of Digital Systems

• Military

Page 20: Chapter 1 Ppt

Advantages of Digital Systems

• Easier to Design• Information storage is easy• Accuracy and Precision

through out the system• Operations can be

programmed• Digital Circuits are less prone

to noise

Page 21: Chapter 1 Ppt

Disadvantages of Digital Systems

• Real world is analog• Digitization of information is a

time consuming process.

Page 22: Chapter 1 Ppt

Digital Computer• It can follow a sequence of instructions

called a program, that operates on given data.

• Program and data can be varied according to the user’s needs.

• Hence, it can perform various information processing tasks that fulfill several applications.

Page 23: Chapter 1 Ppt

Digital Computer

• One important characteristic of digital computer is the ability to manipulate discrete elements of information.

• Discrete information must contain finite number of elements.

• Eg: 10 Decimal digits, 26 alphabets, 52 playing cards, 64 chess squares

Page 24: Chapter 1 Ppt

Digital Computer• The name Digital Computer emerged

from an application.• Early computers are used for numeric

computations in which discrete elements are digits.

• Physical quantities used to represent discrete information are signals.

• Some of the signals are voltage and current signals (Implemented by transistors)

Page 25: Chapter 1 Ppt

Digital Computer• But signals used in digital systems have 2

discrete values 0 & 1 ( binary)• Binary Digit- Bit 0 or 1• Group of bits – Binary Codes• Hence using various techniques, groups of bits

can represent discrete symbols.• These symbols are again used to develop

system in digital format.• So, we can say that digital system manipulates

discrete elements of information which is again represented internally in binary form

Page 26: Chapter 1 Ppt

Design of Digital SystemsSystem Design

Logic Design

Circuit Design

Page 27: Chapter 1 Ppt

System Design •Breaking overall system into subsystems & specifying chcs. of each sub-systems

Logic Design •Determines how to interconnect and control these sub-systems

Circuit Design •Specifying the interconnection of specific components like resistors, diodes and transistors to form gates, flip flops, or other logic building blocks

Page 28: Chapter 1 Ppt

Switching Circuits

• Many of sub systems of digital systems take form of a switching circuit.

• It consists of one or more inputs and outputs having discrete values.

Switching Circuit

x₁

x₂..

xm

Z₁

Z₂..

Zm

Page 29: Chapter 1 Ppt

Classification of Switching Circuits

Combinational Circuits Sequential Circuits

Output depends on present on input only

Output depends on both past and present inputs

Building blocks are logic gates

Building blocks are logic gates and flip flops

No memory is required as no storage is necessary

Memory is required as past inputs are to be stored

Eg: Multiplexers, Decoders, Encoders, PLDs, PLAs, PALs, CPLDs, FPGAs etc.

Eg: Ring Counter, Synchronous Counter, Ripple Counter

Page 30: Chapter 1 Ppt

Why binary in Digital Systems

• In general, switching devices used in digital systems are generally two-state devices.

• So, output can assume only two discrete values.

Page 31: Chapter 1 Ppt

Switching devices

Relay

On

Diode Transistor

Page 32: Chapter 1 Ppt

Number Systems

• Decimal Number System (10)• Binary Number System ( 2 )• Octal Number System ( 8 )• Hexadecimal Number System (16)

Page 33: Chapter 1 Ppt

Decimal Number System

Representation

=5*10^2 + 0*10^1 + 1*10^0 + 6*10^-1 + 8*10^-2

(501.68)10

Page 34: Chapter 1 Ppt

Decimal Number System

• Numbers have positional importance• 349.2510

In the binary system, positional importance follows powers of 2

3 x 102 = 3 x 100 = 300

4 x 101 = 4 x 10 = 40

9 x 100 = 9 x 1 = 9 2 x 10-1 = 2/10

5 x 10-2 = 5/100

Page 35: Chapter 1 Ppt

Conversion from Binary to Decimal

• (11001.11)₂

= 1*2^4 + 1*2^3 + 0*2^2 + 0* 2^1 + 1*2^0 + 1*2^-1 + 1*2^-2 = 16 + 8 + 0 + 0 + 1 + 0.5 + 0.25

= ( 25.75 )10

Page 36: Chapter 1 Ppt

Conversion from Octal to Decimal

( 347.205)₈

= 3 * 8^2 + 4 * 8^1 + 7 * 8^0 + 2 * 8^-1 + 0 * 8^-2 + 5 * 8^-3

= 192 + 32 + 7 + 0.25 + 0 + 0.01

= ( 231.26)10

Page 37: Chapter 1 Ppt

Conversion from Hexadecimal to Decimal

• ( 23A4.EC)16

= 2 * 16^3 + 3 * 16^2 + A * 16^1 + 4 * 16^0 + E * 16^-1 + C * 16^-2= 8192 + 768 + 160 + 4 + 0.875 + 0.0468

= (9214.9218 )10

Page 38: Chapter 1 Ppt

Conversion from Decimal to Binary

( 61 )10

Page 39: Chapter 1 Ppt

Conversion from Decimal to Binary

( 61 )10

Decimal value Integer Fraction Coefficient

0001

Page 40: Chapter 1 Ppt

Conversion from Decimal to Octal

(247.6875)10

= (367.54)₈

Page 41: Chapter 1 Ppt

Octal Number SystemOctal Numbers Binary Equivalents

0 000

1 001

2 010

3 011

4 100

5 101

6 110

7 111

Page 42: Chapter 1 Ppt

Hexadecimal Number SystemDecimal Values Hexadecimal

RepresentationBinary Equivalents

0 0 0000

1 1 0001

2 2 0010

3 3 0011

4 4 0100

5 5 0101

6 6 0110

7 7 0111

8 8 1000

9 9 1001

10 A 1010

11 B 1011

12 C 1100

13 D 1101

14 E 1110

15 F 1111

Page 43: Chapter 1 Ppt

Binary Arithmetic

• Binary Addition• Binary Subtraction• Binary Multiplication• Binary Division

Page 44: Chapter 1 Ppt

Binary Addition

1 0 1 1 0 1 0 1 + 1 1 0 0 + 1 1 1 1 _ _ _ _ _ _ _ _ _ _ 1 0 1 1 1 1 0 1 0 0

Page 45: Chapter 1 Ppt

Addition of two binary numbers

1410 = 011102

+2510 = 1100121

0

1

0

1

0

0

1

0

1

1

0

= 32 + 7 = 39

Page 46: Chapter 1 Ppt

1 0 1 1 0 1

+ 0 1 1 1 0 1

1

0

0

1

1

0

1

1

1

0

1

0

1

Carry

Sum

Check your work

45

+ 29

= 74

Page 47: Chapter 1 Ppt

Binary Subtraction

1 0 1 1 Minuend11101

- 0 1 1 0 Subtrahend - 10011

_ _ _ _ _ _ _ _ _ _ _ _ 0 1 0 1 Difference

01010

Page 48: Chapter 1 Ppt

Binary Multiplication

1001 Mul t ip l icand *1101 Mul t ip l ier _____

1001 0000 1001

1001 _________

1110101

Partial Products

Final Product

Page 49: Chapter 1 Ppt

Binary Division 1101 1001 1110101 1001 - - - - - - - - - 1011 1001 - - - - - - - - - - - 1001 1001

- - - - - - - - - - - 0000

Page 50: Chapter 1 Ppt

Complements

Used in digital computers • for simplifying the subtraction

operation and• for logical manipulation.

Page 51: Chapter 1 Ppt

Diminished Radix Complement

• Also called (R-1)’s complement• (R-1)’s complement of any number system

can be defined as ( Rⁿ-1 )-N• R = Base or Radix of a given number system• N = given number• n = no. of digits present in the given number• For Decimal Number System, R-1’s

complement is (10ⁿ-1) –N• For Binary Number System, R-1’s

complement is (2ⁿ-1) –N

Page 52: Chapter 1 Ppt

For Decimal Number System

• R = 10 ==> (R-1) = 9• ( R-1 )’s complement = 9’s complement = (10ⁿ-1) –N (R-1)’s complement of 546700 is 9’s complement of 546700 = (10⁶-1)-

(546700)

= 99999-546700

= 453299

Page 53: Chapter 1 Ppt

For Binary Number System

• R = 2 ==> (R-1) = 1• ( R-1 )’s complement = 9’s complement = (2ⁿ-1) –N (R-1)’s complement of 1011000 is 1’s complement of 1011000 =(2⁷-1)-

(1011000)

= 1111111-1011000

= ( 0100111 )₂

Page 54: Chapter 1 Ppt

Radix Complement

• Also called R’s complement• R ’s complement of any number system can

be defined as [ ( Rⁿ-1 )-N ]+ 1• R = Base or Radix of a given number system• N = given number• n = no. of digits present in the given number• For Decimal Number System, R-1’s

complement is [ (10ⁿ-1) –N ] + 1• For Binary Number System, R ’s complement

is [ (2ⁿ-1) –N ] + 1

Page 55: Chapter 1 Ppt

For Decimal Number System

• R = 10 R’s complement = 9’s complement

= [ (10ⁿ-1) –N ] + 1 R’s complement of 546700 is 10’s complement of 546700 = 9’s

complement + 1

9’s complement = (10⁶-1)- (546700) = 999999-546700

= 45329910’s complement = 453299 + 1 = 453300

Page 56: Chapter 1 Ppt

For Binary Number System

• R = 2 ==> R’s complement = 2’s complement

= (2ⁿ-1) –N R’s complement of 1011000 is 1’s

complement + 1

1’s complement of 1011000 =(2⁷-1)- (1011000)

= 1111111-1011000

= ( 0100111 )₂

2’s complement = 0100111 + 1 = (01001000)₂

Page 57: Chapter 1 Ppt

Subtraction with Complements(Unsigned Numbers)

• During subtraction of two n- digit unsigned numbers M & N of same base R, there occurs two cases

• Case (i): M>N• Case (ii): M<N• This operation can be applied for

any number system

Page 58: Chapter 1 Ppt

For Decimal Number System

• M= minuend = 72532

• N = subtrahend = 3250• Perform M-N• Case (i) M>N is to be applied

M= 72532 M= 72532N = 03250 10’s complement N = 96750

--_______ +_______

69282 169282

Page 59: Chapter 1 Ppt

For Decimal Number System

So case (ii) : M<NM = 03250 M = 03250N = 72532 N = 27468

-______ +_____

-69282 30718

Page 60: Chapter 1 Ppt

For Binary Number System

• M= minuend = 1010100• N = subtrahend = 1000011• Perform M-N• Case (i) M>N is to be applied

M= 1010100 M= 1010100N = 1000011 2’s complement N = 0111101

-- _________ +_________ 0010001 10010001

Page 61: Chapter 1 Ppt

For Binary Number System

So case (ii) : M<NM = 1000011 M = 1000011N = 1010100 N = 0101100

-_______ +________

- 0010001 1 1 0 1 1 1 1

Final Answer = - ( 2’s complement of 1101111) = - ( 0010001)₂

Page 62: Chapter 1 Ppt

Signed- Binary Numbers

• “+ve” sign indicates a positive number• “-ve” sign indicates a negative number• Digital Circuits can understand only two

numbers 0 & 1• Hence to indicate the sign, an additional

bit is placed as the most significant bit.• 0 represents a +ve number• 1 represents a –ve number

• “+ve” sign indicates a positive number• “-ve” sign indicates a negative number• Digital Circuits can understand only two

numbers 0 & 1• Hence to indicate the sign, an additional

bit is placed as the most significant bit.• 0 represents a +ve number• 1 represents a –ve number

Page 63: Chapter 1 Ppt

Signed- Binary Numbers

Consider an 8 bit number (01000100)₂

MSB of this no. is 0 which represents a +ve sign i.e., a positive number

Its equivalent is (01000100)₂ = (+68)10

Consider another number (11000100)₂

MSB of this no. is 1 which represents –ve sign i.e., a negative number

Its equivalent is (11000100)₂ = (-68)10

Page 64: Chapter 1 Ppt

Signed- Binary Numbers

(101100)₂ =

MSB = 1 -ve number Magnitude =

(01100) = (12)₂ 10

Answer = Sign & Magnitude = (-12)10

Page 65: Chapter 1 Ppt

Signed- Binary Numbers

(0111)₂ =

MSB = 0 +ve number Magnitude =

(111) = ( 7 )₂ 10

Answer = Sign & Magnitude = ( +7 )10

Page 66: Chapter 1 Ppt

Signed- Binary Numbers1’s Complement representation

Also called Signed Complement representation

i.e., Sign + Complement

( 0101 )₂ = (+5)10

( 1010 )₂ = ( -5 )10 in 1’s complement form

( 01000 )₂ = (+8)10

( 10111 )₂ = ( -8 )10 in 1’s complement form

Page 67: Chapter 1 Ppt

Signed- Binary Numbers2’s Complement representation

Also called Signed 2’s Complement representation

i.e., Sign + 2’s Complement of magnitude

( 0101 )₂ = (+5)10

( 1011 )₂ = ( -5 )10 in 2’s complement form

( 01000 )₂ = (+8)10

( 11000)₂ = ( -8 )10 in 2’s complement form

Page 68: Chapter 1 Ppt

Signed Decimal Numbers

Signed Magnitude Signed 1’s complement

Signed 2’s complement

(+7) 0111 0111 0111

(+6) 0110 0110 0110

(+5) 0101 0101 0101

(+4) 0100 0100 0100

(+3) 0011 0011 0011

(+2) 0010 0010 0010

(+1) 0001 0001 0001

(+0) 0000 0000 0000

(-0) 1000 1111 --

(-1) 1001 1110 1111

(-2) 1010 1101 1110

(-3) 1011 1100 1101

(-4) 1100 1011 1100

(-5) 1101 1010 1011

(-6) 1110 1001 1010

(-7) 1111 1000 1001

(-8) -- -- 1000

Page 69: Chapter 1 Ppt

Addition of 2 signed numbers

+ 6 00000110 +13 00001101 - - - - - -

- - - - - - - - - - - - - - - - - - - +19 00010011

- 6 11111010 +13 00001101 ------ ------------------- +19 00000111

- 6 11111010 -13 11110011 ------ ------------------- +19 11101101

+ 6 00000110 -13 11110011 ------ ------------------- +19 11111001

Page 70: Chapter 1 Ppt

Subtraction of 2 signed numbers

• (+ A) – (+B) = (+ A) + (-B)• (+ A) – (-B) = (+ A) + (+B)

Page 71: Chapter 1 Ppt

Overflow, Signed Integers

• As has been shown, when numbers are treated as signed integers, a “carry” of 1 from the addition of the most significant bits DOES NOT indicate an overflow, 3 00011+ (-3) +11101= 0 = 00000, with a carry of “1”

• For signed integers, overflow occurs when:

• The addition of two positive numbers results in a negative number, orThe addition of two negative numbers results in a positive number

Page 72: Chapter 1 Ppt

Overflow Examples• In a 6-bit register

+ 17 = 010001+ 16 = +010000

=100001100001 = - (011110 + 1) = - 011111 = -31

• In an 8-bit register- 100 = - (0110 0100) = 1001 1011 +1 = 1001 1100- 50 = - (0011 0010) = 1100 1101 +1 = 1100 1110

= 0110 10100110 1010 = 6A16=6*16 + 10 = +106

Page 73: Chapter 1 Ppt

Range of a numberOverflow during addition

• A fixed-length register can only hold a Range of numbers

• For a 4-bit device, the range of positive integers is 0 - 15

• For an 8-bit device the range of positive integers is 0 - 255

• When adding positive integers, Overflow occurs when the sum falls outside the range of the register

Page 74: Chapter 1 Ppt

Overflow Summary

• For positive integers, overflow occurs when the carry from addition of the leftmost bits is a “1”

• For signed integers, overflow occurs when either

The addition of two negative numbers gives a positive number, or

The addition of two positive numbers gives a negative number.

Page 75: Chapter 1 Ppt

Binary Codes

Codes

Weighted

Non-weighted

Page 76: Chapter 1 Ppt

Weighted Codes

• BCD (8421) • (2421)• (5421)• (63-1-1)• (7421)

• N= w₃a₃ + w₂a₂ + w₁a₁

Page 77: Chapter 1 Ppt

BINARY CODES

• Most compatible system for a computer or a digital system is binary system

• Most of the users are accustomed to decimal number system

• To reduce this gap, decimal numbers are converted to binary, arithmetic calculations are performed in binary, and then converted back to decimal.

Page 78: Chapter 1 Ppt

BINARY CODES• Code is a symbolic representation of an

information transform

• During this process, we need to store decimal numbers in computer for performing conversion

• But computers accept only digits 0s & 1s

• So, we must represent these decimal digits by means of a code consisting of 0s & 1s.

• Arithmetic operations can be directly performed with decimal numbers when they are stored in computer in coded from.

Page 79: Chapter 1 Ppt

BCD Code

• In simplest form of binary code, each decimal digit is represented by its binary equivalent.

8 5 4 . 7 9 2

1000 0101 0100 0111 1001 0010

Page 80: Chapter 1 Ppt

Representation of BCD Code

( 3 4 5 )10 = ( 0011 0100 0101)BCD

= ( 101011001 )₂

( 1 5 7 )10 = ( 0001 0101 0111 )₂

BCD representation – 12 bits – denotes a decimal number

Binary value – 8 bits – denotes binary value itself

Page 81: Chapter 1 Ppt

BCD Addition

1 8 4 0001 1000 0100 + 5 7 6 0101 01 1 1 01 10 ---------- ---------------------- 7 6 0 0 111 10000 1010 0 11 0 0110

----------------------- 0 111 0110 0000

Page 82: Chapter 1 Ppt

Non-Weighted Codes

• Excess – 3 code• Gray code• 2 out of 5 code• Biquinary code

Page 83: Chapter 1 Ppt

Excess-3 code

Page 84: Chapter 1 Ppt

Gray Codes

The property of this code is that the successive decimal digits differ in exactly one bit.

Page 85: Chapter 1 Ppt

Conversion from Binary to Gray

Page 86: Chapter 1 Ppt

Conversion of Gray to Binary

Page 87: Chapter 1 Ppt

Alpha numeric codes

• ASCII code• EBCDIC code

Page 88: Chapter 1 Ppt
Page 89: Chapter 1 Ppt
Page 90: Chapter 1 Ppt

Binary Storage & Registers

Page 91: Chapter 1 Ppt

Register Transfer

Page 92: Chapter 1 Ppt

Logical Operation in Registers

Page 93: Chapter 1 Ppt

Binary Logic