Anda di halaman 1dari 53

Konsep Dasar

Sistem Mikroprosessor
Presented by Ir. Suryani Alifah, M.T., PhD.

Program Studi Teknik Elektro


Fakultas Teknologi Industri
Universitas Islam Sultan Agung
Genap 2022/2023
Sistem Komputer
• Sistem Komputer
Sistem komputer merupakan kumpulan dari elemen-elemen computer (hardware,
software, brainware) yang saling berhubungan (terintegrasi) dan saling berinteraksi
untuk melakukan pengolahan data dengan tujuan menghasilkan informasi sesuai
dengan yang diharapkan
• Sistem (Micro) Processor/ Mikrokomputer
Sebuah sistem yang dibangun dari komponen utama yaitu mikroprosesor atau CPU,
dan komponen tambahan yaitu Memory Unit, Input Output Unit (I/O), yang berfungsi
sebagai pengolah data
• Sistem Minimum
• Mengacu pada sistem, dimana dengan beberapa komponen/bagian dasar
pembentuk sistem (biasanya berupa sistem Mikroprosesor), sistem tersebut sudah
dapat melakukan tugas/kegunaan tertentu
Arsitektur Dasar Sistem Komputer

Address bus

ROM RAM I/O I/O


CPU interface devices

Data bus Control


bus
Arsitektur Dasar Sistem Komputer

Bagian pusat pemroses


Bagian pusat pengendali
Kotak
Storage
CPU
Inter
koneksi
Prosesor
Memory
I/O (CPU)
BUS

Sistem Komputer
I/O
Register ALU
Internal
Control
BUS
Sistem (Mikro) Prosesor Unit
Driver,
Pin

CPU/Prosesor
Bagian Perangkat/Sistem Komputer

• Kotak komputer (kotak CPU), Sistem (Mikro) Prosesor


• Kotak/Rangkaian pemroses
• Media penyimpan
• USB disk, HD Eksternal
• I/O
• Monitor, Printer
• Inter-koneksi
• Kabel USB, kabel Printer, kabel Monitor
Komponen Utama Sistem Komputer

• CPU (Central Processing Unit)


• Mengacu pada suatu bagian dalam suatu sistem yang digunakan sebagai pusat
pengolah. Biasanya dapat terdiri dari prosesor saja atau/sampai sub-sistem yang
cukup kompleks
• Prosesor
• Mengacu pada nama suatu piranti/komponen yang digunakan untuk pemrosesan
• Prosesor → Komponen utama untuk pemroses data
• Mikroprosesor → Prosesor dengan kapasitas/ukuran yang lebih kecil
• ALU (Arithmetic Logic Unit)
• Bagian dalam dari suatu Prosesor, dimana dasar-dasar operasi aritmatika dan logika
dilakukan
CPU
Mikroprosessor
• Mikroprosessor adalah rangkaian transistor
dan komponen listrik lainnya pada sebuah
chip yang dapat memproses program,
mengingat informasi, atau melakukan
perhitungan.
• Mikroprosesor adalah CPU pada satu chip.
• Mikrokontroller: mikroprosesor, sirkuit
pendukung terkait, memori, dan komponen
I/O periferal diimplementasikan pada satu
chip
• Membutuhkan input terprogram
Jenis2 Mikroprosessor
• Mikroprosesor dapat dicirikan berdasarkan pada
• Word size
• 8 bit, 16 bit, 32 bit, etc. processors
• Instruction set structure
• RISC (Reduced Instruction Set Computer),
• CISC (Complex Instruction Set Computer)
• Fungsi
• General purpose, special purpose such image processing, floating
point calculations
• dll
Mikroprosessor Khusus
• Yang paling banyak digunakan
• 68K
• Motorola
• x86
• Intel
• IA-64
• Intel
• MIPS
• Microprocessor without interlocked pipeline stages
• ARM
• Advanced RISC Machine
• PowerPC
• Apple-IBM-Motorola alliance
• Atmel AVR
Struktur Eksternal Mikroprosessor

• Prosesor adalah unit komputasi yang perlu berinteraksi


dengan memori untuk mendapatkan instruksi serta data

Address
Address
(PC)
(reg)

Instruction Mikroprocessor Data


Memory Data Memory
(loads)
Instruction
Data
(stores)
Struktur Internal Mikroprosessor
• Control Unit
• Fetches instructions from memory, Interprets them, Controls ALU
• ALU
• Does all computations
• Register File
• Stores variables

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

Mengubah data menjadi informasi


Merupakan pusat kendali
Set sirkuit elektronik yang menjalankan instruksi program
yang tersimpan
Komponen mikroprosessor:
• Control Unit – CU
• Arithmetic / Logic Unit – ALU
• Registers
• System clock
CONTROL UNIT
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

• Mengarahkan sistem komputer untuk menjalankan instruksi


program yang tersimpan
• Berkomunikasi dengan bagian lain dari perangkat keras
Arithmetic / Logic Unit/ALU
Data Instr
Out Register File Instr In
r1
r2
r3
r4 ALU
Data Data (Calculator) Control Control Unit
Inst
In Flags Address
PC

• Menjalankan operasi aritmatika


• Menjalankan operasi logika
Operasi Aritmatika

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

Instruction register Data register

Menyimpan instruksi yang Menyimpan data yang menunggu


sedang dieksekusi untuk diproses

Menyimpan hasil dari pemrosesan


Register vs Memori vs Secondary

Register Memori Secondary Storage


