Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dr. Nermin Hamza 1. Materials Book: Digital Design 4 th M. Morris Mano and Michael D. Ciletti 2.

Similar presentations


Presentation on theme: "Dr. Nermin Hamza 1. Materials Book: Digital Design 4 th M. Morris Mano and Michael D. Ciletti 2."— Presentation transcript:

1 Dr. Nermin Hamza 1

2 Materials Book: Digital Design 4 th M. Morris Mano and Michael D. Ciletti 2

3 Agenda Introduction Number System 3

4 Introduction Digital Logic and Computer Organization is the science of utilizing logic design in organizing digital systems, including computer systems. A Digital System is a one in which all signals are represented by discrete values. Computers, calculators and most electronic systems contains large amount of digital logic. 4

5 Introduction Digital systems usually operate with two-valued signals (0 & 1). Inputs an outputs of a digital system represent real quantities, binary (two-valued), or otherwise encoded multi-valued. Multi-valued inputs (decimal, character,…,etc.) each, must be represented by a set of binary digits (bits), which we call coding the inputs into binary. 5

6 Introduction Examples: 1- A System with three inputs A, B and C and one output Z, such that Z =1 iff two of the inputs are 1. ABCZ 000 001 010 011 100 101 110 111 6

7 Introduction SOLUTION : ABCZ 0000 0010 0100 0111 1000 1011 1101 1111 7

8 Number system 1- Decimal system 8

9 The decimal: numeral system (also called base ten or occasionally denary) has ten as its base. Its digits from 0 to 9. It is the numerical base most widely used by modern civilizations 9 Number System

10 decimal system Let 7392 Which means : 7*10 3 +3*10 2 +9*10 1 +2*10 0 So : as a law If : …. a 3 a 2 a 1 a 0 ……. a 3 *10 3 +a 2 *10 2 +a 1 *10 1 +a 0 *10 0 10

11 Number System Let 0.9235 Which means : 0. 9*10 -1 +2*10 -2 +3*10 -3 +5*10 -4 So : as a law If : 0.a -1 a -2 a -3 a -4 0.a -1 *10 -1 +a -2 *10 -2 +a -3 *10 -3 +a -4 *10 -4 11

12 Number System So the : a 3 a 2 a 1 a 0.a -1 a -2 a -3 a -4 a 3 *10 3 +a 2 *10 2 +a 1 *10 1 +a 0 *10 0 + a -1 *10 -1 +a -2 *10 -2 +a -3 *10 -3 +a -4 *10 -4 12

13 Binary System 13

14 Number System What about binary system? the digit at Decimal system from 0 to 9 so the base is 10 In binary system the digit is: 0 or 1 so the base is 2 The previous law could be the same but with base of two 14

15 Octal System 15

16 Octal System The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. 16

17 Hexadecimal System 17

18 Hexadecimal hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F (or alternatively a–f) to represent values ten to fifteen. For example, the hexadecimal number 2AF3 is equal 18

19 Conversion To Decimal System: 19

20 Number System The general law for conversion to decimal system: N = d n * R n + d n-1 * R n-1 +…+ d 0 * R 0 + d -1 *R -1 +…d -m * R -m Where n is number of digits, m number of fraction digits and R is the radix/base and d i are the coefficients such that 0 ≤ d i < R 20

21 Number System From binary to Decimal a 3 a 2 a 1 a 0.a -1 a -2 a -3 a -4 a 3 *2 3 +a 2 *2 2 +a 1 *2 1 +a 0 *2 0 +a -1 *2 -1 +a -2 *2 -2 +a -3 *2 -3 +a -4 *2 -4 Example : 11010.11 = 1*2 4 +1*2 3 +0*2 2 +1*2 1 +0*2 0 + 1*2 -1 +1*2 -2 16+8+0+2+0+0.50+0.25= 26+0.75= 26.75 21

22 Number System Convert the number (40212.2) 5 The solution is : (511.4) 10 22

23 From Decimal to binary 23

24 Number System To compute the binary equivalent of a decimal number: divide the decimal number by the radix (2 in this case) keep the remainder, divide again and keep the remainder, repeat this process until the result of the division is zero The sequence of digits obtained (the remainders) arranged from right to left is the number in the radix (binary) system. 24

