Presentation is loading. Please wait.

Presentation is loading. Please wait.

©zaher elsir Sudan Academy for Banking & Financial Sciences Decimal Number System Base (Radix)10 Digits0, 1, 2, 3, 4, 5, 6, 7, 8, 9 e.g.7475 10 The magnitude.

Similar presentations


Presentation on theme: "©zaher elsir Sudan Academy for Banking & Financial Sciences Decimal Number System Base (Radix)10 Digits0, 1, 2, 3, 4, 5, 6, 7, 8, 9 e.g.7475 10 The magnitude."— Presentation transcript:

1 ©zaher elsir Sudan Academy for Banking & Financial Sciences Decimal Number System Base (Radix)10 Digits0, 1, 2, 3, 4, 5, 6, 7, 8, 9 e.g.7475 10 The magnitude represented by a digit is decided by the position of the digit within the number. For example the digit 7 in the left-most position of 7475 counts for 7000 and the digit 7 in the second position from the right counts for 70. 7 1000100 475 110

2 ©zaher elsir Sudan Academy for Banking & Financial Sciences Binary Number System Base (Radix)2 Digits0, 1 e.g.1110 2 The digit 1 in the third position from the right represents the value 4 and the digit 1 in the fourth position from the right represents the value 8. 1 8=2 3 110 4=2 2 2=2 1 1=2 0

3 ©zaher elsir Sudan Academy for Banking & Financial Sciences Octal Number System Base (Radix)8 Digits0, 1, 2, 3, 4, 5, 6, 7 e.g.1623 8 The digit 2 in the second position from the right represents the value 16 and the digit 1 in the fourth position from the right represents the value 512. 1 512=8 3 6 64=8 2 2 8=8 1 3 1=8 0

4 ©zaher elsir Sudan Academy for Banking & Financial Sciences Hexadecimal Number System Base (Radix)16 Digits0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F e.g. 2F4D 16 The digit F in the third position from the right represents the value 3840 and the digit D in the first position from the right represents the value 1. 2 4096=16 3 F 256=16 2 4 16=16 1 D 1=16 0

5 ©zaher elsir Sudan Academy for Banking & Financial Sciences Binary Arithmetic Addition Complements Subtraction

6 ©zaher elsir Sudan Academy for Banking & Financial Sciences Binary Addition 0 + 0 0 + 1 1 + 0 1 + 1 1 0 Carry Bit (a) (b) (c)(d)

7 ©zaher elsir Sudan Academy for Banking & Financial Sciences Binary Addition Example 1 1 1 0 1 1 1 + 0 1 1 1 0 0 –1–1 –1–1 –1–1–1–1–1–1 –0–0–1–1–0–0–0–0–1–1–1–1 –Example 1: Add –binary 110111 to 11100 –Col 1) Add 1 + 0 = 1 – Write 1 –Col 2) Add 1 + 0 = 1 – Write 1 –Col 3) Add 1 + 1 = 2 (10 in binary) – Write 0, carry 1 –Col 4) Add 1+ 0 + 1 = 2 – Write 0, carry 1 –Col 6) Add 1 + 1 + 0 = 2 – Write 0, carry 1 –Col 5) Add 1 + 1 + 1 = 3 (11 in binary) – Write 1, carry 1 –Col 7) Bring down the carried 1 – Write 1

8 ©zaher elsir Sudan Academy for Banking & Financial Sciences Binary Addition Verification Verification 110111 2  55 10 +011100 2 + 28 10 83 10 64 32 16 8 4 2 1 1 0 1 0 0 1 1 = 64 + 16 + 2 +1 = 83 10 1 1 0 1 1 1 + 0 1 1 1 0 0 –1–1–0–0–1–1–0–0–0–0–1–1–1–1 –You can always check your –answer by converting the figures to decimal, doing the addition, and comparing the answers.

9 ©zaher elsir Sudan Academy for Banking & Financial Sciences Binary Addition Examples 10011001 + 101100 11000101 101 + 1001 1110 1011 + 101 10000 1010 + 100 1110 1011 + 1100 10111 (a)(b)(c) (d) (e)

10 ©zaher elsir Sudan Academy for Banking & Financial Sciences Binary Substraction 0 - 0 0 - 1 1 - 0 1 - 1 0 Borrow Bit (a) (b) (c)(d)

11 ©zaher elsir Sudan Academy for Banking & Financial Sciences Binary Subtraction Example 1 1 1 0 0 1 1 - 1 1 1 0 0 –Example 1: Subtract –binary 11100 from 110011 –2–2 –0–0–0–0–2–2 –1–1 –2–2 –1–1–1–1–0–0–1–1 Col 1) Subtract 1 – 0 = 1 Col 5) Try to subtract 0 – 1  can’t. Must borrow from next column. Col 4) Subtract 1 – 1 = 0 Col 3) Try to subtract 0 – 1  can’t. Must borrow 2 from next column. But next column is 0, so must go to column after next to borrow. Add the borrowed 2 to the 0 on the right. Now you can borrow from this column (leaving 1 remaining). Col 2) Subtract 1 – 0 = 1 Add the borrowed 2 to the original 0. Then subtract 2 – 1 = 1 –1–1 Add the borrowed 2 to the remaining 0. Then subtract 2 – 1 = 1 Col 6) Remaining leading 0 can be ignored.

12 ©zaher elsir Sudan Academy for Banking & Financial Sciences Binary Subtraction Verification Verification 110011 2  51 10 - 11100 2 - 28 10 23 10 64 32 16 8 4 2 1 1 0 1 1 1 = 16 + 4 + 2 + 1 = 23 10 1 1 0 0 1 1 - 1 1 1 0 0 –2–2 –0–0–0–0–2–2 –1–1 –2–2 –1–1–1–1–0–0–1–1–1–1 –Subtract binary –11100 from 110011:

