Part 2 Processor and Memory

Part 2
Processor and Memory
The processor and memory, together with the support chips, are usually the main components
of the motherboard. It is these components that make up the actual computer. Important units
such as hard disk drives and interfaces are already known as peripherals. It is only because the
integration of electronic elements is so advanced today that the motherboard doesn’t seem to
be as important as it should. Before the integration of a million elements on a finger-nail钉子 sized
chip was possible, the «motherboard» occupied占据 a whole room! Therefore, it isn’t surprising that
discussing the motherboard will take up a large part of this book. 1 will start with the heart and
brain of the computer - processor and memory.
Some remarks about the processor names are in order: from the 8086/88 up to the 80386 they
follow the convention 惯例 约定80x86. Accordingly, the coprocessors are called 80x87 in general, and
8087, 80287 and 80387 specifically. After releasing the 80386 chip, Intel changed this naming
convention slightly. Now the CPUs are denoted as i386 (or 386 for short), i486, etc., and the
coprocessors as i387, i487, etc. The CPUs (finally) got «real » names with the introduction of
Pentium and Pentium Pro. In the following, 1 will use the terms 8086/88 to 80286, and i386, i486
for the CPUs, as well as 8087, 80287 and i387 for the coprocessors.


2 Intel% Microprocessor for Beginners - The i386
The processor - often also called the CPU - is the heart or brain of a PC. In the processor, data
processing takes place, which requires at least a minimum of intelligence.智力 All other, sometimes
rather complicated,复杂 chips are simply slaves奴隶 of the processor which, together with the memory
chips, is one of the highest integrated elements in a PC. lf you look at the mass market for
powerful general-purpose microprocessors, you will find there are two different processor families
in the CPU industry. They are the 80x86 family from Intel and the 68000 series from Motorola.
The former are installed in IBM-compatible personal computers; the 68000 series are largely
used in Apple Macintosh machines, which are the biggest competitor to IBM compatible PCs.
It’s a shame 羞愧that both families are not compatible; the way in which instructions are given
intemally, the language in which the instructions are given, how the addresses are allocated in
the memory (RAM) and the I/O address areas are entirely different. But let us first turn to the
unavoidable basics for understanding these seemingly very intelligent chips.

2.1 The Field-effect Transistor场效晶体管
Por highly integrated circuits such as microprocessors or memory chips, the MOS Field-effect
Transistor (MOSFET) is particularly suitable. It is small and easy to manufacture, 加工制造yet has a very
low power consumption, which is the difference between supplied power (from a battery, for
example) and the power output by the circuit (for operating a light bulb, for example). This
difference is entirely converted into heat, and heats up the circuit. With one million tiny transistors
which each consume only 1 /lOO 000 watt, the overa11 power consumption has already
reached 10 W. Note that it is not primarily a high current高压电 that destroys the circuit, but the
heating caused by an excessively high current which burns the elements. Figure 2.la shows an
n-channel MOSFET.

The n-channel MOSFET consists of a p-doped 掺杂silicon substrate in which two n+-doped regions
区域are formed, called source and drain排水. The distance between source and drain in an IC中间电路 is usually
about 0.5-5 pm. P-doping means that the substrate accommodates容纳 more positively charged带电 ions
than negatively charged electrons as charge carriers for the current flow inside the substrate.
This is achieved by implanting irnpzrrities. These atoms have less (p-doping with boron, etc.) or
more (n-doping with phosphorus, arsenic, etc.) electrons compared to a silicon atom. The cc+»
indicates that the corresponding regions are highly doped (have a high concentration of these
impurities). Between the two regions the so-called charlnel is located. The conductivity of the
channef (and therefore the resistance of the MOSFET) is controlled by a gafe formed of metal or
Intel’s Microprocessor for Begmners - The 1386 41
polycrystalline silicon, which is separated (and thus isolated) from the substrate by an oxide
layer. Reading from top to bottom, the layer sequence reads metal-oxide-semiconductor; that
is where the name MOS transistor comes from. If a control voltage is applied to the gate, free
charge carriers arise through something like a «sucking effect». The higher the voltage, the more
charge carriers are available, that is, the lower is the resistance of the channel. Note that transistor
is the abbreviation of trunsfer resistor. If a voltage Uos is applied between the source and
drain, then the current 1, fand therefore also the voltage output by the MOSFET) is govemed
by the gate voltage. The current flow does not start until the threshold voltage V,, has been
exceeded. If the saturation value V,, is reached, current through the MOSFET no longer rises,
even if the voltage LI,, between the pate and source rises further. The MOSFET operates in
the saturation region. The currently described MOSFET is, more exactly, called an n-channel
enhancement-type field-effect transistor (see Figure 2.la).
In the same way, a p-channel enhancement-type MOSFET may be constructed by exchanging
the n- and p-layers (see Figure 2.lb). A significant difference between them is the opposite
course of the conductivity with the voltage U,, between the gate and source: a rising U,, means
a rise in conductivity for an n-channel MOSFET, but a decline of the conductivity for a
p-channel MOSFET to zero. Pictorially, the gate voltage drives the charge carriers out of the
channel and thus increases its resistance.
According to individual characteristics, it is apparent that from the threshold voltage Vth up to
the saturation voltage V,,, a linear dependency between the applied voltage and the current
through the MOSFET (and therefore the voltage output by the MOSFET) appears. The MOSFET
is operated in this proportional region if it is installed in an analegue circuit. This is, for example,
the case for a radio or TV receiver. Here an indefinite number of intermediate levels between
minimum and maximum values (minimum and maximum loudness of music, for example) is
possible. But because the current through the MOSFET (and thus its resistance) can only be
determined down to a certain finite precision, the intermediate levels are smudged. Therefore,
no exact value of an intermediate leve1 can be indicated, only its range.
In a digital circuit, however, the MOSFET is operated in a completely different way. Here the
voltage U,, between the gate and source is either below (or in the region of) the threshold
voltage V,, or above (or in the region of) the saturation voltage V,,. Thus, two stable and
unambiguous states of the transistor are defined: the off- and on-states, respectively. In the offstate,
the MOSFET is completely turned off (has an indefinite resistance value), and a maximum
voltage occurs between the source and the drain. In the on-state, the MOSFET leads the maximum
current (has a resistance value of zero) and the voltage between the source and drain is
minimal (equal to the threshold voltage V,h). Therefore, the transistor is used as a switch with
two switching positions (on/off). For logic circuits, the existence of clearly defined and stable
switching positions is essential because logic doesn’t allow any woolly terms such as maybe,
nearly, etc. With two clearly defined and distinguishable switching positions (and therefore
output currents and voltages), we get digital circuits with dual or binary (that is, two-valued)
logic.
To complete the picture, 1 want to mention that in very fast circuits (supercomputers, for
example) a substrate made of gallium-arsenide (GaAs) instead of silicon is used. Moreover,
sometimes bipolar transistors are also used in ECL or BiCMOS circuits to enhance the operation
42 Chapter 2
speed. However, this is achieved with the disadvantage of having a power consumption three
times that of a pure CMOS circuit. Applications of these technologies are the Pentium (BiCMOS)
and the R6000 (ECL), for example. Further, in the context of so-called fizzy logic, ambiguous
terms like nearly, possible, etc. are also allowed. Up to now, this logic has mainly been of
interest in research, but some minor applications, such as in the field of autofocus cameras, are
already on the market. In the original field of data processing, this logic is not used in applications
yet. The on/off logic states of a MOS transistor are converted using corresponding biasing
voltages, resistance combinations, etc. to certain voltage values. In Table 2.1, the voltages for
logical al» and logical «OW for the NMOS and CMOS family, as well as for three additional
bipolar families, are given.
Family u, WI u, WI
NM05 -1 . ..+l 5...10
CMOS 1 . ..2 4...15
TTL 0...0.5 2.5. 5
ECL ca. 3 4...5
IIL ca. 1 2...5
NM09 loglc with n-channel MOS transistors
CMOS: logic wth complementary MOS transistors
TTL: (bipolar) transistor-transistor loglc
ECL: (bipolar) emitter-coupled logic
IIL (bipolar) integrated injection logic
2.2

