1 / 25

DKT 122/3 DIGITAL SYSTEM 1

DKT 122/3 DIGITAL SYSTEM 1. WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2). Signed Numbers. Arithmetic Operations - Addition. Add the 2 signed numbers and discard any final carry bit. Example: 11111011 + 11110111 11111011 + 11110111 1 11110010. Discard carry bit.

rossa
Download Presentation

DKT 122/3 DIGITAL SYSTEM 1

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. DKT 122/3DIGITAL SYSTEM 1 WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2)

  2. Signed Numbers Arithmetic Operations- Addition Add the 2 signed numbers and discard any final carry bit Example: 11111011 + 11110111 11111011 + 11110111 1 11110010 Discard carry bit

  3. 2’s complement of subtrahend Signed Numbers (Cont.) Arithmetic Operations- Subtraction • take the 2’s complement of the subtrahend and add to the minuend • discard any final carry bit Example: 00001000 – 00000011 minuend subtrahend 00001000 00001000 - 00000011 + 11111101 1 00000101 Discard carry

  4. Number System (Hexadecimal) • Base 16 system • Uses digits0-9& lettersA,B,C,D,E,F • Groups of four bitsrepresent eachbase 16 digit

  5. Number System (Hex) (Cont.) Hexadecimal to Decimal Conversion Convert 3B4F16 to its decimal equivalent: Hex digits 3 B 4 F x x x x Positional Values 163 162 161 160 12288 +2816 +64 +15 Products 15,18310

  6. Number System (Hex) (Cont.) Decimal to Hexadecimal Conversion Convert 83010 to its hexadecimal equivalent: 830 / 16 = 51 R 14 51 / 16 = 3 R 3 3 / 16 = 0 R 3 E in Hex 33E16

  7. Number System (Hex) (Cont.) Binary to Hexadecimal Conversion Grouping the binary position in 4-bit groups, starting from the least significant position.

  8. Number System (Hex) (Cont.) Binary to Hexadecimal Conversion Example Convert 0101011010101110011010102 to hex using the 4-bit substitution code : 0101 0110 1010 1110 0110 1010 5 6 A E 6 A

  9. Solve this.. • Convert hexadecimal number 2316, 8D16and EB16 to decimal • Convert decimal number 5210, 28410 and 289010to hexadecimal • Convert hexadecimal number 3816 and 5C816 to binary • Convert binary number 1110 and 10111 to hexadecimal

  10. Numbering System (Octal) • Also known as theBase 8 System • Uses digits0 - 7 • Readily converts to binary • Groups of three (binary) digits can be used to represent each octal digit • Also uses multiplication and division algorithms for conversion to and from base 10

  11. Numbering System (Octal) (Cont.) Octal to Decimal Conversion Convert 6538 to its decimal equivalent Octal Digits 6 5 3 x x x Positional Values 82 81 80 Products 384 + 40 + 3 42710

  12. Numbering System (Octal) (Cont.) Decimal to Octal Conversion Use the repeated division-by-8 method Example Convert 42710 to its octal equivalent 427 / 8 = 53R 3 LSB53 / 8 = 6R 5 6 / 8 = 0R 6 MSB 6538

  13. Numbering System (Octal) (Cont.) Octal to Binary Conversion Each octal number converts to 3 binary digits Example Convert 6538 to binary 6 5 3 Substitute numbers with 3-binary digits 110 101 011

  14. Numbering System (Octal) (Cont.) Binary to Octal Conversion Grouping the binary position in groups of 3 starting at the least significant position. Example Convert the binary numbers 110101 to octal • 1 1 0 1 0 1 • 6 5 658

  15. Solve this.. Convert octal number 648, 5578 and 10248 to decimal Convert decimal number 4610, 10010 and 21910to octal Convert octal number 1018 and 3218to binary Convert binary number 101010 and 110111 to octal

  16. Digital Codes - BCD • BCD (Binary Coded Decimal) Code • Represent each of the 10 decimal digits (0~9) as a 4-bit binary code. Example Convert 15 to BCD. 1 5 0001 0101BCD

  17. Digital Codes – BCD (Cont.) Addition Step 1: Add the two BCD numbers, using the rules for binary addition Step 2: If a 4-bit sum is equal to or less than 9, it is a valid BCD number Step 3: If a 4-bit sum is greater than 9 / if a carry out is generated, it is an invalid BCD result. Add 6 (0110) to the 4-bit sum

  18. Digital Codes – BCD (Cont.) Addition – Valid number Example: 0 0 1 1 + 0 1 0 0 0 1 1 1(Valid BCD number)

  19. Digital Codes – BCD (Cont.) Addition – Not valid number Example: 1 0 0 1 + 0 1 0 0 1 1 0 1 (Invalid BCD number coz >9) + 0 1 1 0(Add 6) 0 0 0 1 0 0 1 1(Valid BCD number) 1 3

  20. Digital Codes - ASCII • ASCII (American Standard Code for Information Interchange) Code • Used to translate from the keyboard characters to computer language

  21. ASCII Codes - Table

  22. Digital Codes - Gray • Gray Code • Only 1 bit changes • Can’t be used in arithmetic circuits • Exhibits only a single change from one code word to the next in sequence • Need to know how to convert binary to Gray and vice versa.

  23. Digital Codes – Gray (Cont.) Convert binary number 10110 to gray code. 1 0 1 1 0 1 1 1 0 1 Gray Codes Binary to Gray Conversion + + + +

  24. Digital Codes – Gray (Cont.) Convert gray code 10110 to binary. 1 0 1 1 0 1 1 0 1 1 Binary Gray to Binary Conversion + + + +

  25. Solve this.. (a) Convert binary number 11111 to gray code. (b) Convert gray code 11011 to binary. Answer : ? Answer : ? END

More Related