25 Number System Example (decimal to binary): 9) 10 = ??) 2 Divide by 2 numberquotientReminderCoeffectiont 941a 0 = 1 420a 1 = 0 210a 2 = 0 101a 3 = 1 a 3 a 2 a 1 a 0 1 0 0 1 25

26 Number System Solve : (41) 10 : (???) 2 numberquotientReminderCoeffectiont 41201a 0 = 1 20100a 1 = 0 1050a 2 = 0 521a 3 = 1 210a 4 = 0 101a 5 = 1 The solution : 101001 26

27 Number System The fraction part : 0.6875 Multiply by two numberIntegerfractionCoefficient 0.6875 *210.375a -1 = 1 0.375 *200.75a -2 = 0 0.75*210.5a -3 = 1 0.5*210a -4 = 1 0. a -1 a -2 a -3 a -4 0. 1 0 1 1 27

28 Number System Rule: Conversion from decimal to binary Divide the number by two in the integer part And multiply by two in the fraction part 28

29 Number System From base 10 to base 2 -----------.--------------- Division. Multiplication Reminder. Integer 29

30 Number System Convert the following decimal into Binary numbers: a. 1000 b. 512 c. 217 d. 177 e. 105 Convert the following Binary numbers to Decimal: a. 1110 b. 110011 c. 101010 d. 0111 30

31 What about from decimal to octal and Hexadecimal ?? 31

32 Number System 1- from decimal to octal like binary but divide by 8 in integer part and multiply by 8 in fraction part 2- from decimal to hexadecimal but divide by 16 32

33 From binary to octal 33

34 Number System From binary to octal Octal (r=8) so 7= 111 Every 3 digits  one digit at octal system Ex: 101 011.111100 5 3. 7 4 34

35 Number System (1011101010) 2  ( ??) 8 Solution is : (1 011 101 010) = (1 3 5 2) 8 = (1352) 8 35

36 From binary to Hexadecimal 36

37 Number System From binary to hexadecimal Hexadecimal (r=16) so 15= 1111 Every 3 digits  one digit at octal system Ex: 0101 0011.01110101 5 3. 7 5 37

38 Number System (1011101010) 2  ( ??) 8 Solution is : (1 011 101 010) = (1 3 5 2) 8 = (1352) 8 38

39 Number System Exercises: 1- (001011101010.1) 2  (???) 16 2-  (???) 10 3- (1011101010)2  (??) 8 4- (1352.7) 8  (??) 10 5- (746.875) 10  (??) 8 ------------------------------------------------------------------- Solutions 1- (2EA.8) 16 2- (746.5) 10 3- (1352) 8 4- (746.875) 10 5- (1352.7) 8 39

40 Number System Binary Addition101+ 010011----- 1111000 40

41 Number System Binary Subtraction: 1111101- 0110011 ----------- 1001010 41

42 Number System One-bit Adder C in a b ------------- C out S 42

43 Number System 43

44 RADIX COMPLEMENT If N is number for base r (r-1)’s complement = (r n -1)-N r’s complement = r n -N ≠ 0 r’s complement = (r-1)’s complement +1 44

45 RADIX COMPLEMENT In binary system : 1’s complement and 2’s complement 101 =  1’s comp. is : 010 r= 2  r-1=1 …. 1’s complement : (2 n -1)-N Let (2 3 =8 )-1= 7 so  111-101= 010 101  2’s complement is : 011 r =2  r n -N Let (2 3 =8 ) = 1000  1000-101= 011 45

46 RADIX COMPLEMENT Get 1’s complement and 2’s complement For : 1011000 and 0101101 Solution: 1’s : 0100111 and1010010 2’s: 0101000and 1010011 46

47 RADIX COMPLEMENT Get 9’s comp and 10’s comp For : 012398 and 246700 The solution : 9’s comp: 987601and 753299 10’s comp: 987602and 753300 47

48 Exercise Solve : a. (127.4) 8  ( ) 10 b. (B65F) 16  ( ) 10 c. (110101) 2  ( ) 10 d. (153) 10  ( ) 8 48

49 Exercise The solution a. (127) 8  (87 ) 10 b. (B65F) 16  (46687 ) 10 c. (110101) 2  ( 53) 10 d. (153) 10  ( 231) 8 49


Download ppt "Dr. Nermin Hamza 1. Materials Book: Digital Design 4 th M. Morris Mano and Michael D. Ciletti 2."

Similar presentations


Ads by Google