-
Notifications
You must be signed in to change notification settings - Fork 1
/
datalab.ps
510 lines (504 loc) · 24.8 KB
/
datalab.ps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
%!PS-Adobe-2.0
%%Creator: dvips(k) 5.96.1 Copyright 2007 Radical Eye Software
%%Title: datalab.dvi
%%CreationDate: Sat Jun 2 11:33:56 2012
%%Pages: 4
%%PageOrder: Ascend
%%BoundingBox: 0 0 596 842
%%DocumentFonts: Times-Roman Times-Bold Courier Times-Italic CMSY10
%%DocumentPaperSizes: a4
%%EndComments
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips -o datalab.ps datalab.dvi
%DVIPSParameters: dpi=600
%DVIPSSource: TeX output 2012.06.02:1133
%%BeginProcSet: tex.pro 0 0
%!
/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72
mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0
0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{
landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize
mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[
matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round
exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{
statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0]
N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin
/FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array
/BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2
array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N
df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A
definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get
}B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub}
B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr
1 add N}if}B/CharBuilder{save 3 1 roll S A/base get 2 index get S
/BitMaps get S get/Cd X pop/ctr 0 N Cdx 0 Cx Cy Ch sub Cx Cw add Cy
setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx sub Cy .1 sub]{Ci}imagemask
restore}B/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn
/BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put
}if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{
bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A
mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{
SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{
userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X
1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4
index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N
/p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{
/Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT)
(LaserWriter 16/600)]{A length product length le{A length product exch 0
exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse
end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask
grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot}
imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round
exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto
fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p
delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M}
B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{
p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S
rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end
%%EndProcSet
%%BeginProcSet: 8r.enc 0 0
% File 8r.enc TeX Base 1 Encoding Revision 2.0 2002-10-30
%
% @@psencodingfile@{
% author = "S. Rahtz, P. MacKay, Alan Jeffrey, B. Horn, K. Berry,
% W. Schmidt, P. Lehman",
% version = "2.0",
% date = "27nov06",
% filename = "8r.enc",
% email = "tex-fonts@@tug.org",
% docstring = "This is the encoding vector for Type1 and TrueType
% fonts to be used with TeX. This file is part of the
% PSNFSS bundle, version 9"
% @}
%
% The idea is to have all the characters normally included in Type 1 fonts
% available for typesetting. This is effectively the characters in Adobe
% Standard encoding, ISO Latin 1, Windows ANSI including the euro symbol,
% MacRoman, and some extra characters from Lucida.
%
% Character code assignments were made as follows:
%
% (1) the Windows ANSI characters are almost all in their Windows ANSI
% positions, because some Windows users cannot easily reencode the
% fonts, and it makes no difference on other systems. The only Windows
% ANSI characters not available are those that make no sense for
% typesetting -- rubout (127 decimal), nobreakspace (160), softhyphen
% (173). quotesingle and grave are moved just because it's such an
% irritation not having them in TeX positions.
%
% (2) Remaining characters are assigned arbitrarily to the lower part
% of the range, avoiding 0, 10 and 13 in case we meet dumb software.
%
% (3) Y&Y Lucida Bright includes some extra text characters; in the
% hopes that other PostScript fonts, perhaps created for public
% consumption, will include them, they are included starting at 0x12.
% These are /dotlessj /ff /ffi /ffl.
%
% (4) hyphen appears twice for compatibility with both ASCII and Windows.
%
% (5) /Euro was assigned to 128, as in Windows ANSI
%
% (6) Missing characters from MacRoman encoding incorporated as follows:
%
% PostScript MacRoman TeXBase1
% -------------- -------------- --------------
% /notequal 173 0x16
% /infinity 176 0x17
% /lessequal 178 0x18
% /greaterequal 179 0x19
% /partialdiff 182 0x1A
% /summation 183 0x1B
% /product 184 0x1C
% /pi 185 0x1D
% /integral 186 0x81
% /Omega 189 0x8D
% /radical 195 0x8E
% /approxequal 197 0x8F
% /Delta 198 0x9D
% /lozenge 215 0x9E
%
/TeXBase1Encoding [
% 0x00
/.notdef /dotaccent /fi /fl
/fraction /hungarumlaut /Lslash /lslash
/ogonek /ring /.notdef /breve
/minus /.notdef /Zcaron /zcaron
% 0x10
/caron /dotlessi /dotlessj /ff
/ffi /ffl /notequal /infinity
/lessequal /greaterequal /partialdiff /summation
/product /pi /grave /quotesingle
% 0x20
/space /exclam /quotedbl /numbersign
/dollar /percent /ampersand /quoteright
/parenleft /parenright /asterisk /plus
/comma /hyphen /period /slash
% 0x30
/zero /one /two /three
/four /five /six /seven
/eight /nine /colon /semicolon
/less /equal /greater /question
% 0x40
/at /A /B /C
/D /E /F /G
/H /I /J /K
/L /M /N /O
% 0x50
/P /Q /R /S
/T /U /V /W
/X /Y /Z /bracketleft
/backslash /bracketright /asciicircum /underscore
% 0x60
/quoteleft /a /b /c
/d /e /f /g
/h /i /j /k
/l /m /n /o
% 0x70
/p /q /r /s
/t /u /v /w
/x /y /z /braceleft
/bar /braceright /asciitilde /.notdef
% 0x80
/Euro /integral /quotesinglbase /florin
/quotedblbase /ellipsis /dagger /daggerdbl
/circumflex /perthousand /Scaron /guilsinglleft
/OE /Omega /radical /approxequal
% 0x90
/.notdef /.notdef /.notdef /quotedblleft
/quotedblright /bullet /endash /emdash
/tilde /trademark /scaron /guilsinglright
/oe /Delta /lozenge /Ydieresis
% 0xA0
/.notdef /exclamdown /cent /sterling
/currency /yen /brokenbar /section
/dieresis /copyright /ordfeminine /guillemotleft
/logicalnot /hyphen /registered /macron
% 0xB0
/degree /plusminus /twosuperior /threesuperior
/acute /mu /paragraph /periodcentered
/cedilla /onesuperior /ordmasculine /guillemotright
/onequarter /onehalf /threequarters /questiondown
% 0xC0
/Agrave /Aacute /Acircumflex /Atilde
/Adieresis /Aring /AE /Ccedilla
/Egrave /Eacute /Ecircumflex /Edieresis
/Igrave /Iacute /Icircumflex /Idieresis
% 0xD0
/Eth /Ntilde /Ograve /Oacute
/Ocircumflex /Otilde /Odieresis /multiply
/Oslash /Ugrave /Uacute /Ucircumflex
/Udieresis /Yacute /Thorn /germandbls
% 0xE0
/agrave /aacute /acircumflex /atilde
/adieresis /aring /ae /ccedilla
/egrave /eacute /ecircumflex /edieresis
/igrave /iacute /icircumflex /idieresis
% 0xF0
/eth /ntilde /ograve /oacute
/ocircumflex /otilde /odieresis /divide
/oslash /ugrave /uacute /ucircumflex
/udieresis /yacute /thorn /ydieresis
] def
%%EndProcSet
%%BeginProcSet: texps.pro 0 0
%!
TeXDict begin/rf{findfont dup length 1 add dict begin{1 index/FID ne 2
index/UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll
exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]FontType 0
ne{/Metrics exch def dict begin Encoding{exch dup type/integertype ne{
pop pop 1 sub dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get
div def}ifelse}forall Metrics/Metrics currentdict end def}{{1 index type
/nametype eq{exit}if exch pop}loop}ifelse[2 index currentdict end
definefont 3 -1 roll makefont/setfont cvx]cvx def}def/ObliqueSlant{dup
sin S cos div neg}B/SlantFont{4 index mul add}def/ExtendFont{3 -1 roll
mul exch}def/ReEncodeFont{CharStrings rcheck{/Encoding false def dup[
exch{dup CharStrings exch known not{pop/.notdef/Encoding true def}if}
forall Encoding{]exch pop}{cleartomark}ifelse}if/Encoding exch def}def
end
%%EndProcSet
%%BeginFont: CMSY10
%!PS-AdobeFont-1.1: CMSY10 1.0
%%CreationDate: 1991 Aug 15 07:20:57
% Copyright (C) 1997 American Mathematical Society. All Rights Reserved.
11 dict begin
/FontInfo 7 dict dup begin
/version (1.0) readonly def
/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def
/FullName (CMSY10) readonly def
/FamilyName (Computer Modern) readonly def
/Weight (Medium) readonly def
/ItalicAngle -14.035 def
/isFixedPitch false def
end readonly def
/FontName /CMSY10 def
/PaintType 0 def
/FontType 1 def
/FontMatrix [0.001 0 0 0.001 0 0] readonly def
/Encoding 256 array
0 1 255 {1 index exch /.notdef put} for
dup 15 /bullet put
readonly def
/FontBBox{-29 -960 1116 775}readonly def
currentdict end
currentfile eexec
D9D66F633B846A97B686A97E45A3D0AA052F09F9C8ADE9D907C058B87E9B6964
7D53359E51216774A4EAA1E2B58EC3176BD1184A633B951372B4198D4E8C5EF4
A213ACB58AA0A658908035BF2ED8531779838A960DFE2B27EA49C37156989C85
E21B3ABF72E39A89232CD9F4237FC80C9E64E8425AA3BEF7DED60B122A52922A
221A37D9A807DD01161779DDE7D31FF2B87F97C73D63EECDDA4C49501773468A
27D1663E0B62F461F6E40A5D6676D1D12B51E641C1D4E8E2771864FC104F8CBF
5B78EC1D88228725F1C453A678F58A7E1B7BD7CA700717D288EB8DA1F57C4F09
0ABF1D42C5DDD0C384C7E22F8F8047BE1D4C1CC8E33368FB1AC82B4E96146730
DE3302B2E6B819CB6AE455B1AF3187FFE8071AA57EF8A6616B9CB7941D44EC7A
71A7BB3DF755178D7D2E4BB69859EFA4BBC30BD6BB1531133FD4D9438FF99F09
4ECC068A324D75B5F696B8688EEB2F17E5ED34CCD6D047A4E3806D000C199D7C
515DB70A8D4F6146FE068DC1E5DE8BC5703711DA090312BA3FC00A08C453C609
C627A8BECD6E1FA14A3B02476E90AAD8B4700C400380BC9AFFBF7847EB28661B
9DC3AA0F44C533F2E07DCC4DE19D367BF223E33DC321D0247A0E6EF6ABC8FA52
15AE044094EF678A8726CD7C011F02BFF8AB6EAEEE391AD837120823BED0B5D8
F8B15245377871A64F78378BB4330149D6941F7A86FBFFC49B93C94155F5FA7D
F22E7214511C0A92693F4CDBF38411651540572F2DD70D924AE0F18E1CD581F3
C871399127FF5D07A868885B5FF7CDEB50B8323B2533DEF8DC973B1AE84FA0A2
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
cleartomark
%%EndFont
TeXDict begin 39158280 55380996 1000 600 600 (datalab.dvi)
@start /Fa 240[45 15[{}1 90.9091 /CMSY10 rf /Fb 202[45
45 45 2[45 48[{TeXBase1Encoding ReEncodeFont}4 90.9091
/Times-Bold rf /Fc 184[53 3[49 67[{TeXBase1Encoding ReEncodeFont}2
72.7272 /Times-Roman rf /Fd 134[40 4[25 35 35 2[45 45
1[25 2[25 45 45 1[40 3[45 50[23 46[{TeXBase1Encoding ReEncodeFont}13
90.9091 /Times-Italic rf /Fe 103[55 15[55 11[55 3[55
1[55 55 55 55 55 1[55 55 55 55 55 55 1[55 55 1[55 55
55 55 55 55 6[55 7[55 1[55 2[55 7[55 55 2[55 2[55 1[55
12[55 55 55 1[55 4[55 4[55 33[{TeXBase1Encoding ReEncodeFont}38
90.9091 /Courier rf /Ff 105[45 1[40 40 24[40 45 45 66
45 45 25 35 30 45 45 45 45 71 25 45 25 25 45 45 30 40
45 40 45 40 7[66 1[86 66 66 56 51 61 1[51 66 66 81 56
1[35 30 66 1[51 56 66 61 1[66 5[25 25 1[45 45 1[45 45
45 45 45 45 1[23 30 23 2[30 30 30 35[51 51 2[{
TeXBase1Encoding ReEncodeFont}67 90.9091 /Times-Roman
rf /Fg 134[60 60 1[60 66 40 47 53 2[60 66 100 33 2[33
66 60 40 53 66 53 66 60 16[73 93 2[80 2[47 93 93 1[80
3[86 65[{TeXBase1Encoding ReEncodeFont}28 119.552 /Times-Bold
rf /Fh 138[72 40 56 48 1[72 1[72 112 40 2[40 1[72 1[64
2[72 64 13[80 5[128 88 8[96 96 104 6[40 5[72 1[72 72
72 3[36 44[{TeXBase1Encoding ReEncodeFont}25 143.462
/Times-Roman rf end
%%EndProlog
%%BeginSetup
%%Feature: *Resolution 600dpi
TeXDict begin
%%BeginPaperSize: a4
/setpagedevice where
{ pop << /PageSize [595 842] >> setpagedevice }
{ /a4 where { pop a4 } if }
ifelse
%%EndPaperSize
end
%%EndSetup
%%Page: 1 1
TeXDict begin 1 0 bop 1257 937 a Fh(CS)36 b(2400,)e(Summer)g(2012)815
1120 y(Lab)h(Assignment)e(L1:)44 b(Manipulating)33 b(Bits)0
1843 y Fg(Intr)n(oduction)0 2089 y Ff(The)20 b(purpose)j(of)e(this)g
(assignment)i(is)e(to)g(become)g(more)g(f)o(amiliar)h(with)f(bit-le)n
(v)o(el)h(representations)k(and)21 b(manipulations.)0
2202 y(Y)-10 b(ou')o(ll)26 b(do)f(this)g(by)g(solving)i(a)e(series)h
(of)f(programming)i(\223puzzles.)-6 b(\224)35 b(Man)o(y)25
b(of)g(these)h(puzzles)h(are)e(quite)h(arti\002cial,)g(b)n(ut)0
2315 y(you')o(ll)f(\002nd)e(yourself)j(thinking)g(much)d(more)h(about)h
(bits)f(in)f(w)o(orking)i(your)f(w)o(ay)g(through)h(them.)0
2647 y Fg(Logistics)0 2893 y Ff(Y)-10 b(ou)24 b(need)g(to)g(w)o(ork)g
(by)g(yourself)i(on)e(this)h(assignment)h(b)n(ut)f(you)f(may)g(ask)g
(for)g(assistance)j(in)d(tools)h(and)f(the)g(process)i(of)0
3006 y(compiling)h(your)f(programs.)35 b(Y)-10 b(ou)25
b(shouldn')n(t)j(ask)d(other)h(students)i(for)d(help)h(about)g(the)g
(substance)h(of)e(the)h(assignment)0 3119 y(\226)31 b(you')-5
b(re)32 b(going)h(to)e(ha)n(v)o(e)g(to)g(understand)j(the)d(problems)i
(well)e(enough)h(to)f(be)g(intervie)n(wed)i(about)g(them.)51
b(The)30 b(only)0 3232 y(\223hand-in\224)25 b(will)d(be)g(electronic.)
31 b(An)o(y)22 b(clari\002cations)j(and)e(re)n(visions)h(to)e(the)h
(assignment)h(will)e(be)h(posted)h(on)e(the)g(course)0
3345 y(Moodle)j(page.)0 3676 y Fg(Getting)30 b(r)n(eady)g(f)m(or)g(the)
g(next)g(assignment)0 3923 y Ff(This)24 b(is)g(the)g(only)h(lab)g(or)f
(programming)i(assignment)h(where)d(you')o(ll)i(be)e(w)o(orking)i(on)e
(your)h(o)n(wn.)30 b(Please)25 b(use)f(the)h(ne)o(xt)0
4035 y(tw)o(o)i(weeks)h(to)g(meet)g(and)g(talk)g(with)f(people)j(in)d
(class.)42 b(F)o(or)27 b(the)h(ne)o(xt)g(assignment,)j(you')o(ll)e(be)f
(ask)o(ed)h(to)e(w)o(ork)h(with)f(a)0 4148 y(programming)22
b(partner;)h(we)18 b(encourage)23 b(you)d(to)f(use)h(the)g(\223Extreme)
g(Programming\224)i(style.)28 b(W)-7 b(e')i(re)20 b(doing)h(this)f
(because)0 4261 y(the)26 b(ne)o(xt)h(sequence)h(of)e(assignments)j(are)
d(actually)i(v)o(ery)f(dif)n(\002cult)g(to)f(do)g(without)h(someone)g
(to)f(talk)h(with)f(and)g(reason)0 4374 y(with.)j(These)23
b(labs)i(are)e(learning)j(mechanisms,)f(and)f(w)o(orking)h(together)g
(will)e(help)i(with)e(that)h(learning.)0 4706 y Fg(Hand)31
b(Out)f(Instructions)0 4952 y Ff(Y)-10 b(ou)28 b(need)h(to)f(use)g(a)g
(Linux)g(system)h(for)f(this)h(lab)f(because)i(there)f(is)f(a)g
(\223pre-b)n(uilt\224)j(binary)e(that)g(only)g(runs)g(on)f(Linux.)0
5065 y(Y)-10 b(ou)24 b(had)g(tw)o(o)f(options)j(to)e(do)g(this)g(lab)l
(.)31 b(The)23 b(\002rst)h(w)o(ould)g(be)g(to)g(do)n(wnload)h(the)f
(\002les)g(in)f Fe(datalab-handout.)o(ta)o(r)0 5178 y
Ff(at)h(the)g(assignment)i(page)e(and)g(unpack)i(them)e(on)g(your)g(o)n
(wn)f(or)h(a)f(CSEL)e(linux)k(machine.)31 b(The)23 b(second)j(is)d(do)n
(wnload)i(a)0 5291 y(VMw)o(are)e(image)h(that)g(contains)i(a)d(Linux)h
(en)l(vironment)i(and)e(the)g(assignment,)i(unpack)o(ed.)1924
5712 y(1)p eop end
%%Page: 2 2
TeXDict begin 2 1 bop 0 573 a Ff(If)25 b(you)g(use)h(the)f(tar)g
(\002le,)f(start)i(by)f(cop)o(ying)i Fe(datalab-handout)o(.t)o(ar)18
b Ff(to)24 b(a)h(\(protected\))j(directory)f(in)e(which)g(you)0
686 y(plan)g(to)f(do)h(your)g(w)o(ork.)31 b(Then)24 b(gi)n(v)o(e)g(the)
h(command:)31 b Fe(tar)53 b(xvf)h(datalab-handou)o(t.)o(ta)o(r)p
Ff(.)24 b(This)g(will)g(cause)h(a)0 799 y(number)f(of)g(\002les)f(to)h
(be)f(unpack)o(ed)j(in)e(the)g(directory)-6 b(.)0 951
y(The)23 b(only)h(\002le)f(you)h(will)g(be)f(modifying)j(and)e(turning)
h(in)f(is)f Fe(bits.c)p Ff(.)0 1103 y(The)c(\002le)f
Fe(btest.c)d Ff(allo)n(ws)20 b(you)f(to)g(e)n(v)n(aluate)i(the)e
(functional)j(correctness)g(of)d(your)h(code.)28 b(The)19
b(\002le)f Fe(README)e Ff(contains)0 1216 y(additional)24
b(documentation)h(about)e Fe(btest)p Ff(.)i(Use)c(the)h(command)g
Fe(make)52 b(btest)19 b Ff(to)i(generate)j(the)d(test)h(code)h(and)f
(run)0 1329 y(it)h(with)g(the)h(command)g Fe(./btest)p
Ff(.)g(The)f(\002le)g Fe(dlc)e Ff(is)i(a)g(compiler)h(binary)h(that)f
(you)f(can)h(use)g(to)f(check)h(your)g(solutions)0 1442
y(for)g(compliance)i(with)d(the)h(coding)h(rules.)30
b(The)23 b(remaining)i(\002les)e(are)h(used)g(to)g(b)n(uild)h
Fe(btest)p Ff(.)0 1594 y(Looking)31 b(at)e(the)h(\002le)e
Fe(bits.c)e Ff(you')o(ll)31 b(notice)g(a)e(C)f(structure)k
Fe(team)26 b Ff(into)k(which)g(you)g(should)h(insert)g(the)e(requested)
0 1706 y(identifying)j(information.)46 b(Do)28 b(this)h(right)h(a)o(w)o
(ay)e(so)h(you)g(don')n(t)h(for)n(get.)46 b(Despite)29
b(the)g(description)j(in)c(the)h(\002le,)g(we')-5 b(re)0
1819 y(not)24 b(using)h(programming)g(teams)f(and)g(you')-5
b(re)26 b(e)o(xpected)f(to)e(w)o(ork)h(out)g(your)g(o)n(wn)f
(solutions.)0 1971 y(The)k Fe(bits.c)c Ff(\002le)k(also)g(contains)j(a)
c(sk)o(eleton)k(for)d(each)h(of)f(the)g(15)g(programming)i(puzzles.)42
b(Y)-10 b(our)27 b(assignment)i(is)e(to)0 2084 y(complete)i(each)g
(function)h(sk)o(eleton)h(using)e(only)g Fd(str)o(aightline)i
Ff(code)e(\(i.e.,)f(no)g(loops)h(or)f(conditionals\))k(and)d(a)e
(limited)0 2197 y(number)f(of)f(C)f(arithmetic)j(and)f(logical)h
(operators.)36 b(Speci\002cally)-6 b(,)27 b(you)f(are)f
Fd(only)h Ff(allo)n(wed)g(to)f(use)h(the)f(follo)n(wing)i(eight)0
2310 y(operators:)55 2524 y Fe(!)54 b(\230)g(&)g(\210)g(|)g(+)g(<<)g
(>>)0 2737 y Ff(A)23 b(fe)n(w)g(of)g(the)h(functions)j(further)e
(restrict)h(this)e(list.)30 b(Also,)23 b(you)i(are)f(not)g(allo)n(wed)g
(to)g(use)g(an)o(y)g(constants)i(longer)g(than)e(8)0
2850 y(bits.)29 b(See)23 b(the)h(comments)h(in)e Fe(bits.c)d
Ff(for)k(detailed)h(rules)g(and)f(a)f(discussion)j(of)e(the)g(desired)h
(coding)g(style.)0 3179 y Fg(Ev)o(aluation)0 3425 y Ff(Y)-10
b(ou)29 b(will)f(be)h(e)n(v)n(aluated)i(for)f(tw)o(o)e(things)j(-)d(ha)
n(ving)j(w)o(orking)f(code)g(and)g(\(more)f(importantly\))j(the)d
(ability)i(to)d(e)o(xplain)0 3538 y(why)23 b(your)h(code)h(is)e
(correct.)30 b(This)24 b(latter)g(e)o(xplanation)j(will)c(tak)o(e)h
(place)h(in)e(a)g(grading)j(meeting)e(with)g(the)f(instructor)-5
b(.)0 3690 y(Y)-10 b(our)24 b(code)g(will)f(be)h(compiled)h(with)g
Fc(G)t(C)t(C)g Ff(and)f(run)g(and)g(tested)h(on)e(one)h(of)g(the)f
(class)i(vmw)o(are)f(machines.)0 3842 y(Y)-10 b(our)23
b(\223Correctness\224)j(score)d(will)g(be)f(computed)j(out)e(of)g(a)f
(maximum)h(of)f(75)h(points)h(based)g(on)f(the)g(follo)n(wing)h
(distrib)n(u-)0 3955 y(tion:)0 4168 y Fb(40)46 b Ff(Correctness)26
b(of)e(code)g(running)i(on)d(one)h(of)g(the)g(class)g(machines.)0
4351 y Fb(30)46 b Ff(Performance)26 b(of)d(code,)h(based)h(on)e(number)
i(of)e(operators)j(used)f(in)e(each)h(function.)0 4533
y Fb(5)46 b Ff(Style)31 b(points,)i(based)f(on)f(your)h(instructor')-5
b(s)34 b(subjecti)n(v)o(e)e(e)n(v)n(aluation)i(of)c(the)h(quality)i(of)
d(your)i(solutions)h(and)e(your)227 4646 y(comments.)0
4859 y(The)22 b(15)h(puzzles)h(you)f(must)g(solv)o(e)g(ha)n(v)o(e)g
(been)g(gi)n(v)o(en)g(a)f(dif)n(\002culty)i(rating)g(between)g(1)e(and)
h(4,)f(such)h(that)g(their)g(weighted)0 4972 y(sum)j(totals)i(to)e(40.)
38 b(W)-7 b(e)26 b(will)g(e)n(v)n(aluate)i(your)f(functions)i(using)f
(the)f(test)g(ar)n(guments)h(in)f Fe(btest.c)p Ff(.)33
b(Y)-10 b(ou)27 b(will)f(get)g(full)0 5085 y(credit)g(for)g(a)f(puzzle)
h(if)f(it)g(passes)i(all)e(of)h(the)f(tests)h(performed)h(by)f
Fe(btest.c)p Ff(,)21 b(half)26 b(credit)g(if)f(it)g(f)o(ails)h(one)g
(test,)g(and)g(no)0 5198 y(credit)f(otherwise.)0 5350
y(Re)o(garding)30 b(performance,)j(our)d(main)f(concern)i(at)e(this)h
(point)g(in)f(the)h(course)g(is)f(that)h(you)g(can)f(get)h(the)f(right)
i(answer)-5 b(.)0 5463 y(Ho)n(we)n(v)o(er)l(,)26 b(we)f(w)o(ant)h(to)g
(instill)h(in)f(you)h(a)e(sense)i(of)f(k)o(eeping)i(things)g(as)e
(short)h(and)f(simple)h(as)f(you)g(can.)37 b(Furthermore,)1924
5712 y(2)p eop end
%%Page: 3 3
TeXDict begin 3 2 bop 0 573 a Ff(some)20 b(of)g(the)h(puzzles)h(can)e
(be)g(solv)o(ed)i(by)e(brute)h(force,)h(b)n(ut)e(we)g(w)o(ant)g(you)g
(to)g(be)h(more)f(cle)n(v)o(er)-5 b(.)28 b(Thus,)21 b(for)f(each)h
(function)0 686 y(we')-5 b(v)o(e)23 b(established)j(a)d(maximum)f
(number)i(of)f(operators)i(that)e(you)h(are)f(allo)n(wed)g(to)g(use)g
(for)g(each)h(function.)30 b(This)23 b(limit)0 799 y(is)g(v)o(ery)g
(generous)j(and)d(is)g(designed)j(only)e(to)f(catch)h(e)o(gre)o
(giously)h(inef)n(\002cient)g(solutions.)31 b(Y)-10 b(ou)23
b(will)g(recei)n(v)o(e)h(tw)o(o)e(points)0 912 y(for)i(each)g(function)
i(that)e(satis\002es)g(the)g(operator)i(limit.)0 1064
y(Finally)-6 b(,)35 b(we')-5 b(v)o(e)32 b(reserv)o(ed)h(5)f(points)h
(for)f(a)f(subjecti)n(v)o(e)j(e)n(v)n(aluation)h(of)c(the)h(style)h(of)
f(your)h(solutions)h(and)e(your)h(com-)0 1177 y(menting.)59
b(Y)-10 b(our)34 b(solutions)i(should)f(be)e(as)g(clean)i(and)f
(straightforw)o(ard)j(as)c(possible.)60 b(Y)-10 b(our)34
b(comments)g(should)h(be)0 1289 y(informati)n(v)o(e,)25
b(b)n(ut)f(the)o(y)g(need)g(not)g(be)g(e)o(xtensi)n(v)o(e.)0
1621 y Fg(Pr)n(oblems)0 1867 y Ff(The)35 b Fe(bits.c)d
Ff(\002le)i(describes)k(a)d(set)h(of)f(functions)j(that)e(manipulate)h
(and)f(test)g(sets)f(of)h(bits.)64 b(Each)36 b(problem)g(as)f(a)0
1980 y(\223Rating\224)30 b(and)f(a)g(speci\002ed)h(\223Max)f(ops\224.)
45 b(The)28 b(\223Rating\224)j(\002eld)d(gi)n(v)o(es)h(the)g(dif)n
(\002culty)h(rating)g(\(the)g(number)g(of)e(points\))0
2093 y(for)e(the)h(puzzle,)h(and)f(the)f(\223Max)h(ops\224)g(\002eld)f
(gi)n(v)o(es)g(the)h(maximum)f(number)h(of)f(operators)j(you)e(are)f
(allo)n(wed)h(to)f(use)h(to)0 2206 y(implement)e(each)f(function.)0
2358 y(F)o(or)j(e)o(xample,)i(function)h Fe(isZero)25
b Ff(determines)30 b(if)d(the)h(ar)n(gument)i(is)e(zero.)42
b(Other)28 b(problems)i(deal)e(with)g(tw)o(o')-5 b(s)28
b(com-)0 2471 y(plement)d(arithmetic.)30 b(The)o(y)23
b(tend)i(to)e(be)h(harder)h(and)f(need)g(more)f(steps.)0
2623 y(The)g(problems)i(are)f(ordered)h(by)f(comple)o(xity;)i(do)d(the)
h(earlier)h(problems)g(\002rst.)0 2955 y Fg(Advice)0
3201 y Ff(Y)-10 b(ou)29 b(should)h(do)f(your)h(de)n(v)o(elopment)h
(using)f(the)f(virtual)i(machine)f(we)e(pro)o(vided)j(or)e(something)i
(similar)-5 b(.)45 b(Just)30 b(mak)o(e)0 3314 y(sure)23
b(that)f(the)g(v)o(ersion)i(you)e(turn)h(in)f(compiles)h(and)f(runs)h
(correctly)h(on)e(our)h(class)g(machines)g(\()p Fd(i.e)o(.)28
b Ff(the)22 b(CSEL)d(machines)0 3427 y(or)k(you)i(VMw)o(are)d(image\).)
30 b(If)23 b(it)g(doesn')n(t)j(compile,)e(we)f(can')n(t)i(grade)g(it.)0
3579 y(The)31 b Fe(dlc)f Ff(program,)k(a)d(modi\002ed)i(v)o(ersion)g
(of)e(an)h(ANSI)e(C)g(compiler)l(,)35 b(will)d(be)f(used)i(to)e(check)i
(your)g(programs)g(for)0 3692 y(compliance)26 b(with)d(the)h(coding)h
(style)g(rules.)k(The)23 b(typical)j(usage)e(is)0 3919
y Fe(./dlc)52 b(bits.c)0 4145 y Ff(T)-7 b(ype)22 b Fe(./dlc)52
b(-help)19 b Ff(for)k(a)f(list)g(of)g(command)h(line)g(options.)30
b(The)22 b(README)d(\002le)j(is)g(also)h(helpful.)30
b(Some)21 b(notes)j(on)0 4258 y Fe(dlc)p Ff(:)136 4485
y Fa(\017)46 b Ff(The)23 b Fe(dlc)f Ff(program)i(runs)h(silently)g
(unless)g(it)e(detects)j(a)d(problem.)136 4673 y Fa(\017)46
b Ff(Don')n(t)21 b(include)h Fe(<stdio.h>)15 b Ff(in)20
b(your)h Fe(bits.c)16 b Ff(\002le,)k(as)g(it)g(confuses)i
Fe(dlc)c Ff(and)i(results)i(in)e(some)g(non-intuiti)n(v)o(e)227
4786 y(error)25 b(messages.)0 5012 y(Check)j(the)g(\002le)e
Fe(README)e Ff(for)k(documentation)j(on)d(running)h(the)f
Fe(btest)c Ff(program.)42 b(Y)-10 b(ou')o(ll)28 b(\002nd)f(it)g
(helpful)i(to)f(w)o(ork)0 5125 y(through)f(the)d(functions)k(one)d(at)f
(a)g(time,)h(testing)h(each)f(one)g(as)g(you)g(go.)32
b(Y)-10 b(ou)24 b(can)h(use)g(the)g Fe(-f)e Ff(\003ag)h(to)h(instruct)h
Fe(btest)0 5238 y Ff(to)d(test)h(only)h(a)e(single)i(function,)g(e.g.,)
e Fe(./btest)51 b(-f)j(isPositive)p Ff(.)1924 5712 y(3)p
eop end
%%Page: 4 4
TeXDict begin 4 3 bop 0 573 a Fg(Hand)31 b(In)e(Instructions)0
819 y Ff(Use)23 b(the)h(Moodle)g(assignment)i(page)f(to)e(upload)i
(your)g Fe(bits.c)20 b Ff(\002le.)136 1071 y Fa(\017)46
b Ff(Mak)o(e)24 b(sure)g(you)g(ha)n(v)o(e)h(included)g(your)g
(identifying)h(information)g(in)e(your)g(\002le)f Fe(bits.c)p
Ff(.)136 1258 y Fa(\017)46 b Ff(Remo)o(v)o(e)23 b(an)o(y)h(e)o
(xtraneous)i(print)f(statements.)1924 5712 y(4)p eop
end
%%Trailer
userdict /end-hook known{end-hook}if
%%EOF