Professional Documents
Culture Documents
Invitation To Computer Science 6Th Edition Schneider Solutions Manual Full Chapter PDF
Invitation To Computer Science 6Th Edition Schneider Solutions Manual Full Chapter PDF
Invitation To Computer Science 6Th Edition Schneider Solutions Manual Full Chapter PDF
1. (a) 1 x 42 + 3 x 4 + 3 = 31
(b) 3 x 82 + 6 x 8 + 7 = 247
4. (a) 23 = 00010111
(b) 55 = 00110111
(c) 275 = 100010011 but this exceeds 8 bits, resulting in an arithmetic overflow.
(b) 10000001
(c) 11010001 (81 = 64 + 16 + 1)
7. The magnitude 200 in binary is 11001000, which is 8 bits. However, since the
sign takes up one bit we only have 7 left for the magnitude, which means that 200
is too big to represent in 8-bits. This would cause an overflow error.
8. 511
9. 0 carry digit
0011100011
+ 0001101110
1
1 carry digit
0011100011
+ 0001101110
01
1 carry digit
0011100011
+ 0001101110
001
1 carry digit
0011100011
+ 0001101110
0001
0 carry digit
0011100011
+ 0001101110
10001
1 carry digit
0011100011
+ 0001101110
010001
1 carry digit
0011100011
+ 0001101110
Invitation to Computer Science, Sixth Edition 4-3
1010001
1 carry digit
0011100011
+ 0001101110
01010001
0 carry digit
0011100011
+ 0001101110
101010001
0011100011
+ 0001101110
0101010001
10.
11. (a) The mantissa is 0.111000000, which is +(1/2 + 1/4 + 1/8) = +7/8
The exponent is 0 00111 which is + (1 + 2 + 4) = +7
So, the overall value is +7/8 x 2+7 = +7/8 x 128 = +112.0
12. If we gave more bits to the mantissa we could represent our mantissa more
accurately, resulting in more significant digits. However, since we have fewer
digits for the exponent, we cannot represent exponents as large as before, resulting
in an inability to represent larger (or smaller, if the exponent is negative) numbers.
Essentially, we will get increased precision at the price of a decreased range.
14. There are 30 characters in “Invitation to Computer Science”, excluding the quotation
marks. In ASCII, each character takes 8 bits, for a total of 240 bits. Each character in
UNICODE takes 16 bits, for a total of 480 bits.
15. (a) A 3-minute song has 180 seconds in it. Each second is sampled 40,000 times (it
should be “samples/second”, not “bits/second”. So there are 7,200,000 samples taken.
Each sample is stored using 16 bits, thus the total number of bits (uncompressed) is
115,200,000. A compression scheme with a 5:1 ratio would reduce the size to
23,040,000 bits.
(b) RGB-color images use 3 bytes per pixel (one for each of the three color
contributions), a total of 24 bits per pixel. A 1,200 by 800 image has 960,000 pixels, so
in total it would use 23,040,000 bits. If it uses 2.4 Mbits, that means it uses 2,400,000
bits, so the compression ratio would be 9.6, or essentially 10:1.
17. (a) The word KAI would be 11101 00 10 in the variable length code given. It takes
9 bits, compared to 12 bits in the 4-bit encoding. The savings is 4:3, or about 1.33.
(b) MAUI would be 11100 00 11110 10 in the variable length code. It takes 14 bits,
compared to 16 bits in the 4-bit encoding. The savings is 8:7, or about 1.14.
(c) MOLOKAI would be 11100 0111 1111111 0111 11101 00 10 in the variable
length code. It takes 29 bits, compared to 28 bits in the 4-bit encoding. In this case, the
variable length code is actually longer, because it contains many less-frequent letters.
The “savings” is 28:29, or 0.97.
18. You can store fewer numbers in binary with the same number of places than you can
in decimal. For example with 8 digits in binary you can store the numbers 0 to 255, and
in decimal you can store 0 to 99999999. Other answers include the fact that the designers
of the computer hardware must work in binary, which is not a familiar numbering system,
and the fact that translation must be done between the external representation of numbers
(in decimal) and the internal representation of numbers (in binary).
20. The order of operations is unclear. You can use parenthesis to indicate which is to be
done first, or set the rules of precedence. Usually, AND is considered like multiplication,
Invitation to Computer Science, Sixth Edition 4-5
and takes precedence over OR, so we would consider the expression equivalent to ((a =
1) AND (b = 2)) OR (c = 3).
21. A truth table with k variables will always have 2k rows. So, when k = 5, our
truth table will have 25 = 32 rows.
Note: In all circuit diagrams we assume the existence of 3-input AND gates for
simplicity.
26. This is a difficult problem that will challenge the best students in the class. You have
to do several examples to determine the truth table. The truth table is:
a–b=
Next Borrow =
27. A multiplexor with 2N input lines has N selector lines, so a four-input multiplexor
will need 2 input lines and an eight-input multiplexor will need 3 input lines.
28. Suppose the input lines are labeled as i0, i1, i2, and i3 and the selector lines are labeled
(left to right) as s1 and s2. i0 will be the output if both s1 and s2 are zero, i1 will be the
output if s1 = 0 and s2 = 1. The Boolean expression for a 4-input multiplexor is
therefore
Invitation to Computer Science, Sixth Edition 4-8
The circuit is
29. Suppose the input lines are labeled as i1, i2, and i3, and the outputs are labeled Out0
through Out7. Out0 is turned on when i1, i2, and i3 are all zero, Out3 is on when i1 = 0, i2 =
1, and i3 = 1, and so forth. The circuit must have 8 subparts, one for each possible
combination of input values. Each part ANDs together a particular Boolean expression
like
and the result is the corresponding output line (Out3, in this case).
Invitation to Computer Science, Sixth Edition 4-9
1. Changes may really only be made to the 1-bit adder. However a small change
in the 1-bit adder will multiply to a larger effect in the overall circuit. An easy first step
is to have both the si and ci-1 outputs share the portion of the circuits that computes
a * b * c. There is no other reason to have two copies of that sub-circuit. That alone will
save two AND gates per 1-bit adder. For a 32-bit adder, it will save 64 x 2 transistors.
As an example of further simplifications, we can simplify in the si
calculation to be which takes 4 gates instead of 5. This will save 2
transistors per 1-bit adder, for a total of 64 transistors saved overall. Similar
simplifications may be done.
2. Students will need a good introductory resource for two’s complement, but otherwise
it should be a straightforward problem.
3. Given that jpeg images are often found on the Web, students should find this an
interesting topic.
Another random document with
no related content on Scribd:
Settlements were closed, and orders were sent to all Ningpo
men—and they form 50 per cent. of the population—to go out on
strike.
I shall look to the Yamên and see that these demands are fully
satisfied and with the least possible delay."
{98}
{99}
CHINA: A. D. 1899.
Anti-missionary outbreaks, increasing piracy, and other
signs of growing disorder in the country.
The ideas and the state of feeling out of which this attack on
the missionaries and their converts grew are revealed in the
following translation of a placard that was posted in Kienning
in June:
"We of this region have hitherto led a worthy life. All the
four castes (scholars, agriculturists, artizans, traders) have
kept the laws and done their duty. Of late foreigners have
suddenly come among us in a disorderly march and preaching
heretical doctrines. They have had from us indulgent
treatment, but they have repaid us by endangering our lives.
This year, in town and country, people have been hewn in two,
men and women in numbers have fallen upon evil days.
{100}
Everywhere the perpetrators have been seized, and everyone of
them has confessed that it was by the missionary chapels they
were ordered to go forth and slay men and women; to cut out
their brains and marrow to make into medicine. The officials
deliberately refrained from interfering. They garbled the
evidence and screened the malefactors. The whole country side
is filled with wrath; the officials then posted Proclamations,
and arrested spreaders of false reports. The hewing down of
men is hateful; but they issued no Proclamations forbidding
that. Now fortunately the people is of one mind in its wrath.
They have destroyed two chapels. The Ou-ning ruffian has
issued another Proclamation, holding this to be the work of
local rowdies. He little knows that our indignation is
righteous, and that it is a unanimous expression of feeling.
If the officials authorize the police to effect unjust
arrests, the people will unite in a body, in every street
business will be stopped, and the Wu-li missionary chapel will
be destroyed, while the officials themselves will be turned
out of the city, and the converts will be slain and
overthrown. When cutting grass destroy the roots at the same
time. Do not let dead ashes spring again into flame."
{101}
2. Great Britain, on her part, engages not to seek for her own
account, or on behalf of British subjects or of others, any
railway concessions to the north of the Great Wall of China,
and not to obstruct, directly or indirectly, applications for
railway concessions in that region supported by the Russian
Government. The two contracting parties, having nowise in view
to infringe in any way the sovereign rights of China or of
existing treaties, will not fail to communicate to the Chinese
Government the present arrangement, which, by averting all
cause of complication between them, is of a nature to
consolidate peace in the far East, and to serve the primordial
interests of China herself."
{102}
Spectator (London),
August 19, 1899.
"At the time when the Government of the United States was
informed by that of Germany that it had leased from His
Majesty the Emperor of China the port of Kiao-chao and the
adjacent territory in the province of Shantung, assurances
were given to the ambassador of the United States at Berlin by
the Imperial German minister for foreign affairs that the
rights and privileges insured by treaties with China to
citizens of the United States would not thereby suffer or be
in anywise impaired within the area over which Germany had
thus obtained control. More recently, however, the British
Government recognized by a formal agreement with Germany the
exclusive right of the latter country to enjoy in said leased
area and the contiguous 'sphere of influence or interest'
certain privileges, more especially those relating to
railroads and mining enterprises: but, as the exact nature and
extent of the rights thus recognized have not been clearly
defined, it is possible that serious conflicts of interest may
at any time arise, not only between British and German
subjects within said area, but that the interests of our
citizens may also be jeopardized thereby. Earnestly desirous
to remove any cause of irritation and to insure at the same
time to the commerce of all nations in China the undoubted
benefits which should accrue from a formal recognition by the
various powers claiming 'spheres of interest,' that they shall
enjoy perfect equality of treatment for their commerce and
navigation within such 'spheres,' the Government of the United
States would be pleased to see His German Majesty's Government
give formal assurances and lend its cooperation in securing
like assurances from the other interested powers that each
within its respective sphere of whatever influence—