P1 Suryani Pengantar Sistem Mikroprosessor
P1 Suryani Pengantar Sistem Mikroprosessor
Sistem Mikroprosessor
Presented by Ir. Suryani Alifah, M.T., PhD.
Address bus
Sistem Komputer
I/O
Register ALU
Internal
Control
BUS
Sistem (Mikro) Prosesor Unit
Driver,
Pin
CPU/Prosesor
Bagian Perangkat/Sistem Komputer
Address
Address
(PC)
(reg)
Data Instr
Out Register File Instr In
r1
r2
r3
r4 ALU
Data Data (Calculator) Control Control Unit
Inst
In Flags Address
PC
Data
Address
Komponen Mikroprosessor
Addition
Subtraction
Multiplication
Division
Operasi Logika
• Mengevaluasi kondisi
• Membuat perbandingan
• Dapat membandingkan
Angka
Huruf
Karakter spesial
Register
Tujuan khusus
Kecepatan tinggi
Penyimpanan sementara
Berada di dalam mikroprosessor
KB – kilobyte GB – gigabyte
• 1024 bytes • Billion bytes
• Some diskettes • Hard disks
• Cache memory • CDs and DVDs
MB – megabyte TB – terabytes
• Million bytes • Trillion bytes
• RAM • Large hard disks
Memory
Primary storage
Primary memory
Main storage
Internal storage
Main memory
Main Types of Memory
RAM
Random Access Memory
ROM
Read Only Memory
RAM
• Requires current to retain values
• Volatile
• Data and instructions can be read
and modified
• Users typically refer to this type of
memory
Isi RAM
Operating System
Program currently running
Data needed by the program
Intermediate results waiting to be
output
ROM
Non-volatile
Instructions for booting the computer
Data and instructions can be read,
but not modified
Instructions are typically recorded at
factory
Executing Programs
• CU gets an instruction and places it in memory
• CU decodes the instruction
• CU notifies the appropriate part of hardware to take
action
• Control is transferred to the appropriate part of
hardware
• Task is performed
• Control is returned to the CU
Machine Cycle
I-time
CU fetches an instruction from memory and puts it
into a register
CU decodes the instruction and determines the
memory location of the data required
Machine Cycle
E-time
• Execution
• CU moves the data from memory to registers in
the ALU
• ALU is given control and executes the instruction
• Control returns to the CU
• CU stores the result of the operation in
memory or in a register
System Clock
Clock speed
Megahertz (MHz)
Gigahertz (GHz)
Number of instructions per second
Millions of Instructions Per Second (MIPS)
Performance of complex mathematical
operations
One million floating-point operations per
second (Megaflop )
Cache
FORTRAN 90 C program
program
FORTRAN 90 C program
program compiled compiled
to ISA program to ISA program
Software
ISA level
Hardware
ISA program executed
by hardware
Hardware
44
Instruction Set Architecture (ISA)
46
Instruksi
• Merupakan bagian utama dari ISA
• menentukan operasi dasar yang tersedia untuk programmer
• Example:
• Arithmetic instructions
• Instruction set merupakan machine oriented
• Berbeda machine, berbeda instruction set
• Contoh
• 68K memiliki set instruksi yang lebih komprehensif daripada ARM
Instruksi
• Instruction set is machine oriented
• Same operation, could be written differently in different machine
• AVR
• Addition: add r2, r1 ;r2 r2+r1
• Branching: breq 6 ;branch if equal condition is true
• Load: ldi r30, $F0 ;r30 Mem[F0]
• 68K:
• Addition: add d1,d2 ;d2 d2+d1
• Branching: breq 6 ;branch if equal condition is true
• Load: mov #1234, D3 ;d3 1234
48
Instruksi
• Instruksi dapat ditulis dalam dua
• Machine language
• made of binary digits
• Used by machines
• Assembly language
• a textual representation of machine language
• Easier to understand than machine language
• Used by human beings
Week3 49
Machine code vs. assembly code
50
Converting Instructions To Binary Codes
Nine 9 1001 9
Ten 10 1010 A
Eleven 11 1011 B
Twelve 12 1100 C
Thirteen 13 1101 D
Fourteen 14 1110 E