Presentation is loading. Please wait.

Presentation is loading. Please wait.

D IGITAL L OGIC Number Systems By: Safwan Mawlood Digital Principles and Logic Design, A.Saha &N.Manna.

Similar presentations


Presentation on theme: "D IGITAL L OGIC Number Systems By: Safwan Mawlood Digital Principles and Logic Design, A.Saha &N.Manna."— Presentation transcript:

1 D IGITAL L OGIC Number Systems By: Safwan Mawlood Digital Principles and Logic Design, A.Saha &N.Manna

2 N UMBER S YSTEMS Knowing what base someone refers to Decimal uses 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Binary uses 2 digits: 0 and 1. Octal number system there are 8 digits—0, 1, 2, 3, 4, 5, 6, and 7. Hexadecimal number system has 16 digits—0 to 9— and the rest of the six digits are specifies by letter symbols as A,B, C, D, E, and F. Here A, B, C, D, E, and F represent decimal 10, 11, 12, 13, 14, and 15 respectively.

3 B ASE 10 N UMBERS

4 B ASE 2 (B INARY ) N UMBERS

5 H EXADECIMAL The base 16, or hexadecimal (hex), number system is used frequently when working with computers, because it can be used to represent binary numbers in a more readable form A B C D E F

6 CONVERSION BETWEEN NUMBER SYSTEMS It is often required to convert a number in a particular number system to any other number system, e.g., it may be required to convert a decimal number to binary or octal or hexadecimal.

7 C ONVERTING D ECIMAL TO B INARY To convert a number in decimal to a number in binary we have to divide the decimal number by 2 repeatedly, until the quotient of zero is obtained.

8 C ONVERTING D ECIMAL TO B INARY Start by dividing the decimal by the largest number in the Value row that will go.

9 D ECIMAL TO O CTAL C ONVERSION Similarly, to convert a number in decimal to a number in octal we have to divide the decimal number by 8 repeatedly, until the quotient of zero is obtained.

10 D ECIMAL - TO - HEXADECIMAL C ONVERSION The same steps are repeated to convert a number in decimal to a number in hexadecimal. Only here we have to divide the decimal number by 16 repeatedly, until the quotient of zero is obtained.

11 B INARY - TO - DECIMAL C ONVERSION

12 C ONVERTING 8-B IT B INARY TO D ECIMAL Binary numbers are converted to decimal numbers by multiplying the binary digits by the base number of the system, which is base 2, and raised to the exponent of its position.

13 O CTAL - TO -D ECIMAL C ONVERSION Ex. Convert into decimal number. Sol. The octal number given is 3462

14 H EXADECIMAL - TO - DECIMAL C ONVERSION Ex. Convert 42AD 16 to decimal

15 F RACTIONAL C ONVERSION Example: Convert into decimal number

16 O CTAL - TO - DECIMAL C ONVERSION Example: Convert into a decimal number.

17 H EXADECIMAL TO D ECIMAL NUMBER Example: 42A.12 16

18 - DECIMAL - TO - BINARY C ONVERSION Example:

19 C ONVERT D ECIMAL TO OCTAL NUMBER Convert into an octal number.

20 B INARY A RITHMETIC Binary Addition

21 Example: Add and Example: Add and

22 B INARY S UBTRACTION

23 Example: Subtract and

24 B INARY M ULTIPLICATION

25 Example: Multiply the following binary numbers and

26 Example: Multiply the following binary numbers and

27 B INARY D IVISION

28 Example: Divide the following binary numbers and 101

29 1’ S C OMPLEMENT The ones' complement of a binary number is defined as the value obtained by inverting all the bits in the binary representation of the number (swapping 0's for 1's and vice-versa).

30

31

32 S UBTRACTION U SING 2’ S C OMPLEMENT Binary subtraction can be performed by adding the 2’s complement of the subtrahend to the minuend. If a carry is generated, discard the carry. Now if the subtrahend is larger than the minuend, then no carry is generated

33

34

35

36 C ODE Computers and other digital circuits process data in binary format. Various binary codes are used to represent data which may be numeric, alphabetic or special characters. Codes are also used for error detection and error correction in digital systems.

37 G RAY Gray code belongs to a class of code known as minimum change code, in which a number changes by only one bit as it proceeds from one number to the next.

38 C ONVERSION OF A B INARY N UMBER INTO G RAY C ODE (101011) 2 change to Gray

39

40 C ONVERSION OF G RAY C ODE INTO A B INARY N UMBER

41

42 B INARY C ODE D ECIMAL BCD, is a method of using binary digits to represent the decimal digits 0 through 9. A decimal digit is represented by four binary digits, or four bits are required to code each decimal number. as shown below:

43 You must realize that BCD and binary are not the same. For example, in binary is , but in BCD is BCD. Each decimal digit is converted to its binary equivalent.

44 BCD C ONVERSION For example, let's go through the conversion of to BCD. We'll use the block format that you used in earlier conversions. First, write out the decimal number to be converted; then, below each digit write the BCD equivalent of that digit:

45


Download ppt "D IGITAL L OGIC Number Systems By: Safwan Mawlood Digital Principles and Logic Design, A.Saha &N.Manna."

Similar presentations


Ads by Google