Professional Documents
Culture Documents
Computing Fundamental
Computing Fundamental
Registers
Cache Memory
Bus CPU
Main Memory
bus
I/O devices
Controllers
main
memory
I/O devices
2/34
Register
input bits
I/O Main
Device Memory
bus
System
CPU Controller
4/34
Stored Program Concept
CPU
bus
program data
memory memory
5/34
What Do Instructions Look Like
Note: There are computers that can follow instructions given in simple human languages,
but it may not be worth doing it this way
6/34
Machine Language
7/34
Parts of a Machine Instruction
Op-code field
Specifies which machine operation to execute
One per instruction
Operand field (a.k.a. addressing mode field)
Data and addresses related to this operation
Number of operands varies depending on op-code
Example: the instruction that asks CPU to add data2
and data6 and store the result in data7 can be coded
in a 16-bit number as follows:
4 bits op-code 4 bits 4 bits 4 bits
8/34
Instruction Lengths
9/34
Machine Language and Architecture
Machine language reflects the architecture of the
CPU, there are two major types of design philosophy:
RISC and CISC
Reduced Instruction Set Computer (RISC)
CPU only executes a small set of simple instructions
However, CPU executes these simple instructions really fast
Usually use fixed-length coding of instructions
Complex Instruction Set Computer (CISC)
CPU executes many complex and powerful instructions
Complex instructions takes longer to execute, but an
algorithm implemented in CISC machine language requires
less instructions than that of RISC’s
Usually use variable-length coding of instructions
10/34
Machine Instruction Types
11/34
Example: A Simple CPU
12/34
Example: An Instruction
Op-code Operand
14/34
Program Execution
15/34
Program Flow Control
16/34
Running a Program in Main Memory
18/34
Fetch Step (2/2)
19/34
Decode and Execution
20/34
Internal Structure of a Realistic CPU
memory cell
address
Program Counter Incrementer
Register 0
Register 1 Instruction
Decode Instruction
Register 2
and Register
⋅⋅⋅ Control
Register F
512F
Register bank
ALU
Data Out Register Data In Register
Main
memory
data to a cell data from a cell 21/34
Concept of “Data Path”
Circuit b
output
22/34
Execution of an Instruction
Program Counter +2
Register 0
Register 1 Instruction
Computation of Register 2
Decode
R1 = R2 + RF and
⋅⋅⋅ Control
Register F
512F
+
datapath
Data Out Register Data In Register
Memory 23/34
Arithmetic/Logic Operations
24/34
I/O Subsystem of a Computer
27/34
Communicating with Devices (1/2)
28/34
Communicating with Devices (2/2)
Direct memory access (DMA)
A controller can access main memory directly when CPU is
not using the bus; this capability is called DMA
Sometimes, we design a special circuit just to move data
around inside the system, we also call this circuit a DMA
Von Neumann Bottleneck
If the CPU fetches both the instructions and data through a
single bus connected to a memory device, the performance
of the CPU would be limited by the performance of the BUS
and the memory device
Handshaking
The process of controlling the transfer of data between
components connected via a bus
29/34
Memory Mapped I/O Example
I/O address
(an empty memory cell
that does not really exist
in main memory device)
30/34
Data Communication Terminologies
Modem (modulation-demodulation):
In communication systems, modulation is a process that
“pack” data (analog or digital) to a carrier signal (like packing
goods in a truck) for transmission of data in the real world
In computer terminology, “modem” is a device that perform
this operation when the carrier is a telephone line
Serial communication: transfers one bit at a time
Parallel communication: transfers multiple bits
simultaneously
Multiplexing: interleaving of data so that different data
can be transmitted over a single communication path
31/34
Improving CPU Architecture
time
t0 t1 t2 t3 t4
32/34
Multiprocessor Systems
33/34
Multi-CPU, Multi-Core, Multi-ALU
Multi-CPU Architecture: Multi-ALU Architecture:
CPU 1 CPU 2
Instruction Fetch,
Core Core Decode, and Control
Multi-Core Architecture:
bus
main
CPU memory
Core 1 Core 2