Assume ASCII encoding of characters, and a 2’s complement encoding of negative n
ID: 3782714 • Letter: A
Question
Assume ASCII encoding of characters, and a 2’s complement encoding of negative numbers. Recall what you have learned about 2’s complement encoding from other courses. When representing a number in hexadecimal or binary, use the proper number of digits for the TM4C123 architecture (depends on type of variable). The first row has been completed for you.
signed charx 60 unsigned charx 'S'; unsigned charx E unsigned charx 1'; unsigned charx 8'; shortx 0x288 short x 0XEECE signed char x 0b00111001 unsigned short x 0x2050 0x2041; signed char x 0x8 4 signed char x 0x68 8; signed short x signed short x 128 signed char x 20 signed charx -1; unsigned charx 15 x (decimal) 60 Value of x x (hex) 0x3c x (binary) 0b0011 1100Explanation / Answer
x (decimal)
X (hex)
X (binary)
Signed char x = 60
60
0x3c
0b00111100
Unsigned char x = ‘S’
83
0x53
0b 01010011
Unsigned char x = ‘E’
69
0x45
0b 01000101
Unsigned char x = ‘1’
49
0x31
0b 00110001
Unsigned char x = ‘8’
56
0x38
0b 00111000
Short x = 0x288
648
0x0288
0b0000001010001000
Short x = 0xEECE
61134
0xEECE
0b1110111011001110
Signed char x = 0b00111001
57
0x39
0b00111001
Unsigned short x = 0x2050 + 0x2041
16529
0x4091
0b01000000 10010001
Signed char x = 0x8 + 4
12
0xc
0b00001100
Signed char x = 0x68/8
13
0xd
0b00001101
Signed short x = -1
-1
0xffff
0b11111111 11111111
Signed short x = -128
-128
0xff80
0b11111111 10000000
Signed char x = 20
20
0x14
0b00100100
Signed char x = -1
-1
0xff
0b11111111
Unsigned char x = 15
15
0x0f
0b00001111
x (decimal)
X (hex)
X (binary)
Signed char x = 60
60
0x3c
0b00111100
Unsigned char x = ‘S’
83
0x53
0b 01010011
Unsigned char x = ‘E’
69
0x45
0b 01000101
Unsigned char x = ‘1’
49
0x31
0b 00110001
Unsigned char x = ‘8’
56
0x38
0b 00111000
Short x = 0x288
648
0x0288
0b0000001010001000
Short x = 0xEECE
61134
0xEECE
0b1110111011001110
Signed char x = 0b00111001
57
0x39
0b00111001
Unsigned short x = 0x2050 + 0x2041
16529
0x4091
0b01000000 10010001
Signed char x = 0x8 + 4
12
0xc
0b00001100
Signed char x = 0x68/8
13
0xd
0b00001101
Signed short x = -1
-1
0xffff
0b11111111 11111111
Signed short x = -128
-128
0xff80
0b11111111 10000000
Signed char x = 20
20
0x14
0b00100100
Signed char x = -1
-1
0xff
0b11111111
Unsigned char x = 15
15
0x0f
0b00001111
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.