Digital logic circuits ppt

digital electronics combinational logic circuits ppt and combinational logic circuits examples pdf
Dr.DouglasPatton Profile Pic
Dr.DouglasPatton,United States,Teacher
Published Date:26-07-2017
Your Website URL(Optional)
Comment
Digital Logic Circuits Binary Arithmetic Fall 2015, Aug 19 . . . www.ThesisScientist.com 1Digital Systems DIGITAL CIRCUITS Fall 2015, Aug 19 . . . www.ThesisScientist.com 2Why Binary Arithmetic? 3 + 5 = 8 0011 + 0101 = 1000 Fall 2015, Aug 19 . . . www.ThesisScientist.com 3Why Binary Arithmetic? • Hardware can only deal with binary digits, 0 and 1. • Must represent all numbers, integers or floating point, positive or negative, by binary digits, called bits. • Can devise electronic circuits to perform arithmetic operations: add, subtract, multiply and divide, on binary numbers. Fall 2015, Aug 19 . . . www.ThesisScientist.com 4Positive Integers • Decimal system: made of 10 digits, 0,1,2, . . . , 9 1 0 41 = 4×10 + 1×10 2 1 0 255 = 2×10 + 5×10 + 5×10 • Binary system: made of two digits, 0,1 7 6 5 4 00101001 = 0×2 + 0×2 + 1×2 + 0×2 3 2 1 0 +1×2 + 0×2 + 0×2 + 1×2 = 32 + 8 +1 = 41 11111111 = 255, largest number with 8 8 binary digits, 2 -1 Fall 2015, Aug 19 . . . www.ThesisScientist.com 5Base or Radix • For decimal system, 10 is called the base or radix. • Decimal 41 is also written as 41 or 41 10 ten • Base (radix) for binary system is 2. • Thus, 41 = 101001 or 101001 ten 2 two • Also, 111 = 1101111 ten two and 111 = 7 two ten • What about negative numbers? Fall 2015, Aug 19 . . . www.ThesisScientist.com 6Signed Magnitude – What Not to Do • Use fixed length binary representation • Use left-most bit (called most significant bit or MSB) for sign: 0 for positive 1 for negative • Example: +18 = 00010010 ten two –18 = 10010010 ten two Fall 2015, Aug 19 . . . www.ThesisScientist.com 7Difficulties with Signed Magnitude • Sign and magnitude bits should be differently treated in arithmetic operations. • Addition and subtraction require different logic circuits. • Overflow is difficult to detect. • “Zero” has two representations: + 0 = 00000000 ten two – 0 = 10000000 ten two • Signed-integers are not used in modern computers. Fall 2015, Aug 19 . . . www.ThesisScientist.com 8Problems with Finite Math • Finite size of representation: – Digital circuit cannot be arbitrarily large. – Overflow detection – easy to determine when the number becomes too large. 0000 0100 1000 1100 10000 10100 Infinite -4 0 4 8 12 16 20 -∞ ∞ universe of integers 4-bit numbers • Represent negative numbers: – Unique representation of 0. Fall 2015, Aug 19 . . . www.ThesisScientist.com 94-bit Universe 0000 0000 0001 1111 1111 0001 16/0 0 15 15 Modulo-16 -0 (4-bit) 1100 12 4 0100 1100 12 -3 4 0100 universe -7 7 7 8 8 0111 1000 1000 Only 16 integers: 0 through 15, or – 7 through 7 Fall 2015, Aug 19 . . . www.ThesisScientist.com 10One Way to Divide Universe 1’s Complement Numbers Binary number Decimal 0000 magnitude Positive Negative 1111 0001 0 15 0 0000 1111 -0 1100 12 -3 4 0100 1 0001 1110 2 0010 1101 -7 7 8 0111 3 0011 1100 1000 4 0100 1011 5 0101 1010 Negation rule: invert bits. 6 0110 1001 Problem: 0 ≠ – 0 7 0111 1000 Fall 2015, Aug 19 . . . www.ThesisScientist.com 11Another Way to Divide Universe 2’s Complement Numbers Binary number Decimal magnitude Positive Negative 0000 1111 0001 0 0 0000 15 -1 1 0001 1111 1100 12 -4 4 0100 2 0010 1110 Subtract 1 -8 7 3 0011 1101 8 on this side 0111 1000 4 0100 1100 5 0101 1011 Negation rule: invert bits and add 1 6 0110 1010 7 0111 1001 8 1000 Fall 2015, Aug 19 . . . www.ThesisScientist.com 12Integers With Sign – Two Ways • Use fixed-length representation, but no explicit sign bit: – 1’s complement: To form a negative number, complement each bit in the given number. – 2’s complement: To form a negative number, start with the given number, subtract one, and then complement each bit, or first complement each bit, and then add 1. • 2’s complement is the preferred representation. Fall 2015, Aug 19 . . . www.ThesisScientist.com 132’s-Complement Integers • Why not 1’s-complement? Don’t like two zeros. • Negation rule: • Subtract 1 and then invert bits, or • Invert bits and add 1 • Some properties: • Only one representation for 0 • Exactly as many positive numbers as negative numbers • Slight asymmetry – there is one negative number with no positive counterpart Fall 2015, Aug 19 . . . www.ThesisScientist.com 14General Method for Binary Integers with Sign • Select number (n) of bits in representation. n • Partition 2 integers into two sets: n • 00…0 through 01…1 are 2 /2 positive integers. n • 10…0 through 11…1 are 2 /2 negative integers. • Negation rule transforms negative to positive, and vice-versa: • Signed magnitude: invert MSB (most significant bit) n • 1’s complement: Subtract from 2 – 1 or 1…1 (same as “inverting all bits”) n • 2’s complement: Subtract from 2 or 10…0 (same as 1’s complement + 1) Fall 2015, Aug 19 . . . www.ThesisScientist.com 15Three Systems (n = 4) 10000 0000 0000 0000 1111 1111 1111 0 0010 0 0 – 7 – 0 2 – 1 6 – 6 6 – 2 7 7 7 – 5 1010 – 0 – 7 – 8 0111 1010 1010 0111 0111 1000 1000 1000 1010 = – 2 1010 = – 5 1010 = – 6 Signed magnitude 1’s complement integers 2’s complement integers Fall 2015, Aug 19 . . . www.ThesisScientist.com 16Three Representations Sign-magnitude 1’s complement 2’s complement 000 = +0 000 = +0 000 = +0 001 = +1 001 = +1 001 = +1 010 = +2 010 = +2 010 = +2 011 = +3 011 = +3 011 = +3 100 = - 0 100 = - 3 100 = - 4 101 = - 1 101 = - 2 101 = - 3 110 = - 2 110 = - 1 110 = - 2 111 = - 3 111 = - 0 111 = - 1 (Preferred) Fall 2015, Aug 19 . . . www.ThesisScientist.com 172’s Complement Numbers (n = 3) 0 000 subtraction addition -1 111 001 +1 010 +2 -2 110 011 +3 -3 101 Negation 100 - 4 Fall 2015, Aug 19 . . . www.ThesisScientist.com 182’s Complement n-bit Numbers n –1 n –1 • Range: – 2 through 2 – 1 • Unique zero: 00000000 . . . . . 0 • Negation rule: see slide 11 or 13. • Expansion of bit length: stretch the left-most bit all the way, e.g., 11111101 is still 101 or – 3. Also, 00000011 is same as 011 or 3. • Most significant bit (MSB) indicates sign. • Overflow rule: If two numbers with the same sign bit (both positive or both negative) are added, the overflow occurs if and only if the result has the opposite sign. • Subtraction rule: for A – B, add – B and A. Fall 2015, Aug 19 . . . www.ThesisScientist.com 19Summary • For a given number (n) of digits we have a finite 3 set of integers. For example, there are 10 = 3 1,000 decimal integers and 2 = 8 binary integers in 3-digit representations. n • We divide the finite set of integers 0, r – 1, where radix r = 10 or 2, into two equal parts representing positive and negative numbers. • Positive and negative numbers of equal magnitudes are complements of each other: x + complement (x) = 0. Fall 2015, Aug 19 . . . www.ThesisScientist.com 20

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.