1 / 27

L 4.1 Computer Number System Conversions

Computer number system conversions involve changing numbers between different numeral systems. Binary to Decimal is done by multiplying each binary digit by powers of 2, while Decimal to Binary involves repeated division by 2. Binary to Octal/Hexadecimal is done by grouping binary digits into sets of three (Octal) or four (Hex). Similarly, Octal/Hex to Binary converts each digit into its binary equivalent. These conversions are essential in computing and digital electronics.

Anita101
Download Presentation

L 4.1 Computer Number System Conversions

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. Number Systems Conversions in Computer Dr Anita Choudhary Assistant Professor Department of Computer Science anitach312@gmail.com

  2. Table of Content

  3. Divide by 8 Conversion among Bases Decimal Octal Multiply each bit by 8n 3-bit equivalent binary representation Divide by 16 • Group bits in threes, starting on right Multiply each bit by 16n 3-bit equivalent binary representation 4-bit equivalent binary representation • Multiply each bit by 2n Divide by 2 Binary Hexadecimal • Group bits in four, starting on right 4-bit equivalent binary representation • Note: n is the “weight” of the bit • The weight is the position of the bit, starting from 0 on the right

  4. Quick Example 2510 = 110012 = 318 = 1916 Base

  5. Base value of a number system is 10. This is also known as base-10 number system which has 10 symbols, these are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Position of every digit has a weight which is a power of 10. Decimal to Decimal Octal Decimal Binary Hexadecimal

  6. 1234 = 1 x 103 + 2 x 102 + 3 x 101 + 4 x 100 = 1000 + 200 + 30 + 4 = 123410 Weight 12510 => 5 x 100 = 5 2 x 101 = 20 1 x 102 = 100 125 Base

  7. Right most bit is the least significant bit (LSB) and left most bit is the most significant bit (MSB). In general, a number expressed in the base-r system has coefficients multiplied by power of r. The coefficient aj ranges from 0 to (r-1). Representing real number in base-r is as following below: Where, a0, a1, … a(n-1) and an are integer part digits, n is the total number of integer digits. a-1, a-2, … and a-m are fractional part digits, m is the total number of fractional digits.

  8. Binary to Decimal Decimal Octal Binary Hexadecimal

  9. Binary to Decimal • Technique • Multiply each bit by 2n, where n is the “weight” of the bit • The weight is the position of the bit, starting from 0 on the right • Add the results

  10. Example Bit “0” 1010112 => 1 x 20 = 1 1 x 21 = 2 0 x 22 = 0 1 x 23 = 8 0 x 24 = 0 1 x 25 = 32 4310

  11. Octal to Decimal Decimal Octal Binary Hexadecimal

  12. OctaltoDecimal • Technique • Multiply each bit by 8n, where n is the “weight” of the bit • The weight is the position of the bit, starting from 0 on the right • Add the results

  13. Example 7248 => 4 x 80 = 4 2 x 81 = 16 7 x 82 = 448 46810

  14. Hexadecimal to Decimal Decimal Octal Binary Hexadecimal

  15. Hexadecimal to Decimal • Technique • Multiply each bit by 16n, where n is the “weight” of the bit • The weight is the position of the bit, starting from 0 on the right • Add the results

  16. Example ABC16 => C x 160 = 12 x 1 = 12 B x 161 = 11 x 16 = 176 A x 162 = 10 x 256 = 2560 274810

  17. Decimal to Binary Decimal Octal Binary Hexadecimal

  18. Decimal to Binary • Technique • Divide by two, keep track of the remainder • First remainder is bit 0 (LSB, least-significant bit) • Second remainder is bit 1 • Etc.

  19. 2 125 62 1 2 31 0 2 15 1 2 3 1 2 7 1 2 0 1 2 1 1 Example 12510 = ?2 Read and write 12510 = 11111012

  20. Octal to Binary Decimal Octal Binary Hexadecimal

  21. OctaltoBinary • Technique • Convert each octal digit to a 3-bit equivalent binary representation

  22. 7 0 5 111 000 101 Example 7058 = ?2 7058 = 1110001012

  23. HexadecimaltoBinary Decimal Octal Binary Hexadecimal

  24. HexadecimaltoBinary • Technique • Convert each hexadecimal digit to a 4-bit equivalent binary representation

  25. 1 0 A F 0001 0000 1010 1111 Example 10AF16 = ?2 10AF16 = 00010000101011112

  26. Thank you

More Related