1 / 40

Chapter 3

Chapter 3. Number System and Codes. Decimal and Binary Numbers. Decimal and Binary Numbers. Converting Decimal to Binary. Sum of powers of 2. Converting Decimal to Binary. Repeated Division. Binary Numbers and Computers. Hexadecimal Numbers. Converting decimal to hexadecimal.

Download Presentation

Chapter 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 3 Number System and Codes

  2. Decimal and Binary Numbers

  3. Decimal and Binary Numbers

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

  5. Converting Decimal to Binary • 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

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

  13. Representing a positive numbers

  14. Representing a negative numbers using Sign-Magnitude notation -5 = 1101 4-bits sign-manitude -55= 10110111 8-bits sign-magnitude

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

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

  17. 1’s Complement • Example :- • - 57 • +57 = 0011 1001 • -57 = 1100 0110

  18. Converting to decimal format

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

  20. Example

  21. Convert to decimal value • Positive values:- • 0101 1001 = +89 • Negative values

  22. Two's Complement Arithmetic

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

  24. Overflow in Binary Addition

  25. Overflow in Binary Addition

  26. Overflow in Binary Addition

  27. Adding Positive and Negative Integers in 2's ComplementForm

  28. Adding Positive and Negative Integers in 2's ComplementForm

  29. Subtraction of Positive and Negative Integers

  30. Digital Codes • Binary Coded Decimal (BCD)

  31. BCD

  32. BCD

  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. Gray –to-Binary Conversion

  38. The Excess-3- Code

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

  40. Parity • Example:

More Related