📄 datalab.ps
字号:
%%EndProcSet%%BeginProcSet: texps.pro%!TeXDict begin/rf{findfont dup length 1 add dict begin{1 index/FID ne 2index/UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 rollexec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]/Metricsexch def dict begin Encoding{exch dup type/integertype ne{pop pop 1 subdup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get div def}ifelse}forall Metrics/Metrics currentdict end def[2 index currentdictend 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 -1roll mul exch}def/ReEncodeFont{CharStrings rcheck{/Encoding false defdup[exch{dup CharStrings exch known not{pop/.notdef/Encoding true def}if}forall Encoding{]exch pop}{cleartomark}ifelse}if/Encoding exch def}def end%%EndProcSetTeXDict begin 40258431 52099146 1000 600 600 (datalab.dvi)@start%DVIPSBitmapFont: Fa cmmi10 10.95 1/Fa 1 111 df<01F8EB0FF0D803FEEB3FFC3A078F80F03E3A0F0F83C01F3B0E07C7800F80001CEBCF0002FE80003C5B00385B495A127800705BA200F049131F011F5D00005BA2163F013F92C7FC91C7FC5E167E5B017E14FE5EA201FE0101EB03804914F8A203031307000103F013005B170E16E000035E49153C17385F0007913801F1E0496DB45AD801C0023FC7FC31297EA737>110 D E%EndDVIPSBitmapFont%DVIPSBitmapFont: Fb cmmi8 8 1/Fb 1 111 df<3907C007E0391FE03FF83918F8783E393879E01E39307B801F38707F00126013FEEAE0FC12C05B00815C0001143E5BA20003147E157C5B15FC0007ECF8081618EBC00115F0000F1538913803E0300180147016E0001F010113C015E390C7EAFF00000E143E251F7E9D2B>110 D E%EndDVIPSBitmapFont%DVIPSBitmapFont: Fc cmr10 10.95 3/Fc 3 52 df<EB01FE90380FFFC090383F03F090387C00F849137C48487F48487F4848EB0F80A2000F15C04848EB07E0A3003F15F0A290C712034815F8A64815FCB3A26C15F8A56C6CEB07F0A3001F15E0A36C6CEB0FC0A26C6CEB1F80000315006C6C133E6C6C5B017C5B90383F03F090380FFFC0D901FEC7FC263F7DBC2D>48 D<EB07FC90383FFF8090B512E03903F01FF83907C007FC390F0001FE001E6D7E001C1580003CEC7FC05AED3FE01270B4FC6DEB1FF07FA56C5A6CC7FC120CC813E0153FA216C0157F168015FF16004A5A5D4A5A4A5A5D4A5A4A5A4AC7FC147E147C5C495A495A495A495A49C71270133E133C5B4914E0485A485A485A48C7120148B6FCA25A4815C0B7FCA3243D7CBC2D>50 D<EB07FC90383FFF809038F80FE03901E003F839078001FCD80F007F000E6D7E001E1580D81F80137F486C14C07FA27F5BA2121F6C5AC8138015FF1600A24A5AA24A5A5DEC07E04A5A023FC7FCEB1FFCECFF809038000FE0EC07F86E7E6E7E6E7E1680ED7FC0A216E0153FA216F0A2120C123F487E487EA316E0A249137F6CC713C01278EDFF807E6C4913006C495A3907C007FC3903F80FF0C6B55A013F1380D907F8C7FC243F7CBC2D>I E%EndDVIPSBitmapFont/Fd 173[49 2[53 79[{TeXBase1Encoding ReEncodeFont}2 72.7272/Times-Roman rf%DVIPSBitmapFont: Fe cmsy10 10.95 2/Fe 2 21 df<EB0FFCEB3FFF90B512C0000314F04880488048804880A2481580A3B712C0AA6C1580A36C1500A26C5C6C5C6C5C6C5CC614C0013F90C7FCEB0FFC22227BA72D>15D<1818187CEF01FCEF07F8EF1FF0EF7FC0933801FF00EE07FCEE1FF0EE7FC04B48C7FCED07FCED1FF0ED7FC04A48C8FCEC07FCEC1FF0EC7FC04948C9FCEB07FCEB1FF0EB7FC04848CAFCEA07FCEA1FF0EA7FC048CBFC5AEA7F80EA3FE0EA0FF8EA03FEC66C7EEB3FE0EB0FF8EB03FE903800FF80EC3FE0EC0FF8EC03FE913800FF80ED3FE0ED0FF8ED03FE923800FF80EE3FE0EE0FF8EE03FE933800FF80EF3FE0EF0FF8EF03FC170018381800AE007FB812F8B912FCA26C17F8364878B947>20 D E%EndDVIPSBitmapFont/Ff 134[40 4[25 35 35 1[45 45 45 1[25 2[25 45 45 1[4045 40 45 45 97[{TeXBase1Encoding ReEncodeFont}16 90.9091/Times-Italic rf /Fg 166[66 9[71 66 1[61 22[45 45 451[45 45 48[{TeXBase1Encoding ReEncodeFont}9 90.9091 /Times-Boldrf /Fh 136[86 60 66 40 47 53 1[66 60 66 100 33 2[33 6660 1[53 66 53 1[60 12[80 3[73 93 2[80 2[47 93 2[80 1[8680 86 6[40 18[40 39[{TeXBase1Encoding ReEncodeFont}30119.552 /Times-Bold rf /Fi 103[55 15[55 11[55 1[55 5555 55 55 55 55 55 55 55 55 55 55 55 55 55 1[55 55 5555 55 55 55 55 55 8[55 5[55 1[55 55 55 55 55 6[55 5555 55 55 55 55 55 55 55 7[55 55 55 55 55 55 55 55 5555 1[55 55 1[55 4[55 33[{TeXBase1Encoding ReEncodeFont}5990.9091 /Courier rf /Fj 104[91 2[40 40 24[40 45 45 6645 45 25 35 30 45 45 45 45 71 25 45 25 25 45 45 30 4045 40 45 40 7[66 1[86 1[66 56 51 61 1[51 66 66 81 561[35 30 66 1[51 56 66 61 61 66 84 40 4[25 1[45 45 4545 45 45 45 45 45 1[23 30 23 51 1[30 30 30 35[51 51 2[{TeXBase1Encoding ReEncodeFont}70 90.9091 /Times-Romanrf /Fk 138[72 40 56 48 1[72 1[72 1[40 2[40 1[72 4[7264 13[80 5[128 88 8[96 96 7[40 5[72 1[72 72 72 3[36 44[{TeXBase1Encoding ReEncodeFont}22 143.462 /Times-Romanrf end%%EndProlog%%BeginSetup%%Feature: *Resolution 600dpiTeXDict begin%%EndSetup%%Page: 1 11 0 bop 1309 937 a Fk(CS)35 b(4400,)g(Spring)g(2004)12191120 y(Lab)g(1:)44 b(Manipulating)33 b(Bits)0 1761 yFj(Sw)o(aminathan)25 b(Pichumani)f(\()p Fi(swami@cs.utah.ed)o(u)pFj(\))17 b(is)23 b(the)h(lead)g(person)h(for)f(this)g(assignment.)02092 y Fh(Intr)n(oduction)0 2339 y Fj(The)c(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.)02451 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)25b(of)g(these)h(puzzles)h(are)e(quite)h(arti\002cial,)g(b)n(ut)02564 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.)02896 y Fh(Logistics)0 3142 y Fj(Y)-10 b(ou)26 b(will)f(w)o(ork)h(on)g(this)g(lab)g(by)g(yourself\227no)j(teams)d(are)g(allo)n(wed.)36b(The)26 b(only)g(hand-in)i(will)e(be)f(electronic)k(through)03255 y(the)k Fi(submit)d Fj(tool.)58 b(T)-7 b(ype)32b Fi(man)54 b(submit)29 b Fj(to)k(the)g(shell)h(on)g(an)o(y)f(of)g(the)g(class)h(machines)g(for)g(more)f(information.)0 3368y(An)o(y)d(clari\002cations)j(and)e(re)n(visions)h(to)e(the)h(assignment)i(will)d(be)g(posted)i(on)e(the)h(course)h(W)-7b(eb)30 b(page)h(or)f(sent)h(out)g(via)0 3481 y(the)f(class)g(mailing)g(list.)47 b(Email)29 b(questions)j(can)e(be)f(sent)h(to)f(teach-cs4400@cs.utah)q(.edu)q(.)51 b(BEW)-11 b(ARE:)27b(W)-7 b(e)29 b(will)g(not)0 3594 y(tell)i(you)f(ho)n(w)g(to)g(solv)o(e)h(these)h(puzzles)g(since)f(the)f(whole)h(point)g(is)g(to)f(get)g(you)h(to)f(think)i(about)f(ho)n(w)f(to)g(solv)o(e)h(these)03707 y(kinds)25 b(of)e(problems.)31 b(Ho)n(we)n(v)o(er)23b(we)f(will)i(help)g(clear)g(up)g(confusions)j(and)d(attempt)g(to)g(guide)g(your)h(thinking)h(into)e(more)0 3820 y(producti)n(v)o(e)i(directions.)0 4151 y Fh(Hand)31 b(Out)f(Instructions)04398 y Fj(Y)-10 b(ou)28 b(can)g(get)h(all)f(of)g(the)h(necessary)i(\002les)c(via)i(the)f(class)h(web)f(page.)44 b(Sa)n(v)o(e)28b(the)g(\002le)g(that)g(the)h(link)g(points)g(to)g(which)f(is)04511 y Fi(datalab-handout)o(.t)o(ar)o(.g)o(z)p Fj(.)04663 y(Start)g(by)h(cop)o(ying)i Fi(datalab-handou)o(t.)o(ta)o(r.)o(gz)21 b Fj(to)29 b(a)f(\(protected\))j(directory)g(in)d(which)h(you)g(plan)g(to)g(do)f(your)0 4775 y(w)o(ork.)43 b(Then)28b(gi)n(v)o(e)g(the)h(command:)39 b Fi(tar)53 b(zxvf)g(datalab-handout)o(.t)o(ar)o(.gz)o Fj(.)36 b(This)28 b(will)g(cause)h(a)f(number)04888 y(of)23 b(\002les)h(to)f(be)h(unpack)o(ed)i(in)d(the)h(directory)-6 b(.)31 b(The)23 b Fg(ONL)-8 b(Y)21 b Fj(\002le)i(you)h(will)g(be)f(modifying)j(and)e(turning)h(in)f(is)f Fi(bits.c)p Fj(.)05040 y(The)c(\002le)f Fi(btest.c)d Fj(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.)28b(The)19 b(\002le)f Fi(README)e Fj(contains)0 5153 y(additional)24b(documentation)h(about)e Fi(btest)p Fj(.)i(Use)c(the)h(command)gFi(make)52 b(btest)19 b Fj(to)i(generate)j(the)d(test)h(code)h(and)f(run)0 5266 y(it)h(with)g(the)h(command)g Fi(./btest)pFj(.)g(The)f(\002le)g Fi(dlc)e Fj(is)i(a)g(compiler)h(binary)h(that)f(you)f(can)h(use)g(to)f(check)h(your)g(solutions)0 5379y(for)g(compliance)i(with)d(the)h(coding)h(rules.)30b(The)23 b(remaining)i(\002les)e(are)h(used)g(to)g(b)n(uild)hFi(btest)p Fj(.)1924 5712 y(1)p eop%%Page: 2 22 1 bop 0 573 a Fj(Looking)31 b(at)e(the)h(\002le)e Fi(bits.c)eFj(you')o(ll)31 b(notice)g(a)e(C)f(structure)k Fi(team)26b Fj(into)k(which)g(you)g(should)h(insert)g(the)e(requested)0686 y(identifying)h(information\227namely)h(your)d(name.)40b(Ignore)28 b(the)f(team)g(concept)i(since)f(you')o(ll)h(be)e(doing)h(this)g(one)f(solo.)0 799 y(Do)c(this)h(right)g(a)o(w)o(ay)g(so)f(you)h(don')n(t)h(for)n(get.)0 951 y(The)i Fi(bits.c)c Fj(\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)01064 y(complete)i(each)g(function)h(sk)o(eleton)h(using)e(only)gFf(str)o(aightline)i Fj(code)e(\(i.e.,)f(no)g(loops)h(or)f(conditionals\))k(and)d(a)e(limited)0 1177 y(number)f(of)f(C)f(arithmetic)j(and)f(logical)h(operators.)36 b(Speci\002cally)-6b(,)27 b(you)f(are)f Ff(only)h Fj(allo)n(wed)g(to)f(use)h(the)f(follo)n(wing)i(eight)0 1289 y(operators:)55 1487 y Fi(!)54 b(\230)g(&)g(\210)g(|)g(+)g(<<)g(>>)0 1685 y Fj(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)01798 y(bits.)29 b(See)23 b(the)h(comments)h(in)e Fi(bits.c)dFj(for)k(detailed)h(rules)g(and)f(a)f(discussion)j(of)e(the)g(desired)h(coding)g(style.)0 2124 y Fh(Ev)o(aluation)0 2371 y Fj(Y)-10b(our)26 b(code)h(will)e(be)h(compiled)h(with)f Fi(gcc)eFj(and)i(run)g(and)g(tested)i(on)e(one)g(of)g(the)g(class)h(machines.)37 b(Y)-10 b(our)26 b(score)g(will)g(be)0 2483 y(computed)f(out)f(of)g(a)f(maximum)g(of)h(76)f(points)i(based)g(on)f(the)f(follo)n(wing)i(distrib)n(ution:)0 2681 y Fg(41)46 b Fj(Correctness)26b(of)e(code)g(running)i(on)d(one)h(of)g(the)g(class)g(machines.)02858 y Fg(30)46 b Fj(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 3034y Fg(5)46 b Fj(Style)31 b(points,)i(based)f(on)f(your)h(instructor')-5b(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 3147 y(comments.)03345 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 3457 y(sum)j(totals)i(to)e(41.)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 Fi(btest.c)p Fj(.)33b(Y)-10 b(ou)27 b(will)f(get)g(full)0 3570 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)fFi(btest.c)p Fj(,)21 b(half)26 b(credit)g(if)f(it)g(f)o(ails)i(one)e(test,)h(and)g(no)0 3683 y(credit)f(otherwise.)0 3835y(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 3948 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,)04061 y(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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -