英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 3 - Hardware and Software

rrodcioLecture 3HardwareandSoftware:Hardwarehas been definedasthe part of the computer you can kick'!LapinTherest issoftware-thepatternofOsand1sthatcompriseaprogram.Bing:To alarge extenthardwareandsoftwareareinterchangeable-AlogicalfunctioncouldbeimplementedineitherasachiporaprogramVonNeumannArchitectureVonNeumannArchitecture:The earliest computers·In1946,MathematicianJohnVon(1940's) used "hard wired"Neumannproposedthatprogramsprograms where the O's and1's were set by means ofcouldbestored inmemory,thesameswitches orplugboardsway as data.-Bothcanberepresentedbybinarycodes.This"Storedprogram"conceptisthebasisofallmoderncomputersVon Neumann ArchitectureVonNeumannArchitectureSSERIARYIrterface:Memory - this stores the Os and 1s There are basically two sorts· RAM -Random Access MemoryCPUMemory general purpose memorycan be used for storing instructions and data Can be writen to or read from1/0Looses state when power is tumed offPer iphe ralDevicesROM-ReadOnlyMemoRetains state whenThe same basic architecture applied from micro-InaPCitconPOST(powon selftest) and BIOare"andcontrollers to mainframes, although details do differakingROMnot strictlyPROMs,EPROMs
1 1. Introduction 2. Binary Representation 3. Hardware and Software 4. High Level Languages 5. Standard input and output 6. Operators, expression and statements 7. Making Decisions 8. Looping 9. Arrays 10. Basics of pointers 11. Strings 12. Basics of functions 13. More about functions 14. Files 14. Data Structures 16. Case study: lottery number generator Lecture 3 Hardware and Software • Hardware has been defined as ‘the part of the computer you can kick’! • The rest is software - the pattern of 0s and 1s that comprise a program. • To a large extent hardware and software are interchangeable. – A logical function could be implemented in either as a chip or a program Von Neumann Architecture • The earliest computers (1940’s) used “hard wired” programs where the 0’s and 1’s were set by means of switches or plugboards Von Neumann Architecture • In 1946, Mathematician John Von Neumann proposed that programs could be stored in memory, the same way as data. – Both can be represented by binary codes • This “Stored program” concept is the basis of all modern computers. Von Neumann Architecture • The same basic architecture applied from microcontrollers to mainframes, although details do differ CPU Interface Memory I/O Secondary Storage Peripheral Devices printers terminals etc D A T A B U S Von Neumann Architecture • Memory - this stores the 0s and 1s – There are basically two sorts • RAM - Random Access Memory – general purpose memory – can be used for storing instructions and data – Can be written to or read from – Looses state when power is turned off • ROM - Read Only Memory – used to contain permanent data or instructions – Replaces hardwiring – Retains state when power is off – In a PC it contains POST (power on self test) and BIOS (basic input/output systems) programs. These are often called “firmware” and are not strictly speaking ROM • PROMs,EPROMs

VonNeumannArchitectureVonNeumannArchitecture.Secondary Storage·CPU-CentralProcessingUnit provides a further area for storing informafion-Thepowerbehindthecomputer,contains Can take many physical forms but most commonly magneticdisk storagedata registers (intemal memory) for holding Can also have read only secondary storage eg CD-ROMdata Typically address registers for holding memory: slower than main memoryaddresses: larger storage than main memory·ALU-Arithmetic Logic Unit? lower price per MB of memory? Shift registers· Cache memoryVonNeumannArchitectureVonNeumannArchitecture.Buses·V/O-Input/Output-abus is simplyasetofwireswhichactas-forms the interfacebetween thecomputera data highway for moving binaryand external peripheral devicesinformation aroundthecomputer·PeripheralDevices address bus Typically keyboard, display, printer,?data busscanner, network adapter etc·control bus-1 wire transmits one bitMemoryMapMemoryMap-AddressesMemory is organised into bytes (or words), each of8bwhichmusthaveitsownuniqueaddress,so itcanbeFFFFFFidentifiedSupposewehavea24-bitaddressbus,thenthereareBN RAM224=16,777,216 addresses which constitute our addressspace2000FThe lowest is 000000pex and the highest FFFnexNOTUSEDDTPEB4K VOCOFF GAKROM10a2
2 Von Neumann Architecture • Secondary Storage – provides a further area for storing information – Can take many physical forms but most commonly magnetic disk storage – Can also have read only secondary storage eg CD-ROM – Typically • slower than main memory • larger storage than main memory • lower price per MB of memory Von Neumann Architecture • CPU - Central Processing Unit – The power behind the computer, contains • data registers (internal memory) for holding data • address registers for holding memory addresses • ALU - Arithmetic Logic Unit • Shift registers • Cache memory Von Neumann Architecture • Buses – a bus is simply a set of wires which act as a data highway for moving binary information around the computer • address bus • data bus • control bus – 1 wire transmits one bit Von Neumann Architecture • I/O - Input/Output – forms the interface between the computer and external peripheral devices • Peripheral Devices – Typically keyboard, display, printer, scanner, network adapter etc Memory Map • Memory is organised into bytes (or words), each of which must have its own unique address, so it can be identified • Suppose we have a 24-bit address bus, then there are 224=16,777,216 addresses which constitute our address space • The lowest is 000000hex and the highest FFFFFFhex Memory Map - Addresses 8 bits 00 00 00 00 FF FF 8M RAM 02 00 00 7F FF FF 80 00 00 FF FF FF 01 FF FF NOT USED 64K I/O 64K ROM Boot loader etc. “low memory” Memory Mapped I/O Could be filled later General Purpose Memory “high memory

MemoryAccesss-read/WriteMemoryaccesscyclesTo read data from memory into the CPUWrite access is similar but the write line is activated.- The CPU puts the relevant address onto the address businstead of the read line and hence the data isThe appropriate memory cellrecognises its own address (actuallytransferred from the CPU to the memory cell performed by a circuit called an address decoder).It is important to be clear about the difference- The CPU waitsfor this to happen then activates the read linebetween addresses and data.Both arebinary codes The memory cell connects its output to the databus The CPU waits for this to happen then copies the datafrom the busDr RBowdento an internal register9ABC2Daddress-The CPU deactivates the read line, the memory cell is disconnected from the databusThe address identifies a particular memory location The CPU removes the address from the address bus. The data is the contents of that locationNB all operations take a non-zero amount of time which.NB Here data includes instructionsmust be allowed fore.g.a memory read may take 100ns3
3 Memory Access - read/Write cycles • To read data from memory into the CPU – The CPU puts the relevant address onto the address bus – The appropriate memory cell recognises its own address (actually performed by a circuit called an address decoder) – The CPU waits for this to happen then activates the read line – The memory cell connects its output to the databus – The CPU waits for this to happen then copies the data from the bus to an internal register – The CPU deactivates the read line, the memory cell is disconnected from the databus – The CPU removes the address from the address bus • NB all operations take a non-zero amount of time which must be allowed for e.g. a memory read may take 100ns Memory access • Write access is similar but the write line is activated instead of the read line and hence the data is transferred from the CPU to the memory cell • It is important to be clear about the difference between addresses and data. Both are binary codes • The address identifies a particular memory location • The data is the contents of that location NB Here data includes instructions address 9A BC 2D Dr R Bowden
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 8 - Looping.pdf
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 7 - Making Decisions.pdf
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 6 - Operators, Expressions and Statements.pdf
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 5 - Standard IO.pdf
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 4 - Simple Data Types.pdf
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 2 - Binary Representation.pdf
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 1 - Introduction.pdf
- 《计算机程序设计基础》课程学习指南(C语言)给C语言初学者的学习建议.pdf
- 《计算机程序设计基础》课程学习指南(C语言)C语言初学者编程规范-2/2.pdf
- 《计算机程序设计基础》课程学习指南(C语言)C语言初学者编程规范-1/2.pdf
- 《计算机程序设计基础》课程学习指南(C语言)C语言常见问题详解.pdf
- 《计算机程序设计基础》课程学习指南(C语言)C语言常见英文单词.pdf
- 《计算机程序设计基础》课程学习指南(C语言)C语言常见错误中英文对照表.pdf
- 《计算机程序设计基础》课程教学大纲 C Programming Language(C语言).pdf
- 《计算机控制系统》课程教学资源(PPT课件)第7章 计算机控制系统设计与实现.ppt
- 《计算机控制系统》课程教学资源(PPT课件)第6章 分布式测控网络技术.ppt
- 《计算机控制系统》课程教学资源(PPT课件)第5章 计算机控制系统软件设计相关技术.ppt
- 《计算机控制系统》课程教学资源(PPT课件)第4章 先进控制技术.ppt
- 《计算机控制系统》课程教学资源(PPT课件)第3章 常规数字控制技术.ppt
- 《计算机控制系统》课程教学资源(PPT课件)第2章 计算机控制系统硬件设计相关技术.ppt
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 9 - Arrays.pdf
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 10 - Basics of Pointers.pdf
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 11 - Strings.pdf
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 12 - Basics of Functions.pdf
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 13 - More functions.pdf
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 14 - Files.pdf
- 英格兰萨里大学:《C语言》课程教学资源(讲义)Lecture 15 - Data Structures.pdf
- 《计算机程序设计基础》课程授课教案(C语言)第1章 C语言概述.pdf
- 《计算机程序设计基础》课程授课教案(C语言)第2章 基本数据类型和运算符.pdf
- 《计算机程序设计基础》课程授课教案(C语言)第3章 控制结构.pdf
- 《计算机程序设计基础》课程授课教案(C语言)第4章 数组和指针.pdf
- 《计算机程序设计基础》课程授课教案(C语言)第5章 模块化编程.pdf
- 《计算机程序设计基础》课程授课教案(C语言)第6章 指针进阶与内存空间管理.pdf
- 《计算机程序设计基础》课程授课教案(C语言)第7章 结构体与共同体.pdf
- 《计算机程序设计基础》课程授课教案(C语言)第8章 数据文件编程方法.pdf
- 《计算机程序设计基础》课程PPT教学课件(C语言)第1章 C语言概述 1-10 IO函数值和注释语句.ppt
- 《计算机程序设计基础》课程PPT教学课件(C语言)第1章 C语言概述 1-8 标识符和关键字.ppt
- 《计算机程序设计基础》课程PPT教学课件(C语言)第1章 C语言概述 1-11 编程风格与常见错误.ppt
- 《计算机程序设计基础》课程PPT教学课件(C语言)第1章 C语言概述 1-9 输入输出函数.ppt
- 《计算机程序设计基础》课程PPT教学课件(C语言)第1章 C语言概述 1-7 实例求圆柱体底面积和体积.ppt