Professional Documents
Culture Documents
Problems: (A) 757.2510 (B) 123.1710 (C) 356.8910 (D) 1063.510
Problems: (A) 757.2510 (B) 123.1710 (C) 356.8910 (D) 1063.510
1.4 (a) Convert to hexadecimal: 1457.1110.Round to two digits past the hexadecimal point.
(b) Convert your answer to binary, and then to octal.
(c) Devise a scheme for converting hexadecimal directly to base 4 and convert your
answer to base 4.
(d) Convert to decimal: DECA16.
1.6 Subtract in binary. Place a 1 over each column from which it was necessary to borrow.
1.7 Add the following numbers in binary using 2's complement to represent negative
numbers. Use a word length of 6 bits (including sign) and indicate if an overflow
occurs.
(a) 21 11 (b) (-14) + (-32) (c) (-25) + 18
(d) (-12) + 13 (e) (-11) + (-21)
Repeat (a), (c), (d), and (e) using I's complement to represent negative numbers.
1.8 A computer has a word length of 8 bits (including sign). If 2's complement is used to
represent negative numbers, what range of integers can be stored in the computer?
If I's complement is used? (Express your answers in decimal.)
1.9 Construct a table for 7-3-2-1weighted code and write 3659using this code.
1.14 Convert the decimal number 97.710into a number with exactly the same value rep-
resented in the followingbases.The exact value requires an infinite repeating part in
the fractional part of the number. Show the steps of your derivation.
(a) binary (b) octal (c) hexadecimal (d) base 3 (e) base 5
1.15 Devise a scheme for converting base 3 numbers directly to base 9. Use your method
to convert the followingnumber to base 9: 1110212.202113
1.16 Convert the following decimal numbers to octal and then to binary:
(a) 2983 63/64 (b) 93.70 (c) 298331/32 (d) 109.30
1.18 Subtract in binary. Place a 1 over each column from which it was necessary to borrow.
(a) 10100100- 01110011 (b) 10010011- 01011001
1.21 Assume three digits are used to represent positive integers and also assume the fol-
lowing operations are correct. Determine the base of the numbers. Did any of the
additions overflow?
(a) 654+ 013= 000
(b) 024+ 043+ 013+ 033= 223
(c) 024+ 043+ 013+ 033= 201
1.22 What is the lowest number of bits (digits) required in the binary number approxi-
mately equal to the decimal number 0.611710 so that the binary number has the same
or better precision?
1.25 (a) Show how to represent each of the numbers (5 1). (52 l). and (53 l)
base 5 numbers
(b) Generalize your answers to part (a) and show how to represent (b" —l) as
base b number, where b can be any integer larger than I and n any integer large!
than 0. Give a mathematical derivation of your result.
1.26 (a) Show that the number 121b,where b is any base greater than 2, is a perfect
square (i.e., it is equal to the square of some number).
(b) Repeat part (a) for the number 12321b,where b > 3.
(c) Repeat part (a) for the number 14641b,where b > 6.
(d) Repeat part (a) for the number 1234321b,where b > 4.
1.32 Construct a 5-2-2-1 weighted code for decimal digits. What numbers does Il 10 0110
represent in this code?
1.33 Construct a 7-3-2-1code for base 12 digits. Write B4A9 using this code.
1.34 (a) It is possible to have negative weights in a weighted code for the decimal digits,
e.g., 8, 4, —2,and —1can be used. Construct a table for this weighted code.
(b) If d is a decimal digit in this code, how can the code for 9 —d be obtained?
1.35 Convert to hexadecimal, and then give the ASCII code for the resulting hexadecimal
number (including the code for the hexadecimal point):
(a) 222.2210 (b) 183.8110
1.36 Repeat 1.7for the followingnumbers:
1.39 (a) A = 101010and B = 011101are I's complement numbers. Perform the follow-
ing operations and indicate whether overflow occurs.
(b) Repeat part (a) assuming the numbers are 2's complement numbers.
1.40 (a) Assume the integers below are I's complementintegers.Find the I's comple-
ment of each number, and give the decimal values of the original number and of
its complement.
(i) 0000000 (iii) 00110011 (iv) 1000000
(b) Repeat part (a) assuming the numbers are 2's complement numbers and finding
the 2's complement of them.
(a) Use this algorithm to convert GA720to base 10. (G2()is 1610.)
(b) Prove that this algorithm is valid.
(c) Consider converting a base 20 fraction, 0.d-1d_2 into a base
10
fraction. State an algorithm analogous to the one above for doing the conversion
(d) Apply your algorithm of part (c) to 0.FA720.
1.42 Let A and B be positive integers, and consider the addition of A and B in an n-bit
complement number system.
(a) Show that the addition of A and B produces the correct representation of the
sum if the magnitude of (A + B) is < 211
- 1 —1 but it produces a representation
of a negative number of magnitude 2'?—(A + B) if the magnitude of (A + B)
is > 2 '1- 1
(b) Show that the addition of A and (—B)always produces the correct representa_
tion of the sum. Consider both 'the case where A 2 B and the case A < B.
(c) Show that the addition of (2 1—A) + (211—B), with the carry from the signposi_
tion ignored, produces the correct 2's complement representation of —(A+ B) if
the magnitude of A + B is less than or equal to 221
- 1. Also, show that it produces
an incorrect sum representing the positive number 2'! —(A + B) if the magni_
tude of (A + B) > 2 -1.
1.43 Let A and B be integers and consider the addition of A and B in an n-bit I's comple_
ment number system.Prove that addition of A and B using the end-aroundcarry
produces the correct representation of the sum provided overflow does not occur.
Consider the four cases:A and B both positive, A positive and B negative with the
magnitude of A greater than the magnitude of B, A positive and B negative with the
magnitude ofA less than or equal to the magnitude of B, and A and B both negative.
1.44 Prove that in a 2's complement number system addition overflowsif and only if the
carry from the sign position does not equal the carry into the sign position. Consider
the three cases: adding two positive numbers,adding two negative numbers,and
adding two numbers of opposite sign.
1.45 Restate the method for detecting overflow of Problem 1.44so that it applies to I's
complementnumbers.
1.46 Let B = bn—l bn—2 • • • blb()be an n-bit 2's complement integer. Show that the deci-
mal value of B is —bn_pn I + bn_p n- + bn_32n- 3 + • • • + 1212+ (Hint: Con-
sider positive (bn 1 = 0) and negative (bn_l = 1) numbers separately, and note that
the magnitude of a negative number is obtained by subtractingeach bit fromI
(i.e., complementing each bit) and adding 1 to the result.)