版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Computer control technology1 Computer structure and functionThis section introduces the internal architecture of a computer and describes how instructions are stored and interpreted and explains how the instruction execution cycle is broken down into its various components.At the most basic level, a
2、 computer simply executes binary-coded results. For a general-purpose programmable computer, four necessary elements are the memory, central processing unit (CPU, or simply processor), an external processor bus, and an input/output system as indicated in Fig.3-1 A-1.Fig. 3-1A-1 Basic elements of a c
3、omputerThe memory stores instructions and data.The CPU reads and interprets the instructions, reads the data required by each instruction, executes the action required by the instruction, and stores the results back in memory. One of the actions that is required of the CPU is to read data from or wr
4、ite data to an external device. This is carried out using the input/output system.The external processor bus is a set of electric conductors that carries data, address and control information between the other computer elements.1-1 The memoryThe memory of a computer consists of a set of sequentially
5、 numbered locations.Each location is a register in which binary information can be stored. The“number” of a location is called its address. The lowest address is 0. The manufacturer defines a word length for the processor that is an integral number of locations long. In each word the bits can repres
6、ent either data or instructions. For the Intel 8086/87 and Motorola MC6800 microprocessors, a word is 16 bits long, but each memory location has only 8 bits and thus two 8-bit locations must be accessed to obtain each data word.In order to use the contents of memory, the processor must fetch the con
7、tents of the right location. To carry out a fetch, the processor places (enables) the binary-coded address of the desired location onto the address lines of the external processor bus. The memory then allows the contents of the addressed memory location to be read by the processor. The process of fe
8、tching the contents of a memory location does not alter the contents of that location.Instructions in memoiIyistructions stored in memory are fetched by the CPU and unless program branches occur, they are executed in the sequence they appear in memory. An instruction written as a binary pattern is c
9、alled a machine-language instruction. One way to achieve meaningful patterns is to divide up the bits into fields as indicated in Fig. 3-1A-2, with each field containing a code for a different type of information.16-bit instruction wordsIFields Opcodemmediate codeOperand dataBranch address0001010110
10、00XXXXSet5 in location 8010000011000XXXXSubtract1 from location 80011XXXXXXXX0100If zero, branchto location 4.XXXX : not u sed (or “ don t care”)Each instruction in our simple computer can be divided up into four fields of 4 bits each. Each instruction can contain operation code (or opcode, each ins
11、truction has a unique opcode), operand address, immediate operands, branch address.In a real instruction set there are many more instructions. There is also a much large number of memory locations in which to store instructions and data. In order to increase the number of memory locations, the addre
12、ss fields and hence the instructions must be longer than 16 bits if we use the same approach. There are a number of ways to increase the addressing range of the microprocessor without increasing the instruction length: variable instruction field, multiword instructions, multiple addressing modes, va
13、riable instruction length. We will not discuss them in detail.Data in memory data is information that is represented in memory as a code. For efficient use of the memory space and processing time, most computers provide the capability of manipulating data of different lengths and representations in
14、memory. The various different representations recognized by the processor are called its data types. The data types normally used are: bit, binary-coded decimal digit (4-bit nibble, BCD), byte (8 bits), word (2 bytes), double word (4 bytes).Some processors provide instructions that manipulate other
15、data types such as single-precision floating-point data types (32bits) and double-precision floating-point data types (64 bits). There is another type of data character data. It is also usually represented in 8 bits. Each computer terminal key and key combination (such as shift and control functions
16、) on a standard terminal keyboard has a 7-bits code defined by the American Standard Code for Information Interchange (ASCII).Type of memory In the applications of digital control system, we also concerned with the characteristics of different memory techniques. For primary memory, we need it to be
17、stored information temporarily and to be written and got information from successive or from widely different locations. This type memory is called random-access memory (RAM). In some case we do not want the information in memory to be lost. So we are willing to use special techniques to write into
18、memory. If writing is accomplished only once by physically changing connections, the memory is called a read-only memory (ROM). If the interconnection pattern can be programmed to be set, the memory is called a programmable read-only memory (PROM). If rewriting can be accomplished when it is necessa
19、ry, we have an erasable programmable read-only memory (EPROM). An electronically erasable PROM is abbreviated EEPROM.1-2 The CPUThe CPUs job is to fetch instructions from memory and execute these instructions. The structure of the CPU is shown in Fig. 3-1A-3. It has four main components: an arithmet
20、ic and logical unit (ALU), a set of registers, an internal processor bus and controller.Fig.3-1A-3 Central processing unit (CPU)These and other components of the CPU and their participation in theinstruction cycle are described in the following sections.Arithmetic and Logical Unit (ALU) The ALU prov
21、ides a wide arithmetic operations, including add, subtract, multiply, and divide. It can also perform Boolean logic operations such as AND, OR, and COMPLEMENT on binary data. Other operations, such as word compares, are also available. The majority of computer tasks involve the ALU, but a great amou
22、nt of data movement is required in order to make use of the ALU instructions.Registers A set of registers inside the CPU in used to store information.Instruction register When an instruction is fetched, it is copied into the instruction register, where it is decoded. Decoding means that the operatio
23、n code is examined and used to determine the steps of the execution sequence.Programmers model of the CPU The collection of registers that can be examined or modified by a programmer is called the programmers model of the CPU. The only registers that can be manipulated by the instruction set, or are
24、 visibly affected by hardware inputs or the results of operations upon data, are the registers represented in the model.Flag register The execution sequence is determined not only by the instruction but also by the results of the previous instructions. For example, if an addition is carried out in t
25、he ALU, data on the result of the addition (whether the result is positive, negative, or zero, for example) is stored in what is known as a flag register, status register, or condition register. If the next instruction is a conditional branch instruction, the flag word is tested in that instruction
26、to determine if a branch if a branch is required.Program counter (instruction pointer) The address of the next instruction islocated in a register called the program counter.Data registers When an instruction uses the registers to store data, the reference to the register in the instruction is calle
27、d register addressing. The reasons of making use of the internal registers to store data are that they can make the instructions shorter and make execution faster.Address registers The internal registers can also be used for the storage of address of data in memory data. In such a case, the instruct
28、ion word contains a register number (i.e. a register address). In the register is contained the address of memory data to be used in the instruction. This form of addressing is called register indirect addressing. The contents of the register are said to point to the data in memory.Internal Processo
29、r Bus The internal processor bus moves data between internal register. A bus is a set of closely grouped electric conductors that transfers data, address, and control information between functional blocks of the CPU. Data from a source register can be passed to a destination register when both are e
30、nabled onto (connected to) the bus.Controller The controller provides the proper sequence of control signals for each instruction in a program cycle to be fetched from memory. A total program cycle comprises many instruction cycle, each instruction cycle can be divided up into its component machine
31、cycles and each machine cycle comprises a number of clock cycle.In order to fetch an instruction, for example illustrated in Fig.3-1A-4, the address in the program counter is placed on the address lines of the external bus (AB) at the onset of clock cycle C . Simultaneously, using a code on the control lines of the bus (CB), the CPU informs all devices attached to the bus that an “opcode” fetch machinecycle is being executed by the CPU. The memory allows the memory address to select the memory location containing the instruction. At C2 the controlle
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2027年唐山市社区卫生服务中心招聘考试社区护理密押试卷打印版及答案
- 2026年电信行业战略咨询报告及未来五至十年研发投入与专利布局
- 2026年手工纸制造行业市场分析报告及未来五至十年全球化布局与出海机会
- 2026年宠物服务行业发展趋势及投资前景报告及未来五至十年新兴市场与增量突破
- 2027年兰州市社区卫生服务中心招聘考试卫生法律法规密押试卷(2027版)及答案
- 2026年汽车EPS(电动助力转向系统)行业洞察报告及未来五至十年发展趋势报告
- 2026年真丝围巾行业洞察报告及未来五至十年发展趋势报告
- 中小企业转型升级中的技术创新研究论文
- 2026年危化品主要负责人考试试题及答案
- 2026年危化管理工作计划
- 2026年高校教师资格证之高等教育学考试题库附参考答案【综合题】
- 工程伦理-形考任务二(权重20%)-国开(SX)-参考资料
- 文学写作入门(华东师范大学)学习通网课章节测试答案
- 第7课 我是班级值日生(教学课件)小学二年级上册 统编版《道德与法治》新教材
- 冬季采购融雪剂项目方案投标文件(技术方案)
- 保定法院书记员考试试题及答案
- 板块运动与地貌课件高中地理选择性必修1
- 子宫穿孔护理技术规范
- GB/T 9799-2024金属及其他无机覆盖层钢铁上经过处理的锌电镀层
- 静电场中的能量单元测试-2024-2025学年高二上学期物理人教版(2019)必修第三册
- 感悟考古-知到答案、智慧树答案
评论
0/150
提交评论