Introduction to Computing Systems (1 st Exam)

advertisement
Introduction to Computing Systems (1st Exam)
1. [10] What is the range of decimal integers that can be represented by the
following given numbers of bits?
(a) 1
(b) 2
(c) 4
(d) 8
(e) 12
(a) [-1,0]
(b) [-2,-1,0,1]
(c) [-8,-7,…,6,7]
(d) [-128~+127]
(e) [-2048~+2047]
2. [15] Convert the following decimal numbers to 8-bit 2’s complement binary
numbers.
(a) 0
(b) 65
(c) 127
(d) -64
(e) -128
(a) 00000000
(b) 01000001
(c) 01111111
(d) 11000000
(e) 10000000
3. [15] Convert the following 2’s complement binary numbers to decimal
numbers.
(a) 11111010
(b) 01011000
(c) xFE
(d) x81
(e) x6F
(a) -6
(b) 88
(c) -2
(d) -127
(e) 111
4. [20] Compute the following operations on decimal numbers by the addition
of 2’s complement numbers. Assume that 8 bits are used for a 2’s
complement binary number. Express the results in 2’s complement
notation.
(a) 32+56
(b) 32-56
(c) -32+56
(d) -32-56
(e) -(32+56)
32=00100000 -32=11100000
56=00111000 -56=11001000
(a) 32+56=00100000
+00111000
01011000→01011000
(b) 32-56=32+(-56)=00100000
+11001000
11101000→11101000
(c) -32+56=(-32)+56=11100000
+00111000
100011000→00011000
(d) -32-56=(-32)+(-56)=11100000
+11001000
110101000→10101000
(e) (32+56)=00100000
+00111000
01011000
-(32+56)=10101000
5. [15] Write the decimal equivalents for these IEEE floating point numbers.
(a) 01000001011000000000000000000000
(b) 11100000010100000000000000000000
(c) xC1140000
(a) (−1)0 ∙ 2(10000010−127) ∙ 1.112 = 1.75 × 23
(b) (−1)1 ∙ 2(11000000−127) ∙ 1.1012 = −1.625 × 265
(c) xC1140000 =1 10000010 00101000000000000000000
= (−1)1 ∙ 2(10000010−127) ∙ 1.001012
≒ −1.156 × 23
6. [10] Convert these decimal numbers to IEEE floating point numbers. Express
the results in hexadecimal notation.
(a) 9.25
(b) −𝟐−𝟏𝟒𝟖
(a) 9.25 = 1001.01 = 1.00101 × 23
→0100 0001 0001 0100 0000 0000 0000 0000
→x41140000
(b) −2−148 = (−1) × 2−126 × 2−22
→1000 0000 0000 0000 0000 0000 0000 0010
→x80000002
7. [15] Assume that each character is represented by a parity-check bit
followed by its corresponding ASCII code, and that even parity policy is
adopted.
(a) [10] Convert the character string “How are you?” to a binary string of
ASCII codes. Express the result is hexadecimal notation.
(b) [5] Suppose your e-mail system receives the following binary string
x4869ACA0B721. What is the character string to appear on your
screen?
(a) x486F77A0E17265A0F96FF53F
H:48
o:6F
w:77
sp:A0
a:E1
r:72
e:65
sp:A0
y:F9
o:6F
u:F5
?:3F
(b) “Hi, 7!”
Download