1 Digital Circuit And Logic Design I Lecture 1 Panupong Sornkhom, 2005/2 2 Outline Introduction 1. Course characteristics 2. Digital system versus Analog system 3. Digital devices 4. Integrated Circuit (IC) Number Systems and Codes (1) 1. Number system and conversion 2. Addition and subtraction 3. Representation of negative numbers
23
Embed
Digital Circuit And Logic Design I - Naresuan University · Course objectives Understand process of digital system design Understand Boolean algebra and minimization method Can design
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
1
Digital Circuit And Logic Design I
Lecture 1
Panupong Sornkhom, 2005/2 2
Outline
Introduction1. Course characteristics2. Digital system versus Analog system3. Digital devices4. Integrated Circuit (IC)Number Systems and Codes (1)1. Number system and conversion2. Addition and subtraction3. Representation of negative numbers
2
Introduction
Panupong Sornkhom, 2005/2 4
1. Course characteristic
InstructorCourse descriptionCourse objectivesRecommended text booksCourse scheduleEvaluationAgreements
3
Panupong Sornkhom, 2005/2 5
Instructor
Panupong SornkhomDepartment of Electrical and Computer EngineeringFaculty of EngineeringNaresuan University
Understand process of digital system designUnderstand Boolean algebra and minimization methodCan design and implement digital system using combinational circuit and sequential circuit
Panupong Sornkhom, 2005/2 8
Recommended text books
1. John Wakerly, Digital Design Principles and Practices, Third edition, Prentice Hall.
2. Sajjan Shjiva, Introduction to Logic Design, Second edition, Macel Dekker.
3. Kenneth Breeding, Digital Design Fundamentals, Second edition, Prentice Hall.
4. Randy Katz, Contemporary logic design, Addison Wesley.
5
Panupong Sornkhom, 2005/2 9
Course schedule
HW06 dueQuiz03
Arithmetic circuits7
Midterm exam8
HW05 dueHW06 announce
Multiplexer, Demultiplexer, Encoder, and Decoder6
HW04 dueQuiz02HW05 announce
Combinational logic design example5
HW03 dueHW04 announced
Combinational logic design principles (2)4
HW02 dueQuiz01HW03 announced
Combinational logic design principles (1)3
HW01 dueHW02 announced
Number system and Codes (2)2
HW01 announcedIntroduction + Number system and Codes (1)1
Positional number systemEach digit position has weightValue = weighted sum of all digitsFor example, 2457 = 2x1000+4x100+5x10+7x1623.57 = 6x100+2x10+3x1+5x0.1+7x0.01In general, a number D of the form d1d0.d-1d-2 has the value D = d1x101+d0x100+d-1x10-1+d-2x10-2
In this case, 10 is called base or radix of the number system
13
Panupong Sornkhom, 2005/2 25
1. Number system and conversion (cont.)
Positional number system (cont.)In general positional number system, the radix is an integer r ≥ 2, and the digit in position i has weight ri
The general form is dp-1dp-2…d1d0.d-1d-2 …d-nwhere there are p digits to the left of the point and n digits to the right of the point, called radix pointThe value of the number is the sum of each digit multiplied by the corresponding power of the radix
Panupong Sornkhom, 2005/2 26
1. Number system and conversion (cont.)
Positional number system (cont.)The leftmost digit in such a number is called the high-order or most significant digit; the rightmost is the low-order or least significant digit.Digital circuits have signals that are normally in one of only two conditions – low or high, off or on.The signals in these circuits are interpreted to represent binary digits (or bits) that have one of two values. Thus, the binary radix is normally used to represent numbers in a digital system
14
Panupong Sornkhom, 2005/2 27
1. Number system and conversion (cont.)
Positional number system (cont.)The leftmost bit of a binary number is called the high-order or most significant bit (MSB); the rightmost is the low-order or least significant bit (LSB).Radix 10 use it in everyday businessRadix 2 use it in digital systemOther radices may be used in other purposes for example radices 8 and 16 used for shorthand representation of multibit numbers
Convert from decimal value (integer) to radix rDivide the value D by r the remainder is least significant digit in radix r number and the quotient will be divided by r againWe collect all remainder as digit in radix r numberThe last remainder is most significant digit
1pi
ii n
D d r−
=−
= ⋅∑
Panupong Sornkhom, 2005/2 30
1. Number system and conversion (cont.)
Conversions (cont.)Convert from decimal fraction to radix r
Multiply D by r then collect the integer part of result as a digit of answer and repeatedly multiply fraction part of result by ra terminating fraction in one base may not terminate in another
0.132 x 8 = 1.0560.056 x 8 = 0.4480.448 x 8 = 3.5840.584 x 8 = 4.6720.672 x 8 = 5.3760.376 x 8 = 3.0080.008 x 8 = 0.0640.064 x 8 = 0.5120.512 x 8 = 4.096
….Thus 0.13210 = 0.103453004…8
17
Panupong Sornkhom, 2005/2 33
2. Addition and Subtraction
ConceptAddition and subtraction of nondecimal numbers by hand uses the same technique that we use in decimal numbers
Addition uses carry in and carry out
1111110110
1001101010
1010101100
0100100000
Carry out
SumYXCarry in
Carry out
SumYXCarry in
Addition table including carries
Panupong Sornkhom, 2005/2 34
2. Addition and Subtraction
Concept (cont.)4 bit adder
18
Panupong Sornkhom, 2005/2 35
2. Addition and Subtraction (cont.)
Concept (cont.)Subtraction uses borrow in and borrow out
1111100110
0001101010
1010111100
1100100000
Borrow out
DiffYXBorrow in
Borrow out
DiffYXBorrow in
Subtraction table including borrows
Panupong Sornkhom, 2005/2 36
2. Addition and Subtraction
Concept (cont.)4 bit subtracter
19
Panupong Sornkhom, 2005/2 37
2. Addition and Subtraction (cont.)
Example
Panupong Sornkhom, 2005/2 38
3. Representation of negative numbers
Signed-Magnitude representationUsing extra bit position (MSB) to represent the sign
0 = plus (+)1 = minus (-)
The rest bits represent magnitude of the numbern-bit signed-magnitude system represent number from –(2n-1-1) to +(2n-1-1) and there are two possible representations of zero.
20
Panupong Sornkhom, 2005/2 39
3. Representation of negative numbers (cont.)
Signed-Magnitude representation (cont.)The sign and magnitude portions are handled separately in arithmetic using signed-magnitude number.Signed-magnitude addition
If the signs are the same, add the magnitude and give the result the same signElse compare the magnitude, subtract the smaller from the larger and give the result the sign of the larger
Signed-magnitude subtractionChange the sign of the subtrahend and pass it to adder
Panupong Sornkhom, 2005/2 40
3. Representation of negative numbers (cont.)
Complement number systemsRadix-complement representation
The radix-complement of n-digit number N in radix r-N = rn – NDecimal number Ten’s complementBinary number Two’s complement
Diminished radix-complement representationThe diminished radix-complement of n-digit number N in radix r
-N = rn - N – 1Decimal number Nine’s complementBinary number One’s complement
21
Panupong Sornkhom, 2005/2 41
3. Representation of negative numbers (cont.)
Complement number systems (cont.)Two’s complement
Complement of n-bit number N in two’s complement is computed by using the method below
Complement each bit (change 0 to 1 and 1 to 0)Then add 1 to the LSB
The MSB of a number represents sign bit0 = plus1 = minus
n-bit two’s-complement system represent number from –(2n-1) to +(2n-1-1) and there are only one representation of zero (positive zero)
Panupong Sornkhom, 2005/2 42
3. Representation of negative numbers (cont.)
Complement number systems (cont.)Two’s complement (cont.)
Two’s complement additionUses ordinary binary addition, ignoring any carries beyond the MSB. The result will always be the correct sum as long as the range of the number system is not exceeded.If an addition operation produces a result that exceeds the range of the number system, overflow is said to occurAddition of two numbers with different signs can never produce overflowA simple rule for detecting overflow in addition is checking that if the signs of the addends are the same and the sign of the sum isdifferent from the addends’ sign.
22
Panupong Sornkhom, 2005/2 43
3. Representation of negative numbers (cont.)
Complement number systems (cont.)Two’s complement (cont.)
Two’s complement subtractionNegate the subtrahend by taking its two’s complementThen add it to the minuend using the normal rules for additionHowever, an attempt to negate the extra negative number results in overflow, for example, 10002 = -8 but its two’s complement is not equal to +8 because overflow occurs when represent +8 in 4-bit two’s complement number.The extra negative number can still be used in additions and subtractions as long as the final result does not exceed the number range
Panupong Sornkhom, 2005/2 44
3. Representation of negative numbers (cont.)
Complement number systems (cont.)One’s complement
Complement of n-bit number N in one’s complement is computed by using the method below
Complement each bit (change 0 to 1 and 1 to 0)The MSB of a number represents sign bit
0 = plus1 = minus
n-bit one’s-complement system represent number from –(2n-1-1) to +(2n-1-1) and there are two representation of zero
23
Panupong Sornkhom, 2005/2 45
3. Representation of negative numbers (cont.)
Complement number systems (cont.)One’s complement (cont.)
One’s complement additionUse ordinary binary addition then add the result with carry out of MSB, this rule is called end-around carryThe overflow detection can perform as in two’s complement system
One’s complement subtractionNegate the subtrahend by taking its one’s complementThen add it to the minuend using the normal rules for addition