Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digital Logic Design Lecture # 2 University of Tehran.

Similar presentations


Presentation on theme: "Digital Logic Design Lecture # 2 University of Tehran."— Presentation transcript:

1 Digital Logic Design Lecture # 2 University of Tehran

2 Outline Design Flow Transistors and Switches NMOS PMOS Number Systems Binary System Sign and Magnitude System 2’s Complement System

3 Design Flow

4 Design Flow (continued…) When designing a digital system, partitioning of the whole comes first. While doing so we run into so called sub-systems of our main system which are simpler definition-wise. Considering the figure shown in the latter slide our design procedure which is normally a Top-Down procedure, starts by dividing the digital system needed down to components we already have and/or if a component that has not yet been designed is reached, we move lower into the levels of design until we have all needed parts.

5 Design Follow (continued…) Implementation being the procedure of putting together smaller parts in order to form what is needed is a Bottom-Up procedure. In the process of design, we would have a very hard and almost impossible job if we were to put together -for all essential components- their transistors and wire them together. Hence we consider a few modules with a more defined application in order to decrease the labor in this repetitive task.

6 Design Follow (continued…) The first set of modules would be gates, now instead of having a million transistors we have only 200’000 to 300’000 gates. Making meaningful structures helps a designer who reached such a package in his/her process not to go any further. A decrease in component variation is seen as we sink deeper in the design level. We only have 2 types of transistors, while 30 to 40 types of components can be recognized.

7 Design Follow (continued…) Even in high levels of design, a designer may need to work with transistors or gates at some levels of his work. In comparison with building a house by putting together built blocks and connecting them with bricks, this can be called glue logic.

8 Transistors and Switches Transistors can be simply defined as on-off switches. In the CMOS technology we have 2 main types of transistors: NMOS and PMOS.

9 Transistors and Switches (continued…) The only thing that concerns us here is whether or not the transistor conducts at a special instance The NMOS type conducts when a ‘1’ logic value is fed to it’s gate input while the same happens for a PMOS type when a ‘0’ logic value is fed Because of the transistors-being our building bricks- has 2 states, we will have to be working in base 2.

10 Number Systems Binary Sign and Magnitude 2’s Complement

11 Binary System Weight of each position in the Binary System:

12 Binary System (continued…) Conversion of a binary number to it’s equivalent decimal number: As shown in the latter slide, each position has a weight which is multiplied by the 0 or 1 in that position. The sum of the products is equal to the equivalent decimal number. Example: (1011) 2 =1*2 0 +1*2 1 +0*2 2 +1*2 3 =(11) 10

13 Binary System (continued…) Conversion of a decimal number to it’s equivalent binary number: For this conversion, we attempt to subtract each weight from the left most digit in order to find the decimal number equivalent in binary. Another procedure for this conversion is multiple divisions and collecting the remainders, the first digit resulted is the nearest digit to the binary point. Example:

14 Binary System (continued…) A decimal number can also consist of an integer and a fractional part, which sum up to make the whole number. Example: (29.61) 10 =(?) 2 (29) 10 = 1*2 4 + 1*2 3 + 1*2 2 + 0*2 1 + 1*2 0 =(11101) 2 (0.61) 10 = 1*2 -1 + 0*2 -2 + 0*2 -3 + 1*2 -4 + 1*2 -5 + 1*2 -6 =(0.100111) 2

15 Binary System (continued…) Another way is to use multiplication to find the fractional part. Example: The integer part can be exactly found whereas the fractional part may not. In such a case we should find three binary digits to represent each decimal digit to maintain accuracy.

16 Binary System (continued…) In our usage of the binary number system-although we are benefiting because of it’s relativity to transistors-some problems such as those seen in data transmission can occur. This where the use of hexadecimal and octal number systems is considered useful. To do conversions from base 2 to base 8(16), each 3(4) bits in base 2 must be converted into it’s equivalent in base 8(16). Example:

17 Binary System (continued…) Binary Arithmetic: Summing numbers in base 2 can be considered the same as decimal summing (The same rules apply to summing in base 8 and 16). The main problems can occur when doing subtractions. But even in this case the borrowing is just as it is in decimal numbers. Example:

18 Sign and Magnitude System Our need for negative number is obvious in arithmetic, because of this need and considering the fact that in base 2 we can use nothing but 0s and 1s for our representations, we define the left-most digit as the number’s sign digit. The definition constructs the Sign and Magnitude representation of numbers. In this representation all digits except the left-most construct the magnitude of the number, while the left-most digit being 1 shows that the number is negative or positive otherwise.

19 Sign and Magnitude System (continued…) The main problem remaining in this system and it’s arithmetic, is that we have to use 2 completely different algorithms and thus 2 completely different circuits for addition and subtraction.

20 2’s Complement System With another look at the arithmetic in our decimal number system: We have reached our aim which was finding a new way of subtraction with the same steps as addition. And we have done it through eliminating the borrowing procedure.

21 2’s Complement System (continued…) We have actually found a new way to negate 37 and that is the result of subtracting it from 99 and adding 1 to it. The same steps can be applied to the binary number system: This representation for negative numbers is used in the 2’s Complement System.

22 2’s Complement System (continued…) 2’s complementing a number is consisted of complementing it and then adding 1. The same rule as the sign and magnitude representation for distinguishing positive numbers from negative ones applies in the 2’s complement system. In the 2’s complement system, the positive numbers have the same form as they have in the sign and magnitude system.

23 2’s Complement System (continued…) 2’s complementing a negative number is performed as starting from the right-most digit until the first ‘1’ is reached and then complementing the rest of the digits. Addition Example: Subtraction Example:


Download ppt "Digital Logic Design Lecture # 2 University of Tehran."

Similar presentations


Ads by Google