计算机组织和图灵机

上传人:meiw****njun 文档编号:544257756 上传时间:2024-06-16 格式:PPTX 页数:35 大小:556.87KB
返回 下载 相关 举报
计算机组织和图灵机_第1页
第1页 / 共35页
计算机组织和图灵机_第2页
第2页 / 共35页
计算机组织和图灵机_第3页
第3页 / 共35页
计算机组织和图灵机_第4页
第4页 / 共35页
计算机组织和图灵机_第5页
第5页 / 共35页
点击查看更多>>
资源描述

《计算机组织和图灵机》由会员分享,可在线阅读,更多相关《计算机组织和图灵机(35页珍藏版)》请在金锄头文库上搜索。

1、1Computer Organization and Turing MachinesLecture Eight2OutlineoComponents in a modern computeroVon Neumann architectureoComputer instructionsoTuring machines3Computer Components(outside)Mouse(input device)CPU boxMonitor(output device)Keyboard(input device)CD/DVD/floppy drives(I/O devices)4Computer

2、Components(inside)1.Optical drive 2.Diskette drive3.Hard drive4.Internal speaker5.Chassis intrusion switch6.System board7.Expansion-card slots8.I/O ports and connectors9.AC power connector10.Power supply11.Padlock ring12.Microprocessor and heat sink shroud5Computer Components(system board)1.PC speak

3、er 2.DC power connector 3.Diskette drive connector 4.Battery 5.EIDE2 connector 6.Auxiliary power indicator 7.Memory module(DIMM)connectors(2)8.Front-panel cable connector 9.EIDE1 connector 10.PCI 2 riser connector 11.PCI 1 connector 12.AGP/GPA(AIMM)connector 13.Video connector(upper)and audio connec

4、tors(lower)14.CD audio and telephony connectors 15.NIC connector(upper)and USB connectors(2)(lower)16.Keyboard(lower)and mouse(upper)connectors 17.Diagnostic LEDs 18.Voltage regulator module 19.Parallel port(upper)and serial port(2)(lower)connectors 20.Microprocessor fan connector 21.Microprocessor

5、and heat sink assemblyCPU6Central Processing Unit(CPU)The heart of the computer is the central processing unit which has the raw computing power to do arithmetic and logical operations on data.A 3.0 GHertz computer means roughly it can perform a basic step 3.0 x109 times per second.7Computer Organiz

6、ationControlData PathCPUMemoryInputOutputBoth the data and program are stored in memory as“numbers”.8Programming a Computer(in old days)Programming in the early days meant to plug or unplug,or connection cables in certain way.9Programming a Modern Computerswap(int v,int k)int temp;temp=vk;vk=vk+1;vk

7、+1=temp;swap:mul$2,$5,4 add$2,$4,$2 lw$15,0($2)lw$16,4($2)sw$16,0($2)sw$15,4($2)j$3100000000101000010000000000011000 00000000100011100001100000100001 10001100011000100000000000000000 10001100111100100000000000000100 10101100111100100000000000000000 10101100011000100000000000000100 000000111110000000

8、00000000001000 Use an editor,a programmer writes C code.A compiler translates the C program into assembly language.Another translation makes it ready for computer to use.MIPS machine code10A closer look at machine instructionsCPUMemory$1$2$3$41.Transfer data in register to/from memory2.Do arithmetic

9、 on the values of registers,and put result in other register.3.Control certain line of codes executed repeatedly or conditionally.Registers11Computer Memory01000011010010011101000101011111110000100110101100000010Location 1Location 2Location 3Location 4.Location 1048576Location 1048575AddressMemory c

10、onsists of cells each of which can store 8-bits of information.Each cell has a unique address to it.Contents are stored in internal memory temporarily,and stored in external harddisk or other media permanently.Both programs and data are stored in memory as sequence of 0s and 1s.Internal SIMMHarddisk

11、12Examples of InstructionsControlCPUMemorylw$4,0($2)add$3,$4,$2j$310101101010001111$1$2$3$4The first instruction lw$4,0($2)says load the value stored at location given by the value of register 2 into register number 4.The second instruction asks to add the values in registers 4 and 2,and put the res

12、ult back in register 3.The last instruction asks the program to jump to a location in memory stored in register 31.To read the instruction from there.The bottom part stores data(in binary,of course)used and altered by the program.dataprogramRegisters13Building Block of CPU Circuit Logical Gates A lo

13、gical value is TRUE or FALSE,or in computer science 1 or 0.1 and 0 can be represented by low or high voltage.From basic electronic circuit,one can build simple devices like logical AND,OR,Negation,or simple choices.141-bit Logical AND,OR,and AddThis 1-bit device takes two inputs(a and b,both take va

14、lues 0 or 1),a“Carry in”and mode of operations,0 for AND,1 for OR,and 2 for Add(sum),produces 1-bit result and a carry bit.E.g.,for add 1 1 0 0+1 +0 +1 +0 1 1 0 1 0 1 0 0ResultCarry1532-bit Arithmetic and Logical UnitBy combining 32 simple units of 1-bit device,we can construct useful 32-bit adder,a

15、s well as bit-wise logical AND and OR.There is no need to build a separate unit for subtraction if we represent negative integer by 2s complement.162s Complement for Negative Integers(4-bit numbers)000000010010001101000101011001111000100110101011110011011110111101234567 8 -8 9 -710 -611 -512 -413 -3

16、14 -215 -1Positive valuesUnsignedOr negativeTo get 2s complement representation of a negative number n,write out positive n in binary,complement all the bits,then add one.172s Complement,exampleoTo write 1 in 2s component binary,we write(e.g.,4-bit pattern)0001,complementing all bits,to get1110After adding 1 to it,we get1111o1111 represents 1.0001+11111 0000 1-10bit-pattern decimal valueOverflow bit discarded18Turing Machine,IntroductionoHow powerful a computer can be?Can it replace intelligence

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 研究报告 > 信息产业

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号