180 likes | 187 Views
Ch. 2 Data Manipulation. The central processing unit. The stored-program concept. Program execution. Other architectures. Arithmetic/logic instructions. Computer-peripheral communication. CPU. Control unit. Regs. ALU. Bus. Main memory. The Central Processing Unit.
E N D
Ch. 2 Data Manipulation • The central processing unit. • The stored-program concept. • Program execution. • Other architectures. • Arithmetic/logic instructions. • Computer-peripheral communication.
CPU Control unit Regs. ALU Bus Main memory The Central Processing Unit
The Central Processing Unit • General-purpose registers - temporary holding places for data being manipulated by the CPU. • Cache memory (in memory hierarchy). • Bus - CPU/memory interface. • Machine instructions - data transfer, arithmetic/logic, and control. • Figure 2.2, Appendix C, Figure 2.3
The Stored-Program Concept • In early computing, the program is built into the control unit as a part of the machine. The user rewires the control unit to adapt different programs. • Instructions as bit patterns - a program and data can be coded and stored in main memory. A computer’s program can be changed merely by changing the contents of the computer’s memory instead of rewiring the control unit.
The Stored-Program Concept • The main concept of the stored-program is that both program and data are stored in main memory instead of data were stored in memory and programs were part of the control unit. • Machine instructions consists of two fields: op-code and operand. • Appendix C • B0-- • A program example on page 88
Regs. ALU Main memory The Stored-Program Concept CPU Control unit Instr. Reg. Program counter Bus Op-code Address 00 operand FF
Program Execution • The machine cycle: • Fetch: retrieve the next instruction from memory and then increment the program counter. • Decode: decode the bit pattern in the instruction register. • Execute: perform action requested by the instruction in the instruction register.
Program Execution • Figure 2.7. • What happens to placing an address of data in the program counter? • Providing programs and data with a common appearance allows a program to fix another program (or even to modify itself).
Arithmetic/Logic Instructions • Logic operations - AND, OR, XOR,…. • Masking and bit map. • AND (11011111), OR (00100000), XOR (11111111) • Rotation and shift operations. • logic shift: fill the hole with a 0 • arithmetic shift (leave the sign bit unchanged) • Arithmetic operations - add, subtract,…
Computer-Peripheral Communication • Controllers handle communication between machine’s CPU and peripheral devices. • The controllers are often a stand-alone small computer, each with its own memory and CPU that performs a program to convert messages and data back and forth between machine and a peripheral device.
Peripheral device Peripheral device Controller Controller CPU Bus Main memory Computer-Peripheral Communication
Computer-Peripheral Communication • Direct memory access (DMA) - the ability of controllers which can access memory directly. • Buffering - a buffer is any location where one system leaves data to be picked up later by another. • Make good use of the computing resources of the CPU.
Computer-Peripheral Communication • von Neumann bottleneck - bit patterns move between CPU and memory, CPU and controllers, and controllers and memory. • Port - a location in memory through which information enters and leaves the machine. • Handshaking - the two-way communication that takes place between devices.
Peripheral device Controller CPU Main memory Computer-Peripheral Communication Memory-mapped I/O Bus
Computer-Peripheral Communication • Parallel communications. • Internal bus: rates measured in Mbps • Serial communication. • Telephone line: Kbps • Optic fiber: near Gbps
Other Architectures • The design of a machine’s language - complex instruction set Vs. reduced instruction set. • CISC. • Intel Pentium series • microprogram • RISC. • PowerPC series by Apple, IBM and Motorola • simplify CPU design while induce longer programs
Other Architectures • Pipelining - the throughput concept. • Multiprocessor machines - parallel processing. • SISD, SIMD, MIMD. • Load balancing and scaling in multiprocessor machines. • Artificial neural network.
Part II: Software • In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication of algorithms. • Operating systems and networks. • Algorithms. • Programming languages. • Software engineering.