Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 EGR 277 – Digital Logic Syllabus Office Hours No food or drinks in the classrooms Web page (demonstration) Lecture #1 EGR 277 – Digital Logic Reading.

Similar presentations


Presentation on theme: "1 EGR 277 – Digital Logic Syllabus Office Hours No food or drinks in the classrooms Web page (demonstration) Lecture #1 EGR 277 – Digital Logic Reading."— Presentation transcript:

1 1 EGR 277 – Digital Logic Syllabus Office Hours No food or drinks in the classrooms Web page (demonstration) Lecture #1 EGR 277 – Digital Logic Reading Assignment: Chapter 1 in Digital Design, 3 rd Edition by Mano Digital System – a system that works with discrete elements of information (a set of symbols) rather than with continuous signals as in an analog system. This discrete information is represented in binary form. Data processing is carried out by means of binary logic elements using binary signals. Quantities are stored in binary storage elements (memory).

2 2 Lecture #1 EGR 277 – Digital Logic Digital System – a system that works with discrete elements of information (a set of symbols) rather than with continuous signals as in an analog system. This discrete information is represented in binary form. Data processing is carried out by means of binary logic elements using binary signals. Quantities are stored in binary storage elements (memory). Illustration: Chapter 1 – Binary Systems

3 3 Lecture #1 EGR 277 – Digital Logic 1. Decimal Numbers Base = 10, ten unique digits: (0,1,2,3,4,5,6,7,8,9), place values, counting sequence, examples, LSD and MSD Number Systems 2. Binary Numbers Base = 2, two unique digits: (0 and 1), binary digit = “bit”, place values, counting sequence, examples, LSB and MSB

4 4 Lecture #1 EGR 277 – Digital Logic 3. Octal Numbers Base = 8, eight unique digits: (0,1,2,3,4,5,6,7), place values, counting sequence, examples, LSD and MSD Number Systems 4. Hexadecimal Numbers Base = 16, sixteen unique digits: (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F), binary digit = “bit”, place values, counting sequence, examples, LSB and MSB

5 5 Lecture #1 EGR 277 – Digital Logic Arithmetic operations in other bases are very similar to the familiar operations that we have always used in base 10. Arithmetic Operations Examples: (of addition, subtraction, and multiplications in various bases)

6 6 Lecture #1 EGR 277 – Digital Logic Converting Between Bases Examples: 1. Converting to decimal: expand by place value as previously seen 2. Converting from decimal: A. For the integer portion: Use repeated division by the base (LSD is found first) B. For the fractional portion: Use repeated multiplication by the base (MSD is found first).

7 7 Lecture #1 EGR 277 – Digital Logic 3.Converting between binary, octal, and hexadecimal – simple replacement A) Binary to octal Examples: B) Binary to hexadecimal Examples:

8 8 Lecture #1 EGR 277 – Digital Logic Complements Complements are commonly used to represent negative numbers and to perform subtraction. There are two types of complements which can be applied to any base: GeneralBase 2Base 10 (r-1)’s complement1’s complement9’s complement r’s complement2’s complement10’s complement Where r = base And a general number X might consist of the digits X = aaaaaaa.bbb n = number of digits before the decimal point m = number of digits after the decimal point Formal definitions: (r-1)’s complement of X = r n – r -m – X ( = r n –1-X if m = 0) r’s complement of X = r n – X = (r-1)’s complement + r -m (= (r-1)’s complement + 1 if m = 0)

9 9 Lecture #1 EGR 277 – Digital Logic Shortcut approach to finding complements: 9’s comp: subtract each digit from 9 10’s comp: 9’s comp + 1 if m = 0 1’s comp: replace each 0 with 1 and replace each 1 with 0 2’s comp: 1’s comp + 1 if m = 0 2’s comp (alternate method): Move from the right until the first 1 is encountered. Complement each bit after (but not including) this 1. Examples:

10 10 Lecture #1 EGR 277 – Digital Logic Representing negative numbers in 2’s complement form: Negative numbers are typically represented in 2’s complement form in computers or other digital systems. Example: int variables in C++ are represented using two bytes, where the MSB is a sign bit. If the MSB = 1, the number is negative and in 2’s complement form. 1)What are the max and min values that can be stored? 2)What happens when an overflow occurs? (Show a sample program)

11 11 Lecture #1 EGR 277 – Digital Logic Subtraction using r’s complement: A complement can be used to represent a negative value. It is difficult for a computer to subtract, but relatively simple to add and to find complements. Therefore, it is common to add a complement rather than to subtract. Examples:

12 12 Lecture #1 EGR 277 – Digital Logic Subtraction using (r-1)’s complement: Examples:


Download ppt "1 EGR 277 – Digital Logic Syllabus Office Hours No food or drinks in the classrooms Web page (demonstration) Lecture #1 EGR 277 – Digital Logic Reading."

Similar presentations


Ads by Google