ࡱ> M Xbjbj== WWGlRRRR6666 6 S99999<<<dSfSfSfSfSfSfS$T VzS<;@<<<S>RR99S>>><R99dS><dS>>CFF98 o)vO426<`FF S0SF5W>5WF>RRRRPHYSICS 201 LAB 1 Part 1. Binary and hexadecimal numbers. All of the information stored in and processed by a computer is represented in bits (binary digits, 1's and 0's). Why? Convert the following decimal numbers into binary and hexadecimal. Decimal BinaryHex853553 Convert the following binary numbers into decimal. BinaryDecimalHex111010101000000110011100 Part 2. I/O Addresses in hexadecimal notation. Data coming going out of a computer is rarely sent directly from the processor. Output devices are slow, and the microprocessor has other things it could be doing. Memory is faster than I/O devices, so the data is sent to a special part of memory, where the device can pick it up at its leisure. This is referred to as memory-mapped I/O. A part of memory is sectioned off for use by the I/O devices. This section is divided among the I/O devices, and of course, the various locations are assigned addresses. On the computer you are at go to Start/Settings/Control Panel/System/Hardware/Device Manager. You may get a message about insufficient security privileges but proceed; we will only be looking. Click on the plus sign next to the Floppy Disk Controller. Double click on Standard Floppy Disk Controller. Click on the Resources tab. Find the range(s) of memory allocated to floppy. Enter the hexadecimal range in the table below. Addresses often appear in hexadecimal (base 16). Convert it to binary. Memory Range HexadecimalBinaryLowest ValueUpper ValueLower ValueUpper Value How many memory locations (words) do the above correspond to (combined)? (Please put your answer in decimal.)  The microprocessor usually carries on without regard for either input or output devices. But sometimes processing must be interrupted to deal with an I/O device. An I/O device makes a request to interrupt the processor. There is one wire signaling the processor that an interrupt has been requested. After the processor decides to allow for the interruption, it needs to determine which device made the request. This is again a kind of addressing. The I/O devices are assigned an IRQ. How many IRQs are there? (Try http://www.pcguide.com/ref/mbsys/res/irq/num.htm)  What is the IRQ for the floppy?  How many bits are required to represent such an IRQ address?  Part 3. Overflow. Let us assume for now that the numbers we are representing are unsigned integers (i.e. non-negative integers). If we use N bits, what is the largest unsigned integer we can represent (assuming the lowest is 0)?  If we add two integers whose sum exceeds our largest integer, we say we have an "overflow." The following C++ program prints out the powers of 2, and would naively go on forever. The variable is declared as unsigned (positives only). // not an infinite loop // use to demonstrate overflow #include main() { unsigned num; num=1; while(num>=1) { num=2*num; cout << num << endl; } return 0; } But when I run it I find it prints the powers of 2 up to and including 2147483648 and then 0. 2 4 8 16 1073741824 2147483648 0 Why is not an infinite loop? Where did that zero at the end come from?  What is the largest unsigned integer allowed by the compiler I used? Be careful, the program displays the largest power of two, which is not the largest number.  How many bits does it use to represent an unsigned integer?  Part 4. Negative Numbers. Let us extend our representation to include negative numbers. Note that -44 is that number which when added to +44 gives zero. Assuming we are using eight bits to represent a number calculate the twos complement of 44. First replaces 1s with 0s and vice versa. 00101100 Next add 1 to your result. +00000001 Now demonstrate that 44 + (-44) = 0 00101100+00000000 Repeat the steps above to find 75. (0s ( 1s)  And add 1. +00000001 Then add 44 and 75. + Does the answer make sense? How do you know?  Part 5. More on Negative Numbers If we use 16 bits, what is the largest integer (signed) we can represent?  What is its binary representation?  What is the smallest (most negative) integer?  What is its binary representation?  The following program is like that considered earlier but with the variable declared as an integer (positive or negative). // not an infinite loop // use to demonstrate overflow #include main() { int num; num=1; while(num>=1) { num=2*num; cout << num << endl; } return 0; } 2 4 8 16 1073741824 -2147483648 Why is it not an infinite loop? And where did that negative number at the end come from?  What is the largest integer allowed by this compiler?  How many bits does it use to represent integer?  Part 6. Negative Numbers in Other Bases Construct the 10's complement of the decimal number 401. 401+000 Construct the 16's complement of the decimal number 3AD. 3AD+000 Part 7. Interpretation Interpret the following eight-bit binary string 11010110 A. As an unsigned integer B. As an signed integer C. Convert it to hex The calculator found under Start/Programs/Accessories/Calculator allows one to work in binary-number mode by clicking on the Bin radio button. (You have to be in the Scientific view.) How many bits does it use to represent its binary numbers?  Whats the largest number it can represent (assume its an unsigned integer).  Part 8. Fractions Express the following fractions in binary form DecimalBinary27.12517.875 Part 9. IP Stuff Go to Start/Run, type cmd (or command) and click OK. At the prompt type ipconfig /all. That should provide information about the computers network set-up. Convert the IP address and subnet mask to binary. Dotted-Decimal NotationBinary RepresentationIP AddressSubnet mask Part 10. ASCII and HTML The following HTML code if entered into Notepad and saved as ASCII_HTML.htm and viewed in a browser displays the numbers 65 and 66 and the corresponding symbols A and B (65 is ASCII for an A). 65 A
66 B
Use the character map (Start./Programs/Accessories/System Tools/Character Map) to adapt this code to print (the copyright symbol) and (the degree symbol). Paste your code into this Word document. Also do a screen capture of the browser and paste it into this Word document.   =[nJ \ ORqx w+GWX\ jCJjUmHnHu 5CJ\CJ5CJ53 =>$If$If,$d%d&d'd-DM &NOPQGWkbbb $$Ifa$$$IfTlFp nnn 0    4 la #$%&'Z[bwwwwwwsqqw< $$Ifa$~$$IfTlFp nnn0    4 la bjnoxyzb0$$IfTlF, ll 0    4 la $$Ifa$z{0www0wwwuuuu $$Ifa$~$$IfTlF, ll0    4 la    z@z<z<|$$IflF ,"   0    4 la$If     % & ' ( ) |<|zz|$$IflF ,"   0    4 la$If      D E $Ifa$$IfTl  &04 laE F G H I J \ ] 234$Ifc$$IfTl4  064 la $$Ifa$ 457$%>]^st{}_$$Ifl,""  &04 laRSUWY\^itvwx$Ifhijkl$If_$$Ifl,""  &04 la $$Ifa$ ($If$$IfTlִT  T@@@@@@@@06    4 la$If $$IfTlִT  T@@@@@@@@06    4 la $$Ifa$$If L$$IfTl pL (rnnnnnnnnn0$$$$4 la!#%')+ $$Ifa$ $$Ifa$ +,($$IfTl pL (rnnnnnnnnn0$$$$4 la,-./012345 $$Ifa$ 56$$IfTl pL (rnnnnnnnnn0$$$$4 la678\]^`bdfhjln $$Ifa$$If no,$$IfTl pL (rnnnnnnnnn0$$$$4 laoqrstuvwxy $$Ifa$ $$Ifa$ yzH$$IfTl pL (rnnnnnnnnn0$$$$4 laz{} $$Ifa$ $$IfTl pL (rnnnnnnnnn0$$$$4 la $$Ifa$  ($If$$IfTlִT  T@@@@@@@@06    4 la$If $$IfTlִT  T@@@@@@@@06    4 la $$Ifa$$If L$$IfTl pL (rnnnnnnnnn0$$$$4 la $$Ifa$ $$Ifa$ ($$IfTl pL (rnnnnnnnnn0$$$$4 la $$Ifa$ $$IfTl pL (rnnnnnnnnn0$$$$4 la !"#$%&' $$Ifa$$If '(,$$IfTl pL (rnnnnnnnnn0$$$$4 la(*+,-./012 $$Ifa$ $$Ifa$ 23($$IfTl pL (rnnnnnnnnn0$$$$4 la3456789:;<$If $$Ifa$ <=$$IfTl pL (rnnnnnnnnn0$$$$4 la=>lmnopqa$$Ifl,""  064 la$If      $Ifa$$IfTlF  &04 laFGHIJmnopqra$$IfTl  &04 laFf$Ifrstuvwxyz{|}~89NOVXbckFf$Ifkz}1234$If456nopqr  $If_$$Ifl,""  &04 la  ^U $$Ifa$$$IfTl\3q 04 la $$Ifa$$If !m dddd $$Ifa$$$IfTl\3q 04 la!"#$%^_`bdfmkkkkke\\\ $$Ifa$$If$$IfTl\3q 04 la fgijklmd[[[ $$Ifa$ $$Ifa$$$IfTl\3q 04 lalmnprtm dddd $$Ifa$$$IfTl\3q 04 latuvwxmkkkikkk``` $$Ifa$$$IfTl\3q 04 la nz$$IfTl0   &04 la$IfFff $$Ifa$    #$%&usunss$a$z$$IfTl0   &04 la$If $$Ifa$ #rstuvw$If_$$Ifl,""  &04 la$}}$If|$$IfTl0j  064 la$$Ifm$$IfTl0j 064 la j8d^^$If$If$$Ifl4F,"t  06    4 lav<ppp$If$$Ifl4F,"t   06    4 la+,trrprrrrrrrr$$Ifl4F,"t   06    4 la $%-.GHIJKLMNOPQRSTUVWX/ =!"#$%$$IfTl4d#.8 C MXb ֠&&&&&&&&&&&&&&&&0@@@@4 la$$IfTl4d#.8 C MXb ֠&&&&&&&&&&&&&&&&0@@@@4 la$$IfTlִT  T@@@@@@@@ P0    4 la i0@0 Normal_HmH sH tH 0@0 Heading 1$@&CJ4@4 Heading 2$@&5CJ:@: Heading 3$$@&a$5CJNN Heading 4%$ & F h<@&^CJ6@6 Heading 5$$@&a$CJ<A@< Default Paragraph Font(U@( Hyperlink>*B*8V@8 FollowedHyperlink>*B* *B@* Body TextCJ X            X => #$%&'Z[bjnoxyz{  %&'()     D E F G H I J \ ] 2 3 4 5 7 $ % > ] ^ s t { } R S U W Y \ ^ i t v w x h i j k l !#%')+,-./012345678\]^`bdfhjlnoqrstuvwxyz{} !"#$%&'(*+,-./0123456789:;<=>lmnopq     FGHIJmnopqrstuvwxyz{|}~89NOVXbckz}123456nopqr   !"#$%^_`bdfgijklmnprtuvwx   #$%&#rstuvw+,$%-.GHIJKLMNOPQRSTUVY000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 000l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0l 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0l 0f00f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f00f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0l 0505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050l 0000000000000000000000000000000000000000000000Xbz E 4+,56noyz'(23<=rk4 !fltX !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSWov/Xb$j%A,}5rь>B*b$rC/h&n R@0u(   t BC8DEFZHhh8@   u BC8DEFZHhh8@  #" B S  ?Xttut Y\ :B  GY<( + A D _ f t x ~ :AOSY\dglq&0'HJLGY333333333333333333333333333FYzzatema1C:\phy_201_lab_03.docblumA:\phy_201_lab_03.docblumjC:\Documents and Settings\blum.ADM\Application Data\Microsoft\Word\AutoRecovery save of phy_201_lab_03.asdblumjC:\Documents and Settings\blum.ADM\Application Data\Microsoft\Word\AutoRecovery save of phy_201_lab_03.asdblumC:\p201\phy_201_f01_lab_03.docblumC:\p201\phy_201_f01_lab_03.docblumC:\p201\phy_201_f01_lab_03.docInformation Technology)C:\blum\IWANT\p201\phy_201_f02_lab_01.docInformation TechnologyjC:\Documents and Settings\blum\Application Data\Microsoft\Word\AutoRecovery save of phy_201_f02_lab_01.asdInformation TechnologyjC:\Documents and Settings\blum\Application Data\Microsoft\Word\AutoRecovery save of phy_201_f02_lab_01.asdI C`9 ^rP #V,'}V[ rY] D'q hh^h`.hh^h`o(.hh^h`.hh^h`.hh^h`.hh^h`.hh^h`.}V[I#VrY]D'qC`9^rP #$%&'Z[bjnoxyz{  %&'(   E F G ] 2 3 4 5 h i j k l !#%')+,-./0123456]^`bdfhjlnoqrstuvwxyz{} !"#$%&'(*+,-./0123456789:;<=mno     FGHInopqrstuvwxyz{|}~2456nopqr   !"^_`bdfgijklmnprtu   #$%&#rstuY""@_4XP@UnknownGz Times New Roman5Symbol3& z Arial"qhh hh9 .!20d2 PHYSICS 201ligasj1Information TechnologyOh+'0  0 < H T`hpx PHYSICS 201HYSligasj1iga Normal.dotInformation Technology15oMicrosoft Word 9.0o@z@2TO@lO@3vO՜.+,0 hp  La Salle University.   PHYSICS 201 Title  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTVWXYZ[\^_`abcdefghijklmnopqrstuvwxyz{|}~Root Entry F5vOData U1Table]5WWordDocumentSummaryInformation(DocumentSummaryInformation8CompObjjObjectPool5vO5vO  FMicrosoft Word Document MSWordDocWord.Document.89q