Chapter 10. Alternative 10s
第十章、十进制替代
Although this chapter is about alternative number bases (including binary),
it concludes with two circuits that demonstrate how binary numbers can be interpreted or generated
by circuits using logic gates.
虽然本章讨论的是备用数基(包括二进制),但结尾有两个电路,展示了如何通过逻辑门解释或生成电路。
Three-to-Eight Decoder (page 114)
3-8 解码器
The first circuit, called a decoder, shows the decimal value of a three digit binary number.
Toggle the switches at the top with mouse clicks or finger taps.
The illuminated light at the bottom shows the value of that binary number.
For example, binary 101 is decimal 5.
第一个电路称为解码器,显示三位二进制数字的小数值。 用鼠标点击或手指轻触顶部的开关切换。
底部亮起的灯显示该二进制数值。 例如,二进制101是十进制5。
Eight-to-Three Encoder (page 116)
8-3 编码器
This second circuit is called an encoder.
Use your mouse or finger to drag the oblong bar at the top to a particular decimal number from 0 through 7.
The output at the bottom shows the value of that number in binary.
For example, decimal 6 is binary 110.
第二个电路称为编码器。 用鼠标或手指将顶部的长方形横杆拖到0到7的某个小数点。
底部的输出显示该数字的二进制值。 例如,小数6是二进制110。
How Many Two-Input Gates Are There?
有多少个双输入门?
In Chapter 8, you were introduced to the four standard two-input gates: AND, OR, NAND, and NOR.
But you may have wondered: Are there others, and if so, how many others are there?
在第8章,你接触到了四个标准的双输入门:AND、OR、NAND 和 NOR。
但你可能会想:还有其他的吗?如果有,又有多少?
Sixteen. There are 16 unique two-input gates.
十六。共有16个独特的双输入门。
You can convince yourself of this fact by putting together a table that shows
all the combinations of inputs (represented by A and B) and the resultant output.
Each row starting with the row labeled Output is a different possible two-input gate:
你可以通过整理一个表格,列出所有输入组合(由 A 和 B 表示)及其输出,来说服自己这个事实。
每一行以标记为 Output 的行开头,都是一个不同的可能的双输入门:
| A: | 0 | 0 | 1 | 1 |
|---|---|---|---|---|
| B: | 0 | 1 | 0 | 1 |
| Output: | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 1 | |
| 0 | 0 | 1 | 0 | |
| 0 | 0 | 1 | 1 | |
| 0 | 1 | 0 | 0 | |
| 0 | 1 | 0 | 1 | |
| 0 | 1 | 1 | 0 | |
| 0 | 1 | 1 | 1 | |
| 1 | 0 | 0 | 0 | |
| 1 | 0 | 0 | 1 | |
| 1 | 0 | 1 | 0 | |
| 1 | 0 | 1 | 1 | |
| 1 | 1 | 0 | 0 | |
| 1 | 1 | 0 | 1 | |
| 1 | 1 | 1 | 0 | |
| 1 | 1 | 1 | 1 |
You know you've accounted for all the possibilities because the sixteen rows of Output
are the binary numbers for 0 through 15.
你知道你已经考虑了所有可能性,因为输出有十六行 是0到15的二进制数。
Some of these possible two-input gates are trivial, such as the first and last,
which don't depend on any of the inputs.
Some of them only depend on one of the inputs.
But they all can be represented by combinations of more basic logical operations possible with the standard four gates
and the inverter:
其中一些可能的双输入门是平凡的,比如第一个和最后一个门,它们不依赖于任何输入。
有些设备只依赖于其中一个输入。但它们都可以用标准四门和反相器实现的更基础逻辑运算组合来表示:
| A: | 0 | 0 | 1 | 1 | |
|---|---|---|---|---|---|
| B: | 0 | 1 | 0 | 1 | Logical operation |
| Output: | 0 | 0 | 0 | 0 | 0 (ground) |
| 0 | 0 | 0 | 1 | AND | |
| 0 | 0 | 1 | 0 | A AND NOT B | |
| 0 | 0 | 1 | 1 | A | |
| 0 | 1 | 0 | 0 | NOT A AND B | |
| 0 | 1 | 0 | 1 | B | |
| 0 | 1 | 1 | 0 | (A OR B) AND (A NAND B) | |
| 0 | 1 | 1 | 1 | OR | |
| 1 | 0 | 0 | 0 | NOR | |
| 1 | 0 | 0 | 1 | (A NOR B) OR (A AND B) | |
| 1 | 0 | 1 | 0 | NOT B | |
| 1 | 0 | 1 | 1 | A OR NOT B | |
| 1 | 1 | 0 | 0 | NOT A | |
| 1 | 1 | 0 | 1 | NOT A OR B | |
| 1 | 1 | 1 | 0 | NAND | |
| 1 | 1 | 1 | 1 | 1 (V) |
If you study this table closely, you'll see that the top half of the Output section
is a mirror image of the bottom half: 0 (the top row) is the opposite of 1 (the bottom row);
AND (the second row) is the opposite of NAND (the penultimate row); and so forth.
如果你仔细研究这个表格,你会发现输出部分的上半部分 是下半部分的镜像:0(上排)是1(下排)的对立面;
AND(第二排)与 NAND(倒数第二排)相反; 诸如此类。
The two longest and most complex logical operations are towards the center.
In the first case, the output is 1 when either A and B is 1 but not both;
and in the second case, the output is 1 when either A and B are both 0 or both 1.
最长且最复杂的两个逻辑运算位于中心方向。第一种情况下,当 A 和 B 为 1 但不同时为 1 时,输出为 1;
在第二种情况下,当 A 和 B 都为 0 或均为 1 时,输出为 1。
The first case — an output is 1 when either A or B is 1 but not both — turns out
to be very important for performing a very common task, as you'll see in Chapter 14.
第一种情况——当 A 或 B 为 1 但不同时是 1 时输出为 1——结果是 对于执行一项非常常见的任务非常重要,正如你将在第14章看到的那样。
