ALevel-CS Chapter 03
Hardware
3.01 Overview of computer system hardware functionality
hardware
X86服务器
X86架构详解
- 总线:就是一条或者多条物理上的导线,每个部件都接到这些导线上,同一时刻只能有一个部件在接收或者发送。
- 仲裁总线:所有部件按照另一条总线,也就是仲裁总线或者中断总线上给出的信号来判断这个时刻总线可以由哪个部件来使用。产生仲裁总线或者中断电位的可以是CPU,也可以是总线上的其他设备。
- PCI总线:目前台式机与服务器所普遍使用的一种南桥与外设连接的总线技术。
- 北桥芯片:IO总线和以太网HUB模型的区别在于多了一个北桥芯片。因为CPU和内存足够快,他们之间单独用一个总线连接,这个总线和慢速IO总线之间通过一个桥接芯片连接,也就是主板上的北桥芯片。这个芯片连接了CPU、内存和IO总线。
- 前端总线:CPU与北桥连接的总线叫做系统总线,也叫作前端总线。
- 内存总线:内存与北桥连接的总线叫做内存总线。
- 南桥:由于北桥速度太快,而IO总线速度相对北桥显得太慢,所以北桥和IO总线之间,往往要增加一个网桥,叫做南桥,在南桥上一般集成了众多外设的控制器,比如磁盘控制器、USD控制器等。
- 总线位数:系统总线的条数,比如64条或者128条,叫做总线的位数。
- CPU位数:寄存器和运算单元之间总线的条数。
- IO总线分成数据总线、地址总线和控制总线。寻址用地址总线,发数据用数据总线,发中断信号用控制总线。IO总线是并行而不是串行的。
- 通信:CPU、内存和磁盘之间通过网络来通信,因为主板上的总线很短、很稳定,所以CPU和存储设备之间组成的一个“网络”不需要运输层,而只需要物理层、网络层和上三层的网络。每个IO设备在启动时都要向内存中映射一个或者多个地址,这个地址有8位长,又被称做IO端口。针对这个地址的数据,统统被被北桥芯片重定向到总线上实际的设备上。
overview
A computer system has to support three major areas of operational capability::
- the processing of data
- the storage of data
- the input and output of data.
Data Storage
Data output
- screen display
- hardcopy using a printer or plotter
- virtual headset display
- a speaker
- writing to any of the data storage devices described earlier
- transmission on a network link.
Data input
- keyboard or keypad entry by a user
- user interaction with a screen using screen icons or menus; possibly using a pointing device and possibly involving the use of a touch screen
- a user using a game controller
- a user using a scanner
- a user using a microphone in tandem with voice recognition software
- reading from any of the storage devices described earlier
- transmission on a network link.
3.02 Embedded System
Embedded System
Any manufactured item that has mechanical or electrical parts will almost certainly contain one or more embedded systems.
An embedded system must still contain a processor, memory and an I/O capability. Alternatively, the embedded system can provide a full user interface as, for example, in a mobile phone.
The major advantage of embedded systems is that they are special-purpose; possibly performing only a single function.
Embedded systems are now part of what is called the IoT (Internet of Things). More and more embedded systems are being installed with a network connection.
3.03 Memory components
Key Terms
- Random-access memory (RAM) - volatile memory that can be read from or written to any number of times
- Read-only memory (ROM) - non-volatile memory that cannot be written to but can be read from any number of times
- Buffer - a temporary storage created for data transmitted from one part of the system to another which functions as a queue
存储
存储金字塔
存储器分类
内存分类
RAM (内存)
RAM(Random Access Memory)的全名为随机存取记忆体,它相当于PC机上的移动存储,用来存储和保存数据的。它在任何时候都可以读写,RAM通常是作为操作系统或其他正在运行程序的临时存储介质(可称作系统内存)。当电源关闭时RAM不能保留数据,如果需要保存数据,就必须把它们写入到一个长期的存储器中(例如硬盘)
RAM内存可以进一步分为静态内存SRAM和动态内存DRAM两大类。DRAM由于具有较低的单位容量价格,所以被大量的采用作为系统的主记忆。
静态随机存储器(SRAM)只要保持通电,里面存储的数据就可以恒常保持。当电力供应停止时,SRAM存储的数据会消失
动态随机存储器(DRAM)里面锁存储的数据需要周期性的更新。 (SSD由控制单元和存储单元组成)
ROM:(操作系统)
ROM(Read Only Memory)的全名为唯读记忆体,它相当于PC机上的硬盘,用来存储和保存数据。ROM数据不能随意更新,但是在任何时候都可以读取。即使是断电,ROM也能够保留数据。但是资料一但写入后只能用特殊方法或根本无法更改,因此ROM常在嵌入式系统中担任存放作业系统的用途。现在市面上主流的PDA的ROM大小是64MB以及128MB。
FLASH:(存储)
FLASH存储器又称闪存,它结合了ROM和RAM的长处,不仅具备电子可擦除可编程(EEPROM)的性能,还不会断电丢失数据同时可以快速读取数据(NVRAM的优势),U盘和MP3里用的就是这种存储器。
Main Memory 主存储
存储体由许多的存储单元组成,每个存储单元里面又包含了若干个存储原件,每个存储元件可以存储一位二进制数 0/1。
一个存储单元可以存储一连串的二进制代码,这串二进制代码被称为一个存储字,代码的位数为存储字长
在存储体中,存储单元是有编号的,这些编号称为存储单元的地址号。
MAR叫做存储地址寄存器,保存的是存储单元的地址,其位数反映了存储单元的个数
MDR表示存储数据寄存器,其位数反映存储字长。MDR存放的是从存储原件读出,或者要写入某存储原件的数据。
~ CPU读写主存储器的流程?
Memory components
The components that make up the main memory of a general-purpose computer system are called random-access memory (RAM).
It is called RAM because any byte of data stored can be accessed without affecting the other bytes stored.
A key feature of RAM is that it is volatile, which means that when the computer system is switched off the contents of the memory are lost.
SRAM and DRAM
Dynamic RAM (DRAM) is constructed from capacitors that leak electricity and therefore need regularly recharging (every few milliseconds) to maintain the identity of the data stored. Static RAM (SRAM) is constructed from flip-flops that **continue to store data indefinitely **while the computer system is switched on.
DRAM requires fewer electronic components per bit stored. This means DRAM is cheaper to make and has a higher density for data storage.
The major advantage of SRAM is that it provides shorter access time.
ROM
Read-only memory (ROM). The data in ROM is not lost when the computer system is switched off; the memory is non-volatile.
ROM is used in many embedded systems
different types of ROM :
- In the simplest type of ROM the programs or data are installed as part of the manufacturing process. If different contents are needed the chip must be replaced. (完全不可写,程序是制造的一部分,如果要改变的话就需要换一块芯片)
- An alternative is Programmable ROM (PROM). The manufacturer of the chip supplies chips to a system builder. The system builder installs the program or data into the chips. This allows the system builder to test some samples of programmed chip before committing the whole batch to be programmed. As with the simplest type of ROM, the program or data once installed cannot be changed. (可编程ROM,系统的制造商将程序或数据安装到芯片中,安装后的程序无法更改)
- A more flexible type of ROM is Erasable PROM (EPROM). The installed data or program can be erased (using ultraviolet light) and new data or a new program can be installed. However, this reprogramming usually requires the chip to be removed from the circuit.(可擦除ROM,可以安装新数据或者程序)
- The most flexible type of ROM is Electrically Erasable PROM (EEPROM). As the name suggests, this works in a similar way to EPROM, except an electrical signal can be used to remove existing data. This has the major advantage that the chip can remain in the circuit while the contents are changed. However, the chip is still used as read-only. (电可擦除ROM,使用电信号来删除现有数据,内容更改时芯片可以保留在电路中,但芯片依然是只读的)
Buffers
Whenever data has to be transferred from one part of a computer system to another, a problem occurs if the data can be sent more quickly than it can be received.
Data enters a buffer before being transmitted to its destination. The buffer functions as a queue so the data emerges in the order that it has entered the buffer.
the buffer is created in the computer memory.
3.04 Secondary storage devices
Magnetic media
- there is more than one platter (disk) (多个磁盘)
- each platter has a read–write head for each side
- the platters spin in unison (all together and at the same speed)
- the read–write heads are attached to actuator arms which allow the heads to move over the surfaces of the platters
- the motion of each read–write head is synchronised with the motion of the other heads
- a cushion of air ensures that a head does not touch a platter surface.
Hard driver components
Data are stored in concentric tracks (tracks sharing the same centre). Each track consists of a sequence of bits. These are formatted into sectors where each sector contains a defined number of bytes.The sector becomes the smallest unit of storage. Because the movement of the heads is synchronised, the same tracks on different disks can have related data stored on them. These are accessible by just one movement of the head. The collection of tracks is referred to as a ‘cylinder’.
To store a file, a sufficient number of sectors have to be allocated but these might or might not be next to each other. As files are created and subsequently deleted or edited the use of the sectors becomes increasingly fragmented, which degrades the performance of the disk. A defragmentation program can reorganise the allocation of sectors to files to restore performance.
Optical Media
- The optical disc has one spiral track running from the inner extreme of the surface to the outer edge.
- During operation, the disc spins.
- Simultaneously the laser moves across ensuring that it is continuously focused on the spiral track.
- The track on the surface of the disc has what are referred to as ‘pits’ and ‘lands’.
- The laser beam is reflected from the surface of the disc.
- The difference between the reflection from a pit compared to that from a land can be detected.
- This difference in the intensity of the light the detector receives can be interpreted as either a 1 or a 0 to allow a binary code to be read from the disc.
Solid-state media
The basis for this is ‘flash’ memory, which is a semiconductor technology with no moving parts.
The writing to the memory and the reading from it is handled by a NAND flash controller. The special feature is that blocks of memory cells can have their contents erased all at once ‘in a flash’.
The most frequent use is either in a memory card or in a USB flash drive (memory stick).
The alternative use is as a substitute for a hard disk when it is often referred to as a solid-state drive (SSD).
advantage over the traditional hard driver::
- no moving parts
- the faster access speed
3.05 Output devices provided for a user of a general-purpose computer system
CRT 与 LCD 显示器
CRT 阴极射线显像管,使用阴极射线管的显示器。 CRT显示器是靠电子束激发屏幕内表面的荧光粉来显示图像的,由于荧光粉被点亮后很快会熄灭,所以电子枪必须循环地不断激发这些点。 首先,在荧光屏上涂满了按一定方式紧密排列的红、绿、蓝三种颜色的荧光粉点或荧光粉条,称为荧光粉单元,相邻的红、绿、蓝荧光粉单元各一个为一组,学名称之为像素。每个像素中都拥有红、绿、蓝(R、G、B)三基色。
LCD液晶显示器(LCD/Liquid Crystal Display)的显像原理,是将液晶置于两片导电玻璃之间,靠两个电极间电场的驱动,引起液晶分子扭曲向列的电场效应,以控制光源透射或遮蔽功能,在电源关开之间产生明暗变化,从而将影像显示出来。
当在不加上电极的时候,当入射的光线经过下面的偏光板(起偏器)时, 会剩下单方向的光波,通过液晶分子时, 由于液晶分子总共旋转了90度, 所以当光波到达上层偏光板时, 光波的极化方向恰好转了90度。下层的偏光板与上层偏光板, 角度也是恰好差异90度。 所以光线便可以顺利的通过,如果光打在红色的滤光片上就显示为红色。效果如图中前两个图所示。(这里的下偏振片是让振动方向平行的光投过,而上偏振片是让振动方向垂直的光透过,在没液晶的情况下,光源透过下偏振片光振动方向都是水平的,当透过上偏振片的时候都被过滤掉了,因为只允许垂直的光透过) 当在加上电极后(最大电极),液晶分子在受到电场的影响下,都站立着,光路没有改变,光就无法通过上偏光板,也就无法显示,如图蓝色滤光片下面的液晶。
LCD 与 LED
LCD
LCD是液晶显示屏Liquid Crystal Display的全称,主要有TFT、UFB、TFD、STN等几种类型的液晶显示屏。 LCD的构造是在两片平行的玻璃基板当中放置液晶盒,下基板玻璃上设置TFT(薄膜晶体管),上基板玻璃上设置彩色滤光片,通过TFT上的信号与电压改变来控制液晶分子的转动方向,从而达到控制每个像素点偏振光出射与否而达到显示目的。LCD是一种介于固态与液态之间的物质,本身是不能发光的,需借助要额外的光源才行。因此,灯管数目关系着液晶显示器亮度。
LED
LED(Light-emitting diode)发光二极管屏幕,其实这些显示器的影像仍是以液晶产生,发光二极管只是当作光源,在技术上仍是LCD显示器,或叫LED背光液晶显示电视。 说白了LED就是LCD的一种,有些厂家特意把电视叫做“LED TV”的,基本可以认定都是在炒作,想往OLED靠拢,卖个高价。小伙伴们,一定要看清哟! LED屏幕的液晶(LCD)电视,优点在于体积小,功耗低,寿命长,成本低,亮度高,可视角度远和刷新率高等特性,缺点是色彩表现比较差,特别是在液晶屏折叠的地方颜色偏差更为明显。
OLED
OLED(Organic Light-Emitting Diode)有机发光二极管,它和LED仅仅虽然只有一个字母之差,但实际上两者描述的是完全不同的事物。我们都知道液晶面板是通过背光源发光,通过液晶分子的折射而产生各种不同的颜色的,液晶分子自身不能发光,而LED则仅仅指的只是背光源。而OLED则自身能够发光,因此不需要背光源。LED用的是金属材料,而OLED用的是有机物料,它不用灯光照射就能自主发光,对比度更好些,平时用的LED是要有背光灯照射才能看到东西的。目前发光二极管所利用的材料均为无机半导体材料,较难应用于大面积并需要有高分辨率的组件(EX::屏幕),要解决这些问题有赖于新型有机半导体材料(即含碳氢化合物之材料),将它涂布在导电的玻璃片上,通以电流,就可以放出各种不同波长的光。
screen display
Screen displays are also based on the pixel concept but with one major difference. A screen pixel consists of three sub-pixels typically one each for red, green and blue.
In the original cathode ray tube (CRT) technology, there is no individual component for a pixel.
The liquid-crystal display (LCD) screen is an example. It has individual cells containing a liquid crystal to create each pixel.
The back-lighting is usually provided by light-emitting diodes (LEDs).
Virtual reality headset
The most important components of a virtual reality headset are the two eye-pieces.
Hard-copy output of text
These are the inkjet printer and the laser printer. Both these technologies can be used to print text or images.
Inject printer
Inject Printer steps:
- A sheet of paper is fed in;
- the printhead moves across the sheet depositing ink on to the paper;
- the paper is moved forward a fraction and the printhead moves across the paper again.
- This continues until the sheet has been fully printed.
- The printhead consists of nozzles that spray droplets on to the paper.
Laser Printer
Laser printer steps:
- The drum is given an electric charge.
- The drum starts to revolve step by step.
- At each step a laser beam is directed by the mirror and lens assembly to a sequence of positions across the width of the drum.
- At each position the laser is either switched off to leave the charge on the drum or switched on to discharge the position.
- This process repeats until a full-page electrostatic image has been created.
- The drum is coated with a charged toner that only sticks to positions where the drum has been discharged.
- The drum rolls over a sheet of paper which is initially given an electric charge.
- The sheet of paper is discharged and then is passed through heated rollers to fuse the toner particles and seal the image on the paper surface.
- The drum is discharged before the process starts again for the next page.
Hard-copy graphics output
A 3D design is created in a suitable computer-aided design (CAD) package. The design is split into layers. The data for the first layer is transmitted to the 3D printer. Rather than using ink to draw the layer, the 3D printer uses a nozzle to squirt material on to the printer bed to create a physical layer to match the design. This process is repeated for successive layers. When the whole object has been formed it has to be cured in some way to ensure that the layers are stuck together and the material has been converted to the form required for the finished product.
3.06 Input devices provided for a user of a general-purpose computer system
Key Terms
- Resistive touch screen - a flexible surface that causes contact between electrically resistive layers beneath when touched
- Capacitive touch screen - a rigid surface above a conductive layer that undergoes a change in electrical state when a finger touches the screen
The keyboard
The key press has to be converted to a character code, which is transmitted to the processor.
- The keys are positioned above a key matrix, which consists of a set of rows of wires and another set of columns of wires.
- Pressing a key causes contact at one of the points where wires cross.
- The microprocessor continuously tests to see if any electrical circuit involving a row wire and a column wire has become closed.
- When the microprocessor recognises that a circuit has become closed, it can identify the particular intersection (wire crossing point) that is causing this.
- The processor then uses data stored in the ROM to identify the character code relating to the key associated with that intersection and sends this character to the screen .
The screen
There are a number of ways in which a user can cause data to be input through an interaction with a screen.
Touch screens
The first is the resistive touch screen. This type has two layers separated by a thin space beneath the screen surface. The screen is not rigid so when a finger presses on to the screen the pressure moves the topmost of these two separated layers, so that the top layer makes contact with the lower layer.
The second technology is the capacitive touch screen. This does not require a soft screen but instead makes use of the fact that a finger touching a glass screen can cause a capacitance change in a circuit component immediately below the screen.
Input of a graphic
A webcam is a device used to stream video images into a computer system.
A digital camera can be connected to a computer and stored images or videos can then be downloaded into the computer.
Another option is to use a scanner. Effectively, a scanner reverses the printing process in that it takes an image and creates a digital representation from it.
CCD
- a CCD consists of an array of photo-sensitive cells
- a CCD produces an electrical response proportional to the light intensity for each cell
- a CCD needs an analogue-to-digital converter to create digital values to be transmitted to the computer.
3.07 Input and output of sound
Voice input and output
IP telephony and video conferencing are two applications that require both voice input and voice output.
For input, a microphone is needed. This is a device that has a diaphragm, a flexible material that is caused to vibrate by an incoming sound.
The analogue electrical signal is converted to a digital signal by an analogue-to-digital (ADC) converter so that it can be processed inside the computer.
For output, a speaker (loudspeaker) is needed. Digital data from the computer system is converted to analogue by a digital-to-analogue (DAC) converter. The analogue signal is fed as a varying electrical current to the speaker.