Complements-Digital Logic Design-Lecture Slides, Slides of Digital Logic Design and Programming

This course includes logic operators, gates, combinational and sequential circuits are studied along with their constituent elements comprising adders, decoders, encoders, multiplexers, as well as latches, flip-flops, counters and registers. This lecture includes: Complements, Binary, Numbers, Significant, Bit, Base, Arithmetic, Rules, Suntraction, Carry, Borrow, Radix, Diminished

Typology: Slides

2011/2012

Uploaded on 08/07/2012

anjushree
anjushree ๐Ÿ‡ฎ๐Ÿ‡ณ

4.4

(54)

147 documents

1 / 14

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Understanding Binary Numbers
๏‚—โ€ฏMSB โ€“ most significant bit
๏‚—โ€ฏLSB โ€“ least significant bit
๏‚—โ€ฏBit numbering
๏‚—โ€ฏEach digit (bit) is either 1 or 0
๏‚—โ€ฏEach bit represents a power of 2
015
1 0 1 1 0 0 1 0 1 0 0 1 1 1 0 0
MSB LSB
1 1 1 1 1 1 1 1
2726252423222120
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Complements-Digital Logic Design-Lecture Slides and more Slides Digital Logic Design and Programming in PDF only on Docsity!

Understanding Binary Numbers

๏‚— MSB โ€“ most significant bit

๏‚— LSB โ€“ least significant bit

๏‚— Bit numbering

๏‚— Each digit (bit) is either 1 or 0

๏‚— Each bit represents a power of 2

15 0 1 0 1 1 0 0 1 0 1 0 0 1 1 1 0 0 MSB LSB 1 1 1 1 1 1 1 1 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0

Base-r Arithmetic

๏‚— Arithmetic operations with numbers in base r follow

the same rules as for decimal numbers.

๏‚— When a base other than 10 is used, one must

remember to use only the r-allowable digits.

๏‚— The following are some examples:

Binary Addition

Given two binary digits (X,Y), a carry in (Z) we get the following sum (S) and carry (C): Carry in (Z) of 0: Carry in (Z) of 1:

Z 1 1 1 1

X 0 0 1 1

+ Y + 0 + 1 + 0 + 1

C S 0 1 1 0 1 0 1 1

Z 0 0 0 0

X 0 0 1 1

+ Y + 0 + 1 + 0 + 1

C S 0 0 0 1 0 1 1 0

Binary Addition Examples

carries

Complements

๏‚— Complements are used to simplify subtraction

operations. We do subtraction by adding. A โ€“ B = A+ (-B)

๏‚— There are two types:

๏‚— The radix complement, called the rโ€™s complement. ๏‚— The diminished radix complement, called the (r-1)โ€™s complement.

Diminished Radix

Complement (DRC)

๏‚— Given a number N in base r having n digits, the (r-1)โ€™s complement of N is defined as: (r n

    1. โ€“ N ๏‚— Decimal numbers are in base-10. (r-1) = (10-1) = 9. ๏‚— The 9โ€™s complement would be defined as: ( n
    1. โ€“ N ๏‚— So, to determine the 9โ€™s complement of 52: ( 2
    1. โ€“ 52 = 47 ๏‚— Another example is to determine the 9โ€™s complement of 3124: ( 4
    1. โ€“ 3124 = 6875

DRC for Binary Numbers

๏‚— For binary numbers r = 2 and (r-1) = 1. So, the 1โ€™s complement would be defined as: ( n

    1. โ€“ N ๏‚— To determine the 1โ€™s complement of 1000101: ( 7
    1. โ€“ 1000101 = 0111010 ๏‚— To determine the 1โ€™s complement of 11110111101: ( 11
      • 11110111101 = 00001000010 ๏‚— Note that 1โ€™s complement can be done by switching all 0โ€™s to 1โ€™s and 1โ€™s to 0โ€™s.

Radix Complement

๏‚— The rโ€™s complement of an n-digit number N in base-r is defined as: r n

  • N - for N โ‰  0 0 - for N = 0 ๏‚— We may obtain rโ€™s complement by adding 1 to (r-1)โ€™s complement. Since r n
  • N = [(r n
    1. โ€“ N]+ ๏‚— 10 โ€™s complement of 3229 is: 10 4
  • 3229 = 6771 ๏‚— 2 โ€™s complement of 101101 is: 2 6
  • 101101 = 010011 ๏‚— Note that to determine 2โ€™s complement, leave the least significant 0โ€™s and the first 1 unchanged and then switch the remaining 1โ€™s to 0โ€™ and 0โ€™s to 1โ€™s.

Notes on Complements

๏‚— A couple of notes on complements to keep in mind:

๏‚— If you are trying to determine the complement of a value that contains a radix point: ๏‚— Remove the radix point. ๏‚— Determine the complement. ๏‚— Replace the radix point in the same relative position. ๏‚— The complement of a complement will restore the original number.

The End