13 ©zaher elsir Sudan Academy for Banking & Financial Sciences Binary Subtraction Example 2 1 0 1 0 0 1 - 1 0 1 0 0 –Example 2: Subtract –binary 10100 from 101001 –2–2–0–0–0–0–2–2 –1–1–1–1–0–0–1–1–0–0 Verification 101001 2  41 10 - 10100 2 - 20 10 21 10 64 32 16 8 4 2 1 1 0 1 0 1 = 16 + 4 + 1 = 21 10

14 ©zaher elsir Sudan Academy for Banking & Financial Sciences Example 1 1 0 0 1 0 1 1 0 0 0 1 1 0 1 0 0 1 Binary Complement (1s Complement) Operation 1 0 0 1

15 ©zaher elsir Sudan Academy for Banking & Financial Sciences Two’s Complement The Two’s complement of a binary number is obtained by first complementing the number and then adding 1 to the result. 1001110 0110001 + 1 0110010 One’s Complement Two’s Complement

16 ©zaher elsir Sudan Academy for Banking & Financial Sciences Binary Subtraction Binary subtraction is implemented by adding the Two’s complement of the number to be subtracted. Example 1101 -1001+0111 10100 If there is a carry then it is ignored. Thus, the answer is 0100. Two’s complement of 1001

17 ©zaher elsir Sudan Academy for Banking & Financial Sciences Binary Codes BCD – Binary Coded Decimal ASCII – American Standard Code for Information Interchange A binary code is a group of n bits that assume up to 2 n distinct combinations of 1’s and 0’s with each combination representing one element of the set that is being coded.

18 ©zaher elsir Sudan Academy for Banking & Financial Sciences BCD – Binary Coded Decimal Decimal BCD Number 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 When the decimal numbers are represented in BCD, each decimal digit is represented by the equivalent BCD code. Example :BCD Representation of Decimal 6349 6 3 49 0110 0011 0100 1001

19 ©zaher elsir Sudan Academy for Banking & Financial Sciences ASCII 00110000 10110001 20110010 30110011 40110100 50110101 60110110 70110111 80111000 90111001 Number ASCIILetter ASCII A1000001 B1000010 C1000011 D1000100 E1000101 F1000110 G1000111 H1001000 I1001001

20 ©zaher elsir Sudan Academy for Banking & Financial Sciences ASCII Continued. J1001010 K1001011 L1001100 M1001101 N1001110 O1001111 P1010000 Q1010001 R1010010 Letter ASCIILetter ASCII S1010011 T1010100 U1010101 V1010110 W1010111 X1011000 Y1011001 Z1011010

21 ©zaher elsir Sudan Academy for Banking & Financial Sciences Logic Gates Binary information is represented in digital computers by physical quantities called signals. Two different electrical voltage levels such as 3 volts and 0.5 volts may be used to represent binary 1 and 0. Binary logic deals with binary variables and with operations that assume a logical meaning.

22 ©zaher elsir Sudan Academy for Banking & Financial Sciences Logic Gates Contd… A particular logic operation can be described in an algebraic or tabular form. The manipulation of binary information is done by the circuits called logic gates which are blocks of hardware that produce signals of binary 1 or 0 when input logic requirements are satisfied.

23 ©zaher elsir Sudan Academy for Banking & Financial Sciences Logic Gates Contd… Each gate has a distinct graphics symbol and it’s operation can be described by means of an algebraic expression or in a form of a table called the truth table. Each gate has one or more binary inputs and one binary output.

24 –© zaher elsir –Sudan Academy for Banking & Financial Sciences Logic Gates AND OR NOT (Inverter) NAND (Not AND) NOR (Not OR) XOR (Exclusive-OR) Exclusive-NOR

25 –© zaher elsir –Sudan Academy for Banking & Financial Sciences Logic Gates Cont. AND Logic GateTruth Table A B x A B x 0 0 0 0 1 0 1 0 0 1 1 1 A, B Binary Input Variables x Binary Output Variable x = A. B

26 –© zaher elsir –Sudan Academy for Banking & Financial Sciences Logic Gates Cont. ORLogic Gate Truth Table A B x 0 0 0 0 1 1 1 0 1 1 1 1 A B x x = A + B This is read as x equals A or B.

27 –© zaher elsir –Sudan Academy for Banking & Financial Sciences Logic Gates Cont. NOTLogic GateTruth Table A x 0 1 1 0 x A x = A

28 –© zaher elsir –Sudan Academy for Banking & Financial Sciences Logic Gates Cont. NANDLogic GateTruth Table A B x 0 0 1 0 1 1 1 0 1 1 1 0 A B x x = A. B

29 –© zaher elsir –Sudan Academy for Banking & Financial Sciences Logic Gates Cont. NORLogic GateTruth Table A B x 0 0 1 0 1 0 1 0 0 1 1 0 A B x x = A + B

30 –© zaher elsir –Sudan Academy for Banking & Financial Sciences Logic Gates Cont. XORLogic GateTruth Table A B x 0 0 0 0 1 1 1 0 1 1 1 0 A B x x = A + B

31 –© zaher elsir –Sudan Academy for Banking & Financial Sciences Logic Gates Cont. Exclusive-NOR Logic GateTruth Table A B x 0 0 1 0 1 0 1 0 0 1 1 1 A B x x = A + B


Download ppt "©zaher elsir Sudan Academy for Banking & Financial Sciences Decimal Number System Base (Radix)10 Digits0, 1, 2, 3, 4, 5, 6, 7, 8, 9 e.g.7475 10 The magnitude."

Similar presentations


Ads by Google