这是一个检查 Linux 系统硬件信息的 Python 脚本,执行过程如下: 1. 使用命令 `cat /proc/cpuinfo | grep -i 'Model name' | awk -F: '{$1="";sub("^ *","");$2="";sub(" *$","");print}'` 获取 CPU 型号信息; 2. 使用命令 `dmidecode -t processor | grep -c Version` 获取 CPU 版本信息; 3. 使用命令 `dmidecode -t memory | grep -i 'Part Number' | grep -v 'NO DIMM' | awk -F: '{$1="";sub("^ *","");$2="";sub(" *$","");print}'` 获取内存型号信息; 4. 使用命令 `dmidecode -t memory | grep -i size | grep -cvi no` 获取内存大小信息; 5. 使用命令 `lspci | grep Eth | awk -F ': ' '{$1="";sub("^ *","");$2="";sub(" *$","");print}'` 获取网卡型号信息; 6. 将上述信息保存到文件中; 7. 执行 `ipmitool power cycle` 命令重启系统; 8. 进入系统后重复执行步骤 1-5; 9. 循环执行上述步骤 20 次。 下面是实现这个脚本的 Python 代码: ```python import os count = 20 for i in range(count): # 获取 CPU 型号信息 cpu_model = os.popen("cat /proc/cpuinfo | grep -i 'Model name' | awk -F: '{$1=\"\";sub(\"^ *\",\"\",$2);$2=\"\";sub(\" *$\",\"\",$2);print}'").read().strip() # 获取 CPU 版本信息 cpu_version = os.popen("dmidecode -t processor | grep -c Version").read().strip() # 获取内存型号信息 memory_model = os.popen("dmidecode -t memory | grep -i 'Part Number' | grep -v 'NO DIMM' | awk -F: '{$1=\"\";sub(\"^ *\",\"\",$2);$2=\"\";sub(\" *$\",\"\",$2);print}'").read().strip() # 获取内存大小信息 memory_size = os.popen("dmidecode -t memory | grep -i size | grep -cvi no").read().strip() # 获取网卡型号信息 nic_model = os.popen("lspci | grep Eth | awk -F ': ' '{$1=\"\";sub(\"^ *\",\"\",$2);$2=\"\";sub(\" *$\",\"\",$2);print}'").read().strip() # 将信息保存到文件中 with open("hardware_info.txt", "a") as f: f.write(f"CPU 型号: {cpu_model}\n") f.write(f"CPU 版本: {cpu_version}\n") f.write(f"内存型号: {memory_model}\n") f.write(f"内存大小: {memory_size}\n") f.write(f"网卡型号: {nic_model}\n") f.write("\n") # 重启系统 os.system("ipmitool power cycle") # 等待系统重启完成 time.sleep(60) # 再次获取硬件信息 cpu_model = os.popen("cat /proc/cpuinfo | grep -i 'Model name' | awk -F: '{$1=\"\";sub(\"^ *\",\"\",$2);$2=\"\";sub(\" *$\",\"\",$2);print}'").read().strip() cpu_version = os.popen("dmidecode -t processor | grep -c Version").read().strip() memory_model = os.popen("dmidecode -t memory | grep -i 'Part Number' | grep -v 'NO DIMM' | awk -F: '{$1=\"\";sub(\"^ *\",\"\",$2);$2=\"\";sub(\" *$\",\"\",$2);print}'").read().strip() memory_size = os.popen("dmidecode -t memory | grep -i size | grep -cvi no").read().strip() nic_model = os.popen("lspci | grep Eth | awk -F ': ' '{$1=\"\";sub(\"^ *\",\"\",$2);$2=\"\";sub(\" *$\",\"\",$2);print}'").read().strip() # 将信息保存到文件中 with open("hardware_info.txt", "a") as f: f.write(f"重启后 CPU 型号: {cpu_model}\n") f.write(f"重启后 CPU 版本: {cpu_version}\n") f.write(f"重启后 内存型号: {memory_model}\n") f.write(f"重启后 内存大小: {memory_size}\n") f.write(f"重启后 网卡型号: {nic_model}\n") f.write("\n") ``` 注意,如果要执行 `ipmitool power cycle` 命令需要使用 root 权限。此外,为了防止重启过程中文件写入失败,最好将文件名改为绝对路径。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值