Data Data yang terkait Data yang akan Data yang akan
langsung dengan digunakan dalam digunakan dalam
operasi yang sedang waktu dekat jangka lama
diproses pada ALU
Sifat Sementara sampai Sementara selama Jangka panjang
instruksi berikutnya program berjalan

Kecepatan Kecepatan paling tinggi Kecepatan Kecepatan paling


menengah rendah
Measuring Storage Capacity

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

System clock produces pulses at a fixed rate


Each pulse is one Machine Cycle
One program instruction may actually be several
instructions to the CPU
Each CPU instruction will take one pulse
CPU has an instruction set – instructions that it can
understand and process
Finding Data in Memory
• Each location in memory has a unique address
• Address never changes
• Contents may change
• Memory location can hold one instruction or piece of
data
• Programmers use symbolic names
Data Representation
On/Off
Binary number system is
used to represent the state
of the circuit
Bits, Bytes, Words
• BIT
• Binary DigIT
• On/off circuit
• 1 or 0
• BYTE
• 8 bits
• Store one alphanumeric character
• WORD
• Size of the register
• Number of BITS that the CPU processes as a unit
Coding Schemes
• ASCII
• Uses one 8 bit byte
• 28 = 256 possible combinations or characters
• Virtually all PCs and many larger computers
• EBCDIC
• Uses one 8 bit byte
• 28 =256 possible combinations or characters
• Used primarily on IBM-compatible mainframes
• Unicode
• Uses two 8 bit bytes (16 bits)
• 216 = 65,536 possible combinations or characters
• Supports characters for all the world’s languages
• Downward-compatible with ASCII
Bus Line

• Paths that transport electrical signals


• System bus
• Transports data between the CPU and memory
• Bus width
• Number of bits of data that can be carried at a time
• Normally the same as the CPUs word size
• Speed measured in MHz
Bus Line
More powerful
Larger bus width = computer
CPU can transfer more
data at a time = Faster computer

CPU can reference


More memory
larger memory = available
addresses
Expansion Buses

• Connect the motherboard to expansion slots


• Plug expansion boards into slots
• interface cards
• adapter cards
• Provides for external connectors / ports
• Serial
• Parallel
ISA Slow-speed devices like mouse, modem

PCI High-speed devices like hard disks and network cards

AGP Connects memory and graphics card for faster video


performance
USB Supports “daisy-chaining” eliminating the need for
multiple expansion cards; hot-swappable
IEEE 1394 High-speed bus connecting video equipment to the
(FireWire) computer
PC Card Credit card sized PC card devices normally found on
laptops
Speed and Power

What makes a computer fast?


Microprocessor speed
Bus line size
Availability of cache
Flash memory
RISC computers
Parallel processing
Computer Processing Speed

Time to execute an instruction


Millisecond
Microsecond
Nanosecond
Modern computers
Picosecond
In the future
Microprocessor Speed

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

• Small block of very fast temporary memory


• Speed up data transfer
• Instructions and data used most frequently or
most recently
Step 3
P Transfer to main CPU and cache
R
O
R
C
E Cache A
S
M
S
O Step 2
Go to address in main
R
memory and read
Step 1
Processor Next processor request
requests • Look first at cache
data or • Go to memory
instructions
Types of Cache
Internal cache
Level 1 (L1)
Built into microprocessor
Up to 128KB
External cache
Level 2 (L2)
Separate chips
256KB or 512 KB
SRAM technology
Cheaper and slower than L1
Faster and more expensive than
memory
Aplikasi Microprocessor
• Sebuah sistem aplikasi mikroprosesor dapat diabstraksikan dalam
arsitektur tiga tingkat
• ISA merupakan antarmuka hardware dan software

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)

• Menyediakan spesifikasi fungsional untuk pemrogram


perangkat lunak untuk menggunakan/memprogram perangkat
keras untuk melakukan tugas tertentu
• Menyediakan persyaratan fungsional untuk perancang
perangkat keras sehingga rancangan perangkat keras mereka
(disebut arsitektur mikro) dapat menjalankan program
perangkat lunak.
• ISA menentukan semua aspek arsitektur komputer yang terlihat
oleh seorang programmer
• Basic
• Instructions
• Instruction format
• Addressing modes
• Native data types
• Registers
• Memory models
• advanced
• Interrupt handling

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

• Ada pemetaan satu-ke-satu antara machine code dan assembly


code
• Contoh (Atmel AVR instruction):
For increment register 16:
• 1001010100000011 (machine code)
• inc r16 (assembly language)
• Assembly language also includes directives
• Instructions to the assembler
• Example:
• .def temp = r16
• .include “mega64def.inc”

50
Converting Instructions To Binary Codes

• Each instruction is encoded into a binary format and


stored in the instruction memory.
• The control unit decodes it and gives appropriate signals
to ALU
Assuming that the register file
has 32 registers, each
register has a 5 bit code,
add r1, r2, r3 from r1 to r31,
r1 = 00001, r31 = 11111
000111 00001 00010 00011 Thus total length of
instruction = 6 + 5*3 = 21 bits
6 bit opcode for
the add operation This is an example of fixed
is 000111
length encoding scheme.
Number Systems
Decimal Binary (B) Hexadecimal
(D) (H or X)
Zero 0 0 0

Nine 9 1001 9

Ten 10 1010 A

Eleven 11 1011 B

Twelve 12 1100 C

Thirteen 13 1101 D

Fourteen 14 1110 E

Fifteen (Largest 4 bit no.) 15 1111 F

Forty Two 42 0010 1010 2A

Largest 8 bit no. 255 1111 1111 FF

Largest 16 bit no. 65535 1111 1111 1111 1111 FF FF


End Session

Anda mungkin juga menyukai