Download presentation

Presentation is loading. Please wait.

1
Chapter 3 Number System and Codes

2
Decimal and Binary Numbers

3

4
Converting Decimal to Binary 1.Sum of powers of 2

5
Converting Decimal to Binary 1.Repeated Division

6
Binary Numbers and Computers

7
Hexadecimal Numbers

8
Converting decimal to hexadecimal

9
Converting binary to hexadecimal Converting hexadecimal to binary?

10
Hexadecimal numbers

11
Binary arithmetic Binary addition Binary addition

12
Representing Integers with binary Some of challenges:- Some of challenges:- Integers can be positive or negative Integers can be positive or negative Each integer should have a unique representation Each integer should have a unique representation The addition and subtraction should be efficient. The addition and subtraction should be efficient.

13
Representing a positive numbers

14
Representing a negative numbers using Sign-Magnitude notation -5 = bits sign-manitude -55= bits sign-magnitude

15
1 ’ s Complement The 1 ’ s complement representation of the positive number is the same as sign-magnitude. The 1 ’ s complement representation of the positive number is the same as sign-magnitude. +84 = =

16
1 ’ s Complement The 1 ’ s complement representation of the negative number uses the following rule:- The 1 ’ s complement representation of the negative number uses the following rule:- Subtract the magnitude from 2 n -1 Subtract the magnitude from 2 n -1 For example: For example: -36 = ??? -36 = ??? +36 = =

17
1 ’ s Complement Example :- Example : = = = =

18
Converting to decimal format

19
2 ’ s Complement For negative numbers:- Subtract the magnitude from 2 n. Or Add 1 to the 1 ’ s complement

20
Example

21
Convert to decimal value Positive values:- Positive values: = = +89 Negative values Negative values

22
Two's Complement Arithmetic

23
Adding Positive Integers in 2's Complement Form Overflow in Binary Addition

24

25

26

27
Adding Positive and Negative Integers in 2's Complement Form

28

29
Subtraction of Positive and Negative Integers

30
Digital Codes Binary Coded Decimal (BCD)

31
BCD

32

33
4221 Code

34
Gray Code In pure binary coding or 8421 BCD then counting from 7 (0111) to 8 (1000) requires 4 bits to be changed simultaneously. Gray coding avoids this since only one bit changes between subsequent numbers

35
Binary – to-Gray Code Conversion

36
Gray – to-Binary Conversion

37

38
The Excess-3- Code

39
Parity The method of parity is widely used as a method of error detection. The method of parity is widely used as a method of error detection. Extar bit known as parity is added to data word Extar bit known as parity is added to data word The new data word is then transmitted. The new data word is then transmitted. Two systems are used: Two systems are used: Even parity: the number of 1 ’ s must be even. Even parity: the number of 1 ’ s must be even. Odd parity: the number of 1 ’ s must be odd. Odd parity: the number of 1 ’ s must be odd.

40
Parity Example: Example: Odd parity Even Parity

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google