1 / 43

Computer Architecture Data Representation Mark S. Staveley Mark.Staveley@mun

Computer Architecture Data Representation Mark S. Staveley Mark.Staveley@mun.ca. Binary Coded Decimal Representation.

Download Presentation

Computer Architecture Data Representation Mark S. Staveley Mark.Staveley@mun

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. Computer Architecture Data Representation Mark S. Staveley Mark.Staveley@mun.ca

  2. Binary Coded Decimal Representation Complete the following table. Each row represents a specific unsigned integer value in the different radix forms listed in the table. For example, 1210 can be written as 11002, 14­8 or C16.

  3. Binary Coded Decimal Representation 3217/2 = 1608 R 1 (Least Significant Bit) 1608/2 = 804 R 0 804/2 = 402 R 0 402/2 = 201 R 0 201/2 = 100 R 1 100/2 = 50 R 0 50/2 = 25 R 0 25/2 = 12 R 1 12/2 = 6 R 0 6/2 = 3 R 0 3/2 = 1 R 1 1/2 = 0 R 1 (Most Significant Bit) 321710 = 1100100100012 Complete the following table. Each row represents a specific unsigned integer value in the different radix forms listed in the table. For example, 1210 can be written as 11002, 14­8 or C16.

  4. Binary Coded Decimal Representation Complete the following table. Each row represents a specific unsigned integer value in the different radix forms listed in the table. For example, 1210 can be written as 11002, 14­8 or C16.

  5. Binary Coded Decimal Representation 3217/8 = 402 R 1 (Least Significant Bit) 402/8 = 50 R 2 50/8 = 6 R 2 6/8 = 0 R 6 (Most Significant Bit) 321710 = 62218 Complete the following table. Each row represents a specific unsigned integer value in the different radix forms listed in the table. For example, 1210 can be written as 11002, 14­8 or C16.

  6. Binary Coded Decimal Representation Complete the following table. Each row represents a specific unsigned integer value in the different radix forms listed in the table. For example, 1210 can be written as 11002, 14­8 or C16.

  7. Binary Coded Decimal Representation 3217/16 = 201 R 1 (Least Significant Bit) 201/16 = 12 R 6 2/16 = 0 R C (1210 Most Significant Bit) 321710 = C6116 Complete the following table. Each row represents a specific unsigned integer value in the different radix forms listed in the table. For example, 1210 can be written as 11002, 14­8 or C16.

  8. Binary Coded Decimal Representation Complete the following table. Each row represents a specific unsigned integer value in the different radix forms listed in the table. For example, 1210 can be written as 11002, 14­8 or C16.

  9. Binary Coded Decimal Representation Complete the following table. Each row represents a specific unsigned integer value in the different radix forms listed in the table. For example, 1210 can be written as 11002, 14­8 or C16.

  10. Binary Coded Decimal Representation B3816 B16 – 10112 316 – 00112 816 – 10002 1011001110002 Complete the following table. Each row represents a specific unsigned integer value in the different radix forms listed in the table. For example, 1210 can be written as 11002, 14­8 or C16.

  11. Binary Coded Decimal Representation 1011001110002 Split on 3-bits (base 8) 1012 – 58 1002 – 48 1112 – 78 0002 – 08 54708 Complete the following table. Each row represents a specific unsigned integer value in the different radix forms listed in the table. For example, 1210 can be written as 11002, 14­8 or C16.

  12. Binary Coded Decimal Representation 1011001110002 = 0 x 20 + 0 X 21 + 0 X 22 + 1 X 23 + 1 x 24 + 1 x 25 + 0 x 26 + 0 x 27 + 1 x 28 + 1 x 29 + 0 x 210 + 1 x 211 = 287210 Complete the following table. Each row represents a specific unsigned integer value in the different radix forms listed in the table. For example, 1210 can be written as 11002, 14­8 or C16.

  13. Binary Coded Decimal Representation Complete the following table. Each row represents a specific unsigned integer value in the different radix forms listed in the table. For example, 1210 can be written as 11002, 14­8 or C16.

  14. Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  15. Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  16. +21 (convert to Sign & Magnitude) Sign = + = 1 21 convert to 5-bit representation = 10101 Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  17. +21 (convert to One’s Complement) Result = same as normal because it is positive = 010101 Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  18. +21 (convert to Two’s Complement) Result = same as normal because it is positive = 010101 Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  19. +21 (Convert to Excess 31) Positive and negative representations of a number are obtained by adding a bias to the two’s complement representation, ignoring any carry out from the most significant digit. 21 in Two’s Complement = 010101 Bias = 31 = 011111 010101 + 011111 = 110100 Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  20. Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  21. -32 (convert to Sign & Magnitude) Sign = - = 1 32 convert to 5-bit representation = Error Why? Greatest number represented with 5 bits is 31 (11111) 32 is out of range. Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  22. -32 (One’s Complement) Sign = - = 1 32 convert to 5-bit representation = Error Why? Greatest number represented with 5 bits is 31 (11111) 32 is out of range. Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  23. -32 (convert to Two’s Complement) Minimum 2's complement value = -2n-1 Maximum 2's complement value = 2n-1 – 1 n = 6 = Max = +31, Min = -32 -32 converted = 100000 Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  24. -32 (Convert to Excess 31) Largest Negative Number = 000000 = - 31 Largest Positive Number = 111111 = + 32 Out of Range = N/A Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  25. Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  26. -17 (convert to Sign & Magnitude) Sign = - = 1 17 convert to 5-bit representation = 10001 Result = 110001 Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  27. -17 (One’s Complement) Sign = - = 1 17 convert to 5-bit representation = 10001 Complement each bit = 01110 Result = 101110 Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  28. -17 (convert to Two’s Complement) Add One to One’s Complement 101110 + 1 = 01111 Result = 101111 Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  29. -17 (Convert to Excess 31) Positive and negative representations of a number are obtained by adding a bias to the two’s complement representation, ignoring any carry out from the most significant digit. 17 in Two’s Complement = 101111 Bias = 31 = 011111 101111 + 011111 = 001110 Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 31. Each row in the table is to show a specific numerical value in the different data representations listed in the table. Note that for each numeric value listed below, it may not be possible to represent that value in all the data representations – in these cases just specify ‘N/A’.

  30. Fill in the following steps to find the representation for –17.5 in the IEEE single-precision floating-point standard.

  31. IEEE-754 Floating Point Standard • Developed in 1985. It can be supported in hardware, or a mixture of hardware and software. • There are also single extended, and double extended formats (80 bits wide, 15-bit exponent, and 64-bit fraction). Excess-127 Hidden bit Excess-1023 Hidden bit

  32. Fill in the following steps to find the representation for –17.5 in the IEEE single-precision floating-point standard. a) Convert –17.5 to base 2: b) Express the value from (a) in binary scientific notation: c) Convert the exponent from (b) to excess 127: d) IEEE single point precision representation:

  33. Fill in the following steps to find the representation for –17.5 in the IEEE single-precision floating-point standard. • Convert –17.5 to base 2: –10001.12

  34. Fill in the following steps to find the representation for –17.5 in the IEEE single-precision floating-point standard. b) Express the value from (a) in binary scientific notation: –1.000112 * 24

  35. Fill in the following steps to find the representation for –17.5 in the IEEE single-precision floating-point standard. c) Convert the exponent from (b) to excess 127: 12710 + 410 = 11111112 + 1002 = 100000112

  36. Fill in the following steps to find the representation for –17.5 in the IEEE single-precision floating-point standard. d) IEEE single point precision representation: Sine Bit = Negative = 1 Exponent = 12710+410 = 13110 = 100000112 Fraction = 1.000112 (leading 1 of fraction is hidden) = 00011000000000000000000 1 10000011 00011000000000000000000

  37. Convert the following floating point numbers represented in IEEE single precision floating point representation to both binary and decimal representations in scientific notation, where feasible. 1 1 0 1 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 101000012 = 16110; 161 – 127 = 34; –1.110012 * 234

  38. Convert the following floating point numbers represented in IEEE single precision floating point representation to both binary and decimal representations in scientific notation, where feasible. 0 0 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 011110102 = 12210; 122 – 127 = –5; 1.02 * 2–5 = 1.010 * 2–5 = 0.03125 = 3.125 * 10-2

  39. Convert the following floating point numbers represented in IEEE single precision floating point representation to both binary and decimal representations in scientific notation, where feasible. 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100000012 = 12910; 129 – 127 = 2; 1.10102 * 22 = 110.102 = 6.5 = 6.5 * 100

  40. Convert the following floating point numbers represented in IEEE single precision floating point representation to both binary and decimal representations in scientific notation, where feasible. 1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 111000002 = 22410; 224 – 127 = 97; –1.011001112 * 297

  41. Do the following using two’s complement arithmetic and indicate the carry (C) and overflow (V) values. (e.g., “C = 1” if there is a carry, “C = 0” otherwise). a) 0 1 0 1 1 1 b) 0 1 1 0 0 0 c) 1 0 1 1 0 1 + 0 1 0 0 1 1 - 0 1 1 1 0 0 - 1 0 1 0 0 1 C = C = C = V = V = V = d) 1 1 0 0 1 1 e) 1 0 1 1 0 0 f) 0 1 1 1 1 1 - 0 0 0 0 0 1 + 1 0 0 1 1 0 + 1 0 1 0 1 0 C = C = C = V = V = V =

  42. Do the following using two’s complement arithmetic and indicate the carry (C) and overflow (V) values. (e.g., “C = 1” if there is a carry, “C = 0” otherwise). a) 0 1 0 1 1 1 b) 0 1 1 0 0 0 c) 1 0 1 1 0 1 + 0 1 0 0 1 1 - 0 1 1 1 0 0 - 1 0 1 0 0 1 1 0 1 0 1 0 = 0 1 1 0 0 0 0 0 0 1 0 0 + 1 0 0 1 0 0 1 1 1 1 0 0 C = 0 (no carry) C = 0 C = 1 V = 1 (sum out of range) V = 0 V = 0 Note: When the CPU adds two binary integers, if their sum is out of range when interpreted in the two’s complement representation, then V is set to 1. Otherwise V is cleared to 0

  43. Do the following using two’s complement arithmetic and indicate the carry (C) and overflow (V) values. (e.g., “C = 1” if there is a carry, “C = 0” otherwise). d) 1 1 0 0 1 1 e) 1 0 1 1 0 0 f) 0 1 1 1 1 1 - 0 0 0 0 0 1 + 1 0 0 1 1 0 + 1 0 1 0 1 0 1 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 C = 1 C = 1 C = 1 V = 0 V = 1 V = 0

More Related