1.4 Processors Read and Interpret InstruProcessors Read and Interpret Instructions Stored in Memory

本文介绍了C语言的起源及其与Unix操作系统的紧密联系。C语言以其简洁实用的设计成为编程界的基石。文章深入探讨了计算机系统的硬件组织,包括总线、处理器、内存和I/O设备的工作原理,并详细阐述了处理器如何通过加载、存储、运算和跳转指令来执行程序。以hello程序为例,展示了程序从磁盘到内存的直接内存访问过程。
摘要由CSDN通过智能技术生成

Origins of the C programming language

  • C was closly tied with the Unix operating system.
  • C is a small,simple language.
  • C was designed for a practical purpose.

Programs Are Translated by Other Programs into  Different Forms

 1.4 Processors Read and Interpret Instructions Stored in Memory

1.4.1 Hardware Organization of a System

Buses

Running throughouts the system is a collection of electrical conduits called buses that carry bytes of information back and forth between the components.

Buses are typically designed to transfer fixed-size chunk of bytes known as words.The number of bytes in a word (the word size) is a fundamental system parameter that varies across systems.Most machines today have word size of either 4 bytes(32 bits) or 8 bytes(64bits).

I/O Devices

Input/output(I/O) devices are the system's connection to the external world.

Each I/O device is connected to the I/O bus by either a controller or an adapter.

Controllers are chip sets in the device itself or on the system’s main printed circuit board (often called the motherboard). An adapter is a card that plugs into a slot on the motherboard

Main Memory

The main memory is a temporary storage device that holds both a program and the data it manipulates while the processor is executing the program.

main memory consists of a collection of dynamic random access memory(DRAM)

Processor

The central processing unit(CPU) is the engine that interprets (or executes) instructions stored in main memory.At its core is a word-size storage device (or register) called the program counter (PC).

  • Load: Copy a byte or a word from main memory into a register, overwriting the previous contents of the register.
  • Store: Copy a byte or a word from a register to a location in main memory, overwriting the previous contents of that location.
  • Operate: Copy the contents of two registers to the ALU, perform an arithmetic operation on the two words, and store the result in a register, overwriting the previous contents of that register.
  • Jump: Extract a word from the instruction itself and copy that word into the program counter (PC), overwriting the previous value of the PC.

1.4.2 Running the hello Program

 Using a technique known as direct memory access (DMA) , the data travel directly from disk to main memory, without passing through the processor.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值