Presentation is loading. Please wait.

Presentation is loading. Please wait.

Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT.

Similar presentations


Presentation on theme: "Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT."— Presentation transcript:

1 Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT

2 Apply appropriate method to solve arithmetic problem in numbering system and sequential logic circuit Course Information Outline

3  Define decimal, binary, octal, and hexadecimal number  Perform arithmetic operation(addition and subtraction) on different number bases.  Convert decimal, binary, octal, and hexadecimal numbers to different bases and vice-versa. By the end of topic, the students should know:

4  Numbering System refers to the methods used internally to represent information stored in a computer.  Computers store lots of different types of information:  numbers  text  graphics of many varieties (stills, video, animation)  sound Numbering System

5  ALL types of information stored in a computer are stored internally in the same simple format: a sequence of 0's and 1's. Numbering System Representing Real Data in the Computer

6 Numbering System

7 DEFINE DECIMAL, OCTAL, HEXADECIMAL AND BINARY NUMBER

8  Composed of 10 symbols or numerals(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)  Base 10  It is positional-value system : value of digits depends on its position  Example : 453₁₀ DATA REPRESENTATION IN COMPUTER MEMORY DECIMAL NUMBER/ BASE 10 400 50 + 3 453 4 carries the most weight refer MOST SIGNIFICANT DIGIT (MSD) 3 carries the most weight refer LEAST SIGNIFICANT DIGIT(LSD)

9  Example : 27.35₁₀ = (2 X 10 )+ (7 X 1 )+ (3 X 0.1 )+ (5 X 0.01) = 200 + 70 + 0.3 + 0.005 = 2 X 10 + 7 X 10 + 3 X 10 + 3 X 10 + 5 X 10 DATA REPRESENTATION IN COMPUTER MEMORY DECIMAL NUMBER/ BASE 10 210 -2 10. 4 32 1 0 -2 -3 -4

10  Composed of 8 symbols or numerals(0, 1, 2, 3, 4, 5, 6, 7)  Base 8  Example : 5641.27 / 5641.27₈ DATA REPRESENTATION IN COMPUTER MEMORY OCTAL NUMBER/ BASE 8 88888.8888 4 32 1 0 -2 -3 -4

11  Composed of 16 symbols or numerals (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F )  Symbol alphabets represent A = 10, B = 11, C = 12, D = 13, E = 14, F = 15  Example : 7A₁₆ DATA REPRESENTATION IN COMPUTER MEMORY HEXADECIMAL NUMBER/ BASE 16

12  Digits are 0 or 1  Binary numbers are in base 2  Example : 101₂ DATA REPRESENTATION IN COMPUTER MEMORY BINARY NUMBER/ BASE 2

13 PERFORM ARITHMETIC OPERATION IN DIFFERENT NUMBER BASES (ADDITION AND SUBSTRACTION)

14  Add two octal digits as usual  If the sum less is 7 or less, it can be expressed as octal digit  If the sum is greater than or equal 8, subtract 8 and carry a 1 to the next digit position OCTAL (ADDITION)

15

16  When minuend value is smaller than the subtrahend, borrow 8 value from the column before OCTAL (SUBTRACTION)

17 OCTAL (SUBSTRACTION)

18  Add the following numbers  Subtract the following numbers EXERCISE

19 ANSWER i.1014 8 ii.343 8

20  Add two hex digits as usual  If the sum less is 15 or less, it can be expressed as hex digit  If the sum is greater than or equal 16, subtract 16 and carry a 1 to the next digit position HEXADECIMAL (ADDITION)

21

22  When minuend value is smaller than the subtrahend, borrow 16 value from the column before HEXADECIMAL (SUBTRACTION)

23

24  Add the following numbers  Subtract the following numbers EXERCISE

25 Answer

26  Only four cases can occur in adding the two binary digits (bits) in any position: BINARY ( ADDITION) CARRY

27 BINARY ( ADDITION)

28  When minuend value is smaller than the subtrahend, borrow 2 value from the column before BINARY ( SUBTRACTION) borrow

29 10110 2 - 1101 2 1001 2 BINARY ( SUBTRACTION)

30  Add the following numbers i. 1010 + 1011 ii. 1111 + 0011 iii. 10011011 + 10011101 i.11101 – 111 ii.110 - 11 EXERCISE

31 CONVERSIONS

32 1.Set up the problem. For this example, let's convert the decimal number 156 10 to binary. 2. Write the integer answer (quotient) under the long division symbol, and write the remainder (0 or 1) to the right of the dividend. DECIMAL  BINARY

33 3. Continue downwards, dividing each new quotient by two and writing the remainders to the right of each dividend. Stop when the quotient is 0. 4. Starting with the bottom remainder, read the sequence of remainders upwards to the top. DECIMAL  BINARY Answer: 10011100

34 BINARY  DECIMAL EXAMPLE 1 EXAMPLE 2

35 Example: Convert 300.34 to octal DECIMAL  OCTAL Answer : 454.25605 ₈

36  Converted to decimal equivalent by multiplying each octal digit by its positional weight OCTAL  DECIMAL EXAMPLE 1

37  Using repeated division by 16.  Example : convert 423 to hexadecimal DECIMAL  HEXADECIMAL 16 423 remainder 7 16 26 remainder 10 16 1 remainder 1 Answer : 1A7 ₁₆

38  Convert each octal digit to its 3 bits binary  Example : Convert 472₈ to binary OCTAL  BINARY Octal Digit01234567 Binary Equivalent 000001010011100101110111 472 100111010

39  Converted to its decimal equivalent by using the fact that each hex digit position has weight that is power of 16.  Example : convert 14₁₆ to decimal HEXADECIMAL  DECIMAL

40  The bits of the binary number are grouped into groups of 3 bits.  Example : Convert 100111010₂ into octal BINARY  OCTAL 100111010 472

41  The number is grouped into groups of 4 bits  Example : Convert 1110100110₂ to hex BINARY  HEXADECIMAL 001110100110 3A6

42  Each hex digit converted to its 4 bit binary  Example : 9F2₁₆ to binary HEXADECIMAL  BINARY 9F2 100111110010


Download ppt "Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT."

Similar presentations


Ads by Google