Download presentation
1
Computer Architecture
Data Representation Mark S. Staveley
2
Binary Coded Decimal Representation
Octal Hexadecimal 3127 6271 B38 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, 148 or C16.
3
Binary Coded Decimal Representation
Octal Hexadecimal 3217 6271 B38 3217/2 = R 1 (Least Significant Bit) 1608/2 = R 0 804/2 = R 0 402/2 = R 0 201/2 = R 1 100/2 = R 0 50/2 = R 0 25/2 = R 1 12/2 = R 0 6/2 = R 0 3/2 = R 1 1/2 = R 1 (Most Significant Bit) = 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, 148 or C16.
4
Binary Coded Decimal Representation
Octal Hexadecimal 3217 6271 B38 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, 148 or C16.
5
Binary Coded Decimal Representation
Octal Hexadecimal 3217 6271 B38 3217/8 = R 1 (Least Significant Bit) 402/8 = R 2 50/8 = R 2 6/8 = R 6 (Most Significant Bit) = 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, 148 or C16.
6
Binary Coded Decimal Representation
Octal Hexadecimal 3217 6221 6271 B38 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, 148 or C16.
7
Binary Coded Decimal Representation
Octal Hexadecimal 3217 6221 6271 B38 3217/16 = R 1 (Least Significant Bit) 201/16 = R 6 2/16 = R C (1210 Most Significant Bit) = 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, 148 or C16.
8
Binary Coded Decimal Representation
Octal Hexadecimal 3217 6221 C91 6271 B38 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, 148 or C16.
9
Binary Coded Decimal Representation
Octal Hexadecimal 3217 6221 C91 6271 B38 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, 148 or C16.
10
Binary Coded Decimal Representation
Octal Hexadecimal 3217 6221 6271 B38 B3816 B16 – 10112 316 – 00112 816 – 10002 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, 148 or C16.
11
Binary Coded Decimal Representation
Octal Hexadecimal 3217 6221 6271 B38 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, 148 or C16.
12
Binary Coded Decimal Representation
Octal Hexadecimal 3217 6221 6271 2872 5470 B38 = 0 x X X X x x x x x x x x 211 = 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, 148 or C16.
13
Binary Coded Decimal Representation
Octal Hexadecimal 3217 6221 C91 3281 6321 CD1 3257 6271 CB9 2872 5470 B38 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, 148 or C16.
14
+21 -17 +14 -32 +31 Decimal Sign & Magnitude One’s Complement
Two’s Complement Excess 31 +21 -17 +14 -32 +31 Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 +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 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 +21 (convert to One’s Complement) Result = same as normal because it is positive = Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 +21 (convert to Two’s Complement) Result = same as normal because it is positive = Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 +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 = Bias = 31 = = Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 -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 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 -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 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 -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 = Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 -32 (Convert to Excess 31) Largest Negative Number = = - 31 Largest Positive Number = = + 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 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 -17 (convert to Sign & Magnitude) Sign = - = 1 17 convert to 5-bit representation = 10001 Result = Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 -17 (One’s Complement) Sign = - = 1 17 convert to 5-bit representation = 10001 Complement each bit = 01110 Result = Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 -17 (convert to Two’s Complement) Add One to One’s Complement = 01111 Result = Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 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
Decimal Sign & Magnitude One’s Complement Two’s Complement Excess 31 +21 010101 110100 -17 110001 101110 101111 001110 +14 101101 -32 N/A 100000 +31 011111 111110 -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 = Bias = 31 = = Complete the table below using 6-bit representation for sign and magnitude, ones’ complement, two’s complement, and excess 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
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 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
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
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: –
34
Fill in the following steps to find the representation for –17
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: – * 24
35
Fill in the following steps to find the representation for –17
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: = =
36
Fill in the following steps to find the representation for –17
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 = = = Fraction = (leading 1 of fraction is hidden) =
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. = 16110; 161 – 127 = 34; – * 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. = 12210; 122 – 127 = –5; 1.02 * 2–5 = * 2–5 = = * 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. = 12910; 129 – 127 = 2; * 22 = = 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. = 22410; 224 – 127 = 97; – * 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) b) c) C = C = C = V = V = V = d) e) f) 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) b) c) = C = 0 (no carry) C = 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) e) f) C = 1 C = 1 C = 1 V = 0 V = 1 V = 0
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.