digital circuit and logic design i · panupong sornkhom, 2005/2 6 course description...
Post on 23-Mar-2020
4 Views
Preview:
TRANSCRIPT
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
Introduction
Panupong Sornkhom, 2005/2 4
1. Course characteristic
InstructorCourse descriptionCourse objectivesRecommended text booksCourse scheduleEvaluationAgreements
Panupong Sornkhom, 2005/2 5
Instructor
Panupong SornkhomDepartment of Electrical and Computer EngineeringFaculty of EngineeringNaresuan University
Office room EE213Office hours Monday 13.00 – 14.00
Saturday 10.00 – 12.00Telephone 01-2830195Website http://www.panupong.url40.netEmail panupongsk@hotmail.com
Panupong Sornkhom, 2005/2 6
Course description
ทฤษฎีเบื้องตนของวงจรสวิทชิ่ง พีชคณิตแบบบูลลีน รหัสคอมพิวเตอร การตรวจสอบความผดิพลาด ตารางความจริง วิธีลดรูปสมการแบบบูลลีน และ วงจรตรรกะชนิดตาง ๆ มัลติเพลกเซอร ดีมัลติเพลกเซอร วงจรเขารหัสและถอดรหัส วงจรบวกลบ วงจรเชิงลําดับ ฟลิปฟลอบ วงจรนับ เรจิสเตอร
Panupong Sornkhom, 2005/2 7
Course objectives
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.
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
NoteTopicWeek
Panupong Sornkhom, 2005/2 10
Course schedule (cont.)
HW12 dueQuiz06
Term projects presentation15
Term project dueFinal exam16
HW11 dueHW12 announce
Term projects presentation 14
HW10 dueQuiz05HW11 announced
Registers13
HW09 dueHW10 announced
Counters12
HW08 dueQuiz04HW09 announced
Sequential circuit design example11
HW07 dueHW08 announce
Sequential logic design principles (2)10
HW07 announcedTerm project announced
Sequential logic design principles (1)9
NoteTopicWeek
Panupong Sornkhom, 2005/2 11
Evaluation
Score weightingQuiz/Homework 20%Midterm exam 20%Final exam 30%Term project 15%Laboratory 15%
Grading policies< 40% F>= 40% grading by statistical distribution
Panupong Sornkhom, 2005/2 12
Agreements
การสงงานตองสงกับผูสอนโดยตรงในชั้นเรยีน หรือ ที่หองทํางานของผูสอนเทานั้น
สงงานชา 5 นาที ตัดคะแนน 10% ของคะแนนเต็มของงานนั้นสงงานชาเกินกวา 5 นาที แตไมเกิน 1 วัน ตัดคะแนน 20% ของคะแนนเต็มของงานนั้นสงงานชาเกินกวา 1 วัน แตไมเกิน 1 สัปดาห ตดัคะแนน 50% ของคะแนนเต็มของงานนั้น
Panupong Sornkhom, 2005/2 13
Agreements (cont.)
งานทกุชิ้น จะตองทําดวยตนเองเทานั้น หากเปนงานที่ตองมีการคนควาและเรยีบเรยีงขอมูลตองระบุเอกสารอางอิงทุกครั้ง
ถาพบวามกีารลอกกันครั้งแรก จะปรับคะแนนของงานนั้นทั้งหมดเปนศูนย และผูสอนจะแจงใหทราบถาพบวามกีารลอกกันครั้งที่สอง จะปรับตกในรายวิชานี้ทันที และ ผูสอนจะแจงใหทราบ
Panupong Sornkhom, 2005/2 14
Agreements (cont.)
ในการสอบ ทั้งสอบยอย สอบกลางภาค และ สอบปลายภาค จะตองไมมีการทุจริตสอบ ซึ่งพฤติกรรมตอไปนี้จะถือวาทุจริตสอบ
ชําเลืองมองคําตอบผูอื่นหรอืปรึกษากันมีบันทึกเนื้อหาของรายวชิาไมวาจะในรูปแบบใด ๆ อยูกับตัวในขณะสอบ โดยไมไดรับอนุญาตใชเครือ่งมือสือ่สารขณะสอบลุกออกจากที่นั่งขณะทาํการสอบ ละเมิดกฏ/ขอปฏบิัติในการสอบ ตามประกาศของมหาวิทยาลัย
หากพบการทุจริตในระหวางการสอบ ปรับตกในรายวิชานี้ทันที และสงเรื่องใหทางคณะพิจารณาโทษหากตรวจพบการทุจริตในระหวางการตรวจขอสอบ ผูสอนจะทําการสอบสวนและหากพบวามีการทุจริตจริง ปรับตกในรายวิชานี้ทันที และสงเรื่องใหทางคณะพิจารณาโทษ
Panupong Sornkhom, 2005/2 15
Agreements (cont.)
เมื่อมีการประกาศคะแนนหรือเกรด หากพบวามีขอผิดพลาดในการใหคะแนนหรือเกรด สามารถมาตรวจสอบไดกับผูสอนภายใน 3 วันหลังจากประกาศ หลังจากนีจ้ะถือวาคะแนนหรอืเกรดนั้นเปนที่ยอมรับและจะไมมีการแกไขใด ๆ อีก
Panupong Sornkhom, 2005/2 16
2. Digital system versus Analog system
DefinitionAnalog system process continuous range signalDigital system process discrete value signal
time
value
Panupong Sornkhom, 2005/2 17
2. Digital system versus Analog system (cont.)
ApplicationsStill picture recordingAudio/Video recordingTelephone system
Panupong Sornkhom, 2005/2 18
2. Digital system versus Analog system (cont.)
Why every products becoming digitalFlexibilityReliabilitySpeedCost
Panupong Sornkhom, 2005/2 19
3. Digital devices
Logic gatesAND gateOR gateNOT gateNAND gateNOR gateXOR gate
Panupong Sornkhom, 2005/2 20
3. Digital devices (cont.)
Flip-flopsD flip-flopJK flip-flopRS flip-flop
Q
QSET
CLR
D J
Q
Q
K
SET
CLR Q
QSET
CLR
S
R
Panupong Sornkhom, 2005/2 21
4. Integrated Circuit
Integrated Circuit (IC) A collection of one or more gates fabricated on a single silicon chip
* Picture from http://www.tiscali.co.uk/reference/encyclopaedia/hutchinson/m0030289.html
Panupong Sornkhom, 2005/2 22
4. Integrated Circuit (cont.)
Scales of ICSmall-scale integration (SSI)
1-20 gatesBasic building block (gates, flip-flop)
Medium-scale integration (MSI)
20 – 200 gatesFunctional building block (decoder, register , counter)
Large-scale integration (LSI)
200 – 200,000 gates or moreSmall memories, microprocessors, programmable logic devices (PLD), custom devices
Very large-scale integration (VLSI)
More than 1,000,000 transistors
Number system and Codes (1)
Panupong Sornkhom, 2005/2 24
1. Number system and conversion
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
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
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
Panupong Sornkhom, 2005/2 28
1. Number system and conversion (cont.)
Positional number system (cont.)
F17111115771117
E16111014661106
D15110113551015
C14110012441004
B1310111133113
A1210101022102
911100191111
810100080000
HexadecimalOctalBinaryDecimalHexadecimalOctalBinaryDecimal
Panupong Sornkhom, 2005/2 29
1. Number system and conversion (cont.)
ConversionsConvert from radix r to decimal value
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
Panupong Sornkhom, 2005/2 31
1. Number system and conversion (cont.)
Conversions (cont.)Example
Convert 17910 to binary number179/2 = 89 remainder 1 (LSB)89/2 = 44 remainder 144/2 = 22 remainder 022/2 = 11 remainder 011/2 = 5 remainder 15/2 = 2 remainder 12/2 = 1 remainder 01/2 = 0 remainder 1 (MSB)Thus 17910 = 101100112
Panupong Sornkhom, 2005/2 32
1. Number system and conversion (cont.)
Conversions (cont.)Example
Convert 46710 to octal number
467/8 = 58 remainder 3 (Least significant digit)58/8 = 7 remainder 27/8 = 0 remainder 7
(Most significant digit)Thus 46710 = 7238
Convert 0.13210 to octal number
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
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
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
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.
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
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.
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
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
Panupong Sornkhom, 2005/2 46
3. Representation of negative numbers (cont.)
Decimal and 4-bit numbers
- / -1000/ -- / --8/+8
1000/01111001/01111111/0111-7/+7
1001/01101010/01101110/0110-6/+6
1010/01011011/01011101/0101-5/+5
1011/01001100/01001100/0100-4/+4
1100/00111101/00111011/0011-3/+31101/00101110/00101010/0010-2/+2
1110/00011111/00011001/0001-1/+1
1111/0000- / 00001000/0000-0/+0
One’s complement
Two’s complement
Signed magnitudeDecimal
top related