?? apc.htm
字號:
or "no." Yes or no, or true or false, can be represented as 1 or 0. By
convention, 1 means true or Yes, but that is just a convention; it could just as
easily have meant false or no.</P>
<P>Once you make this great leap of intuition, the power of binary becomes clear:
With 1s and 0s you can represent the fundamental truth of every circuit (there is
power or there isn't). All a computer ever knows is, "Is you is, or is you ain't?"
Is you is = 1; is you ain't = 0.
<CENTER>
<H4><A NAME="Heading7"></A><FONT COLOR="#000077">Bits, Bytes, and Nybbles</FONT></H4>
</CENTER>
<P>Once the decision is made to represent truth and falsehood with 1s and 0s, binary
digits (or bits) become very important. Since early computers could send 8 bits at
a time, it was natural to start writing code using 8-bit numbers--called bytes.
<BLOCKQUOTE>
<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>Half a byte (4 bits) is called a
nybble!
<HR>
</BLOCKQUOTE>
<P>With 8 binary digits you can represent up to 256 different values. Why? Examine
the columns: If all 8 bits are set (1), the value is 255. If none is set (all the
bits are clear or zero) the value is 0. 0-255 is 256 possible states.
<CENTER>
<H4><A NAME="Heading8"></A><FONT COLOR="#000077">Whats a KB?</FONT></H4>
</CENTER>
<P>It turns out that 2<SUP>10 </SUP>(1,024)<SUP> </SUP>is roughly equal to 10<SUP>3
</SUP>(1,000). This coincidence was too good to miss, so computer scientists started
referring to 2<SUP>10 </SUP>bytes<SUP> </SUP>as 1KB or 1 kilobyte, based on the scientific
prefix of kilo for thousand.</P>
<P>Similarly, 1024 * 1024 (1,048,576) is close enough to one million to receive the
designation 1MB or 1 megabyte, and 1,024 megabytes is called 1 gigabyte (giga implies
thousand-million or billion).
<CENTER>
<H4><A NAME="Heading9"></A><FONT COLOR="#000077">Binary Numbers</FONT></H4>
</CENTER>
<P>Computers use patterns of 1s and 0s to encode everything they do. Machine instructions
are encoded as a series of 1s and 0s and interpreted by the fundamental circuitry.
Arbitrary sets of 1s and 0s can be translated back into numbers by computer scientists,
but it would be a mistake to think that these numbers have intrinsic meaning.</P>
<P>For example, the Intel 80x6 chip set interprets the bit pattern 1001 0101 as an
instruction. You certainly can translate this into decimal (149), but that number
per se has no meaning.</P>
<P>Sometimes the numbers are instructions, sometimes they are values, and sometimes
they are codes. One important standardized code set is ASCII. In ASCII every letter
and punctuation is given a 7-digit binary representation. For example, the lowercase
letter "a" is represented by 0110 0001. This is not a number, although
you can translate it to the number 97 (64 + 32 + 1). It is in this sense that people
say that the letter "a" is represented by 97 in ASCII; but the truth is
that the binary representation of 97, 01100001, is the encoding of the letter "a,"
and the decimal value 97 is a human convenience.
<CENTER>
<H3><A NAME="Heading10"></A><FONT COLOR="#000077">Hexadecimal</FONT></H3>
</CENTER>
<P>Because binary numbers are difficult to read, a simpler way to represent the same
values is sought. Translating from binary to base 10 involves a fair bit of manipulation
of numbers; but it turns out that translating from base 2 to base 16 is very simple,
because there is a very good shortcut.</P>
<P>To understand this, you must first understand base 16, which is known as hexadecimal.
In base 16 there are sixteen numerals: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D,
E, and F. The last six are arbitrary; the letters A-F were chosen because they are
easy to represent on a keyboard. The columns in hexadecimal are
<TABLE BORDER="0">
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">4</TD>
<TD ALIGN="LEFT">3</TD>
<TD ALIGN="LEFT">2</TD>
<TD ALIGN="LEFT">1</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">16<SUP>3</SUP></TD>
<TD ALIGN="LEFT">16<SUP>2</SUP></TD>
<TD ALIGN="LEFT">16<SUP>1</SUP></TD>
<TD ALIGN="LEFT">16<SUP>0</SUP></TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<BLOCKQUOTE>
<P>4096
</BLOCKQUOTE>
<P>
</TD>
<TD ALIGN="LEFT">
<BLOCKQUOTE>
<P>256
</BLOCKQUOTE>
<P>
</TD>
<TD ALIGN="LEFT">
<BLOCKQUOTE>
<P>16
</BLOCKQUOTE>
<P>
</TD>
<TD ALIGN="LEFT">
<BLOCKQUOTE>
<P>1
</BLOCKQUOTE>
<P>
</TD>
</TR>
</TABLE>
To translate from hexadecimal to decimal, you can multiply. Thus, the number F8C
represents:</P>
<PRE><FONT COLOR="#0066FF">
F * 256 = 15 * 256 = 3840
8 * 16 = 128
C * 1 = 12 * 1 = 12
3980
</FONT></PRE>
<P>Translating the number FC to binary is best done by translating first to base
10, and then to binary:</P>
<PRE><FONT COLOR="#0066FF">
F * 16 = 15 * 16 = 240
C * 1 = 12 * 1 = 12
252
</FONT></PRE>
<P>Converting 252<SUB>10</SUB> to binary requires the chart:</P>
<PRE><FONT COLOR="#0066FF">
Col: 9 8 7 6 5 4 3 2 1
Power: 28 27 26 25 24 23 22 21 20
Value: 256 128 64 32 16 8 4 2 1
There are no 256s.
1 128 leaves 124
1 64 leaves 60
1 32 leaves 28
1 16 leaves 12
1 8 leaves 4
1 4 leaves 0
0
0
1 1 1 1 1 1 0 0
</FONT></PRE>
<P>Thus, the answer in binary is 1111 1100.</P>
<P>Now, it turns out that if you treat this binary number as two sets of 4 digits,
you can do a magical transformation.</P>
<P>The right set is 1100. In decimal that is 12, or in hexadecimal it is C.</P>
<P>The left set is 1111, which in base 10 is 15, or in hex is F.</P>
<P>Thus, you have:</P>
<PRE><FONT COLOR="#0066FF">1111 1100
F C
</FONT></PRE>
<P>Putting the two hex numbers together is FC, which is the real value of 1111 1100.
This shortcut always works. You can take any binary number of any length, and reduce
it to sets of 4, translate each set of four to hex, and put the hex numbers together
to get the result in hex. Here's a much larger number:</P>
<PRE><FONT COLOR="#0066FF">1011 0001 1101 0111
</FONT></PRE>
<P>The columns are 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192,
16384, and 32768.</P>
<PRE><FONT COLOR="#0066FF">1 x 1 = 1
1 x 2= 2
1 x 4 = 4
0 x 8 = 0
1 x 16 = 16
0 x 32 = 0
1 x 64 = 64
1 x 128 = 128
1 x 256 = 256
0 x 512 = 0
0 x 1024 = 0
0 x 2048 = 0
1 x 4096 = 4,096
1 x 8192 = 8,192
0 x 16384 = 0
1 x 32768 = 32,768
Total: 45,527</FONT></PRE>
<P>Converting this to hexadecimal requires a chart with the hexadecimal values.</P>
<PRE><FONT COLOR="#0066FF">65535 4096 256 16 1
</FONT></PRE>
<P>There are no 65,536s in 45,527 so the first column is 4096. There are 11 4096s
(45,056), with a remainder of 471. There is one 256 in 471 with a remainder of 215.
There are 13 16s (208) in 215 with a remainder of 7. Thus, the hexadecimal number
is B1D7.</P>
<P>Checking the math:</P>
<PRE><FONT COLOR="#0066FF">B (11) * 4096 = 45,056
1 * 256 = 256
D (13) * 16 = 208
7 * 1 = 7
Total 45,527
</FONT></PRE>
<PRE>The shortcut version would be to take the original binary number, 1011000111010111,
and break it into groups of 4: 1011 0001 1101 0111. Each of the four then
is evaluated as a hexadecimal number: </PRE>
<P>
<TABLE BORDER="0">
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1011 =</FONT></PRE>
</TD>
<TD ALIGN="LEFT"></TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">1 x 1 =</FONT></PRE>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1 x 2 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
2
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0 x 4 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1 x 8 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
8
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
Total
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
11
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
Hex:
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
B
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0001 =</FONT></PRE>
</TD>
<TD ALIGN="LEFT"></TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1 x 1 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0 x 2 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0 x 4 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0 * 8 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
Total
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
Hex:
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1101 =</FONT></PRE>
</TD>
<TD ALIGN="LEFT"></TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1 x 1 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0 x 2 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1 x 4 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
4
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1 x 8 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
8
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
Total
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
13
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
Hex =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
D
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0111 =</FONT></PRE>
</TD>
<TD ALIGN="LEFT"></TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1 x 1 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1 x 2 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
2
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
1 x 4 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
4
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0 x 8 =
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
0
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
Total
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
7
</FONT></PRE>
<P>
</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
Hex:
</FONT></PRE>
<P>
</TD>
<TD ALIGN="LEFT">
<PRE><FONT COLOR="#0066FF">
7
</FONT></PRE>
<P>
</TD>
</TR>
</TABLE>
<FONT COLOR="#0066FF">Total Hex: B1D7</FONT></P>
<CENTER>
<P><A HREF="apb.htm" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/htm/apb.htm"><IMG SRC="../buttons/BLANPREV.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANPREV.GIF" WIDTH="37"
HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A><A HREF="javascript:if(confirm('http://www.mcp.com/sams \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.mcp.com/sams'" tppabs="http://www.mcp.com/sams"><IMG
SRC="../buttons/BLANHOME.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANHOME.GIF" WIDTH="37" HEIGHT="37" ALIGN="BOTTOM"
BORDER="0"></A><A HREF="../index.htm" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/index.htm"><IMG SRC="../buttons/BLANTOC.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANTOC.GIF"
WIDTH="37" HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A><A HREF="apd.htm" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/htm/apd.htm"><IMG SRC="../buttons/BLANNEXT.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANNEXT.GIF"
WIDTH="37" HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A><A HREF="#heading1"><IMG SRC="../buttons/BLANTOP.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANTOP.GIF"
WIDTH="37" HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A>
</CENTER>
</BODY>
</HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -