ࡱ>  bjbj $$fffffzzzzLz0$o!:Bf"BffW ff,xCtP*z"Dm0L,!!x!fxBBw:!$ ,: CS 101 Worksheet to practice binary numbers Binary numbers are the dough we use to represent all information inside the computer. The purpose of this lab is to practice with some binary number representations. After finishing this lab, you should feel more comfortable expressing numbers in both decimal (base 10) and binary (base 2). We will also look at some simple properties and shortcuts of binary representation. Part I: Binary to decimal conversion As an example, lets look at the binary number 11010. 1101024 = 1623 = 822 = 421 = 220 = 1 To determine its value in base 10, all we need to do is add up the powers of 2 wherever we see a 1 in our binary number. In this case we have 16 + 8 + 2 = 26. Practice: Convert each of the following binary numbers into decimal. BinaryWhich powers of 2 are we adding?Decimal answer1010111110101110110101100 Here is an online tool that can help you check your answers:  HYPERLINK "http://cs.furman.edu/digitaldomain/more/binary/UConverter.html" http://cs.furman.edu/digitaldomain/more/binary/UConverter.html Part II: Decimal to binary conversion: the Binary Store To convert a number n into binary, pretend you have $n to spend at the binary store. Your strategy is to buy the most valuable gifts you can. The price list at the store is simply the powers of two: 1, 2, 4, 8, 16, 32, 64, etc. Example: Lets say you have $60 to start with. First, buy a $32 item. This will leave you with 60 32 = 28. Next, buy a $16 item. This leaves you with 28 16 = 12. Next, buy an $8 item. Now you have 12 8 = 4. Finally you can buy a $4 item, and all your money is spent. Your cashier receipt shows that you bought items costing: 32 + 16 + 8 + 4. Each of these numbers is a power of 2, so we can fill in the blanks. 1 means you bought that item, and 0 means you didnt. In this case, we did not buy any $2 or $1 item. 11110025 = 3224 = 1623 = 822 = 421 = 220 = 1Thus, the decimal number 60 is equivalent to the binary 111100. Try these examples. Convert decimal numbers to binary: DecimalWhat can you buy at the binary store?Binary answer36 19 25 50 100  Observations Looking at the above examples, lets see if we can detect some patterns. Look at binary representations of the odd numbers we did earlier, such as 19, 25, etc. What do they all have in common? Look at the even numbers like 26, 50 and 100. What do their binary representations have in common? Lets say youve just written down the binary form of some number x. What will happen to the value of the number if we put a 0 at the end of x? What would happen if we put a 1 at the end? If a binary number has all 1s in it (e.g. 111, 1111, 11111), what kind of number is this? Be specific. Part III: Binary shorthand Binary numbers can be painful to write or type when they get long. For example, when we study colors later on, it turns out that to completely specify a color takes 24 bits! (bit = binary digit) Here is an example: 100110010011001111111111 There are 2 kinds of shorthand to help us. They are called octal and hexadecimal. Octal Octal means base 8, and 8 is 23. Thus, one octal digit can stand for 3 bits. To experiment with octal numbers, lets play with the online calculator again. Set it up so that it will convert from base 8 to base 2. Ask it to do these conversions, and write down the answers: OctalBinary475475547 In the examples 475 and 547, how many bits are in our answers? Can you see the individual octal digits? For example, 475 is 4 followed by 7 followed by 5. Now lets try a few more octal-to-binary cases: OctalBinary612612126 How many bits does it take to represent the octal 612? What about 126? Why do you think there is a difference? _________________________________________________________________________ _________________________________________________________________________ Next, set up the online calculator so that it will go the other way: from base 2 to base 8. Ask the calculator to do these conversions: BinaryOctal110110111010111000 Can you see how the octal shorthands are determined? Explain how it is done, in your own words. _________________________________________________________________________ _________________________________________________________________________ Hexadecimal The second type of shorthand is called hexadecimal, or just hex for short. This means base 16, and 16 = 24. Thus, each hex digit stands for 4 bits, making hex even more efficient than octal as a shorthand for binary. Set up the online calculator to go from base 16 to base 2. Ask it to do these conversions: HexBinary9393903309 Again, note the number of bits in our answers. Now, lets go the other way. Lets ask the online calculator to convert from binary to hexadecimal. Set up the calculator to convert from base 2 to base 16. Ask it to do these conversions: BinaryHex01010011001101011001000010011001110010011100 Do the last two results look strange? It turns out that in base 16, we must have 16 different symbols for our digits. The digits 0-9 are already familiar to us, but now we need special symbols to represent digit values 10-15. To fully understand what is going on with hex shorthand, we can ask the online calculator to convert the numbers 10 thru 15 from decimal to hex. Write the results here: DecimalHex910111213141516  -/0  $ % & C T Ǹp^O@hl hJeCJOJQJaJhl hKHCJOJQJaJ"hl h*CJOJQJaJ"hl h}f5>*CJOJQJaJhl hw CJOJQJaJh}fCJOJQJaJhl hC|CJOJQJaJhlCJOJQJaJhl h}fCJOJQJaJhw CJOJQJaJh||CJOJQJaJ"hl h||5>*CJOJQJaJhg]5>*CJOJQJaJ/0     $$Ifa$gd7w            % & , - 3 4 : F e # $ % \ óóäym]h7wh`6CJOJQJaJhBCJOJQJaJh`CJOJQJaJhl hBCJOJQJaJh7whJeCJH*OJQJaJh7whJeCJOJQJaJh7whh65CJOJQJaJh7whJe5CJOJQJaJhl h||CJOJQJaJhl hJeCJOJQJaJhl hh6CJOJQJaJ   $ + 2 9 KEEEEE$Ifkd$$Iflr 8 t0644 la<yt7w9 : ; $ % , KIIIIIC$Ifkd$$Iflr 8 t0644 la<yt7w, M \ ] c d e kkd`$$IflF$ d T@  t06    44 la<yt7w$If\ c e l n t v }     U V W X Y c ˼˚udUC"hl h}f5>*CJOJQJaJhl hJeCJOJQJaJ hl hKH0JCJOJQJaJ+jthl hKHCJOJQJUaJhl hKHCJOJQJaJ%jhl hKHCJOJQJUaJhl hCJOJQJaJhl h~CJOJQJaJhl hBCJOJQJaJhl CJOJQJaJh7wh`OJQJh7wh`CJOJQJaJe f l m n qkkk$Ifkd$$IflF$ d T@  t06    44 la<yt7wn o t u v qkkk$Ifkd$$IflF$ d T@  t06    44 la<yt7wv w } ~  qkkk$Ifkdj$$IflF$ d T@  t06    44 la<yt7w qkkk$Ifkd$$IflF$ d T@  t06    44 la<yt7w W X Y } ~ qojjoooooooogdKHkd$$IflF$ d T@  t06    44 la<yt7w c 23>Jot ʻueueueueueueuWjh: GUmHnHuh7whh6CJH*OJQJaJh7whh6CJOJQJaJh7whh65CJOJQJaJh<-#CJOJQJaJhjCJOJQJaJhl hh6CJOJQJaJhl h*CJOJQJaJ"hl h}f5>*CJOJQJaJ"hl h*CJOJQJaJ 'W $$Ifa$gd7w 82222$Ifkd$$IflֈT 88 t0644 layt7w F200kd$$IflֈT 88 t0644 layt7w$If 2EFGz{}~JQʾٍufuWKW?hTCJOJQJaJh+CJOJQJaJhl hC|CJOJQJaJhl h`CJOJQJaJh`CJOJQJaJh}fCJOJQJaJ"hl h}f5>*CJOJQJaJh7wh`CJOJQJaJh7wh`6CJOJQJaJhh6CJOJQJaJhl hh6CJOJQJaJhl CJOJQJaJh: GCJOJQJaJhl h}fCJOJQJaJFGOui] $$Ifa$gd7wkdm$$IflF8  t06    44 la<yt7w$If qe___$If $$Ifa$gd7wkd $$IflF8  t06    44 la<yt7wqe___$If $$Ifa$gd7wkd $$IflF8  t06    44 la<yt7wqe___$If $$Ifa$gd7wkdw $$IflF8  t06    44 la<yt7wqe___$If $$Ifa$gd7wkd% $$IflF8  t06    44 la<yt7wz{|}~qooooogbbbbgd}f & Fgd}fkd $$IflF8  t06    44 la<yt7w ~67-.gdtSgdC|h^hgdTh^hgd`gd}f & Fgd}f%6Źq_P@0hl hC|>*CJOJQJaJhl hC|CJH*OJQJaJhl htSCJOJQJaJ"hl hC|6>*CJOJQJaJ"hl hC|5>*CJOJQJaJhuJI5>*CJOJQJaJhl h`CJOJQJaJhuJICJOJQJaJh`CJOJQJaJhtSCJOJQJaJhl hC|CJOJQJaJhl hTCJOJQJaJhTCJOJQJaJh<-#hT6CJOJQJaJ;<_lƷƷ֫Ʒuu֜cWWhw CJOJQJaJ"hl hC|6>*CJOJQJaJhl CJOJQJaJhl hl CJOJQJaJhuJICJOJQJaJhl h`CJOJQJaJh`CJOJQJaJh7wh`CJOJQJaJh7wh`6CJOJQJaJhtSCJOJQJaJhl htSCJOJQJaJhl hC|CJOJQJaJ"v{kd $$Ifl08$  t0644 layt7w $IfgdtSgdtS{{ $IfgdtS{kd $$Ifl08$  t0644 layt7w{{ $IfgdtS{kd $$Ifl08$  t0644 layt7w{{ $IfgdtS{kdI$$Ifl08$  t0644 layt7w{{ $IfgdtS{kd$$Ifl08$  t0644 layt7wmnvv $Ifgd`gdtS{kdy$$Ifl08$  t0644 layt7w{{ $Ifgd`{kd$$Ifl08$  t0644 layt7w{{ $Ifgd`{kd$$Ifl08$  t0644 layt7w{{ $Ifgd`{kdA$$Ifl08$  t0644 layt7w{{ $Ifgd`{kd$$Ifl08$  t0644 layt7w{{ $Ifgd`{kdq$$Ifl08$  t0644 layt7w<=^_fzzzq $Ifgd`gdC|gdtS{kd $$Ifl08$  t0644 layt7w flmqr{{kd$$Ifl08 )Q t0644 layt7w $Ifgd`rsz{{{ $Ifgd`{kd9$$Ifl08 )Q t0644 layt7w{|{{ $Ifgd`{kd$$Ifl08 )Q t0644 layt7w67lmgdC|{kdi$$Ifl08 )Q t0644 layt7w %kl !$񪞎sdddTEh7whl CJOJQJaJh7whl 6CJOJQJaJhl hl CJOJQJaJh`CJOJQJaJh7wh`CJOJQJaJh7wh`6CJOJQJaJhtSCJOJQJaJhl htSCJOJQJaJhl hC|>*CJOJQJaJhw CJOJQJaJhoCJOJQJaJhl hC|CJH*OJQJaJhl hC|CJOJQJaJv{kd$$Ifl08$  t0644 layt7w $Ifgd`gdC|{{ $Ifgd`{kd$$Ifl08$  t0644 layt7w{{ $Ifgd`{kd1$$Ifl08$  t0644 layt7w{{ $Ifgd`{kd$$Ifl08$  t0644 layt7w{{ $Ifgd`{kda$$Ifl08$  t0644 layt7w !vv $IfgdC|gdC|{kd$$Ifl08$  t0644 layt7w {{ $IfgdC|{kd$$Ifl08  t0644 layt7w{{ $IfgdC|{kd)$$Ifl08  t0644 layt7w{{ $IfgdC|{kd$$Ifl08  t0644 layt7w{{ $IfgdC|{kdY$$Ifl08  t0644 layt7w{{ $IfgdC|{kd$$Ifl08  t0644 layt7w"#{{ $IfgdC|{kd$$Ifl08  t0644 layt7w $+/X OVǻӯxxihl hyACJOJQJaJh7whyACJOJQJaJh7whyA6CJOJQJaJhl CJOJQJaJh^-HCJOJQJaJhyACJOJQJaJhw CJOJQJaJhCJOJQJaJhl hl CJOJQJaJh7whl CJOJQJaJh7whuJICJOJQJaJ#$-.{{ $IfgdC|{kd!$$Ifl08  t0644 layt7w./01vv $IfgdyAgdC|{kd$$Ifl08  t0644 layt7w {{ $IfgdyA{kdQ$$Ifl08$  t0644 layt7w{{ $IfgdyA{kd$$Ifl08$  t0644 layt7w{{ $IfgdyA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z@H*z5%Jvfφφ yX**/MOm]; ju4-%x*bso@3Nn5u-90[LJnnOu;1#7+HeА 5]KXej5/lR"JRE)J!(RJRE)J!(R$$If<!vh585555#v8#v:V l t06585a<yt7w$$If<!vh585555#v8#v:V l t06585a<yt7w$$If<!vh5T5@ 5#vT#v@ #v:V l t065T5@ 5a<yt7w$$If<!vh5T5@ 5#vT#v@ #v:V l t065T5@ 5a<yt7w$$If<!vh5T5@ 5#vT#v@ #v:V l t065T5@ 5a<yt7w$$If<!vh5T5@ 5#vT#v@ #v:V l t065T5@ 5a<yt7w$$If<!vh5T5@ 5#vT#v@ #v:V l t065T5@ 5a<yt7w$$If<!vh5T5@ 5#vT#v@ #v:V l t065T5@ 5a<yt7wDyK ?http://cs.furman.edu/digitaldomain/more/binary/UConverter.htmlyK http://cs.furman.edu/digitaldomain/more/binary/UConverter.htmlyX;H,]ą'c$$If!vh58585555#v8#v:V l t06585ayt7w$$If!vh58585555#v8#v:V l t06585ayt7w$$If<!vh585 5#v8#v #v:V l t06585 5a<yt7w$$If<!vh585 5#v8#v #v:V l t06585 5a<yt7w$$If<!vh585 5#v8#v #v:V l t06585 5a<yt7w$$If<!vh585 5#v8#v #v:V l t06585 5a<yt7w$$If<!vh585 5#v8#v #v:V l t06585 5a<yt7w$$If<!vh585 5#v8#v #v:V l t06585 5a<yt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh5Q5#vQ#v:V l t065Q5ayt7w$$If!vh5Q5#vQ#v:V l t065Q5ayt7w$$If!vh5Q5#vQ#v:V l t065Q5ayt7w$$If!vh5Q5#vQ#v:V l t065Q5ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w$$If!vh55#v#v:V l t0655ayt7w^ 2 0@P`p2( 0@P`p 0@P`p 0@P`p 0@P`p 0@P`p 0@P`p8XV~_HmH nH sH tH @`@ NormalCJ_HaJmH sH tH DA`D Default Paragraph FontVi@V  Table Normal :V 44 la (k (No List 6U@6 || Hyperlink >*B*phjj Je Table Grid7:V0PK![Content_Types].xmlj0Eжr(΢Iw},-j4 wP-t#bΙ{UTU^hd}㨫)*1P' ^W0)T9<l#$yi};~@(Hu* Dנz/0ǰ $ X3aZ,D0j~3߶b~i>3\`?/[G\!-Rk.sԻ..a濭?PK!֧6 _rels/.relsj0 }Q%v/C/}(h"O = C?hv=Ʌ%[xp{۵_Pѣ<1H0ORBdJE4b$q_6LR7`0̞O,En7Lib/SeеPK!kytheme/theme/themeManager.xml M @}w7c(EbˮCAǠҟ7՛K Y, e.|,H,lxɴIsQ}#Ր ֵ+!,^$j=GW)E+& 8PK!PPtheme/theme/theme1.xmlYOo6w toc'vuر-MniP@I}úama[إ4:lЯGRX^6؊>$ !)O^rC$y@/yH*񄴽)޵߻UDb`}"qۋJחX^)I`nEp)liV[]1M<OP6r=zgbIguSebORD۫qu gZYׇ_.[,"LFVAzn^3L_wr%}ݭ5k _2's4[,~\vd9|:x9|Jk (b49Ck) cζ+k_eP EticE{\ + 5M]Ś^'4c|97y! a!#f^=??|xGKY巟co^>/_䗟?Byߞ=yէ) ҘHt}b*d$ηbaZ^'XsS9,#G#|TO9"1QN;]YJ+h^%3'IX\Lʸ}xwq7Ina(ލ#É!IBzR]JR_p ݥiItDl6/*ߎmvgUZoC YYC3^*Co`U 9 I )o;*Vw4vBу*70e?F8NDeB=~Bwߡq6 fg&BJSc]9f걍+P_|"B {RU&l(p'n5w O=a>+J/vV[6ŦEvc@M!M,a0י!)NLiY]wpf \}DU4p vDB%JФ+{,l]= 2f 3g ʕ(:Z3sLs*UšЀ h[ʫp>׬` ޛx"]$#GZyՍX17;>҇SVd߀YTfX.ޛx)tޞHG%M8m{c8cץ0 bW†l|VuvSةj ȆB% f(l+k `G׵d<&*;4mg_R'A} ס TՄѴ͔[+^,pVnul& [I<ЭRvU1)AO`%W`q"U(8w0 A 9Kä5> HeD)eI2b!aC]WBT s߳ )SC?d:l]o{oY=1kyVV5E8Vk+֜\80X4D) ?*|fL u"РA@T_q64)kڬuV7 t '%;i9s9x,ڎ-45xd8?ǘOZN|t &$0YPK! ѐ'theme/theme/_rels/themeManager.xml.relsM 0wooӺ&݈Э5 6?$Q ,.aic21h:qm@RN;d`o7gK(M&$R(.1r'JЊT8V"AȻHu}|$b{P8g/]QAsم(#L[PK-![Content_Types].xmlPK-!֧6 +_rels/.relsPK-!kytheme/theme/themeManager.xmlPK-!PPtheme/theme/theme1.xmlPK-! ѐ' theme/theme/_rels/themeManager.xml.relsPK]  \ c '(9F 9 , e n v  F~fr{#. !"#$%&)*+,-./012345678:;<=>?@ABCDEGHIJKLMNOPQUXl,R$uyy:D?| 8@l (    c A<. 100px-Backgammon_DoublingCubeOS`TOS`T#" `?B S  ? u$e@ T_33 -../ :%,M\]GOu% 4 Y z  7 , 0l=_/ -..Q W {W@^`o(. ^`hH. pLp^p`LhH. @ @ ^@ `hH. ^`hH. L^`LhH. ^`hH. ^`hH. PLP^P`LhH.{ 0nw        l o`w <-#h6yA: G^-HKHuJItS+c}f?@ABCDEFGHIJKLMNOPQRSTUVWYZ[\]^_`abcdefghiklmnopqrstuvwxyz|}~Root Entry F jtP*Data X#1Tablej!WordDocumentSummaryInformation({DocumentSummaryInformation8CompObjy  F'Microsoft Office Word 97-2003 Document MSWordDocWord.Document.89q