You are on page 1of 22

Arsitektur dan Organisasi

Komputer
http://www.unhas.ac.id/amil/S1TIF/arsikom2017/

Amil A. Ilham
http://www.unhas.ac.id/amil
Computer Organization

2
CPU and Main Memory
Chip that executes
program commands
Central
Processing Intel Pentium 4
Unit Sun ultraSPARC III

Primary storage area


for programs and data
that are in active use
Main
Memory
Synonymous with
RAM

3
Secondary Memory Devices
Secondary memory
devices provide Central Hard disks
long-term storage Processing Floppy disks
Unit Writable CDs/ DVDs
Tapes

Hard Disk
Main
Memory
Floppy Disk
Information is moved
between main memory
and secondary memory
as needed 4
The Central Processing Unit
A CPU is on a chip called a microprocessor
It continuously follows the fetch-decode-execute cycle:

Retrieve an instruction from main memory

fetch

execute decode

Carry out the Determine what the


instruction instruction is

5
Review SAP-1
SAP (Simple-As Possible) 1
Komputer dengan arsitektur yang sangat
sederhana

6
Arsitektur
SAP-1

7
Pencacah Program
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111

8
RAM 16x8
Alamat Isi_memori
0000 ???????? (8 bit)
0001 ????????
0010 ????????
0011 ????????
0100 ????????
0101 ????????
0110 ????????
0111 ????????
1000 ????????
1001 ????????
1010 ????????
1011 ????????
1100 ????????
1101 ????????
1110 ????????
1111 ????????
9
RAM 16x8
Alamat Isi_memori
0H ?
1H ?
2H ?
3H ?
4H ?
5H ?
6H ?
7H ?
8H ?
9H ?
AH ?
BH ?
CH ?
DH ?
EH ?
FH ?
10
Instruksi SAP-1
Mnemonik Kode Biner Keterangan
LDA 0000 Load the accumulator (Isikan data
RAM ke dalam akumulator)
ADD 0001 Tambahkan data RAM pada
akumulator
SUB 0010 Kurangkan data RAM dari
akumulator
OUT 1110 Isikan data akumulator ke dalam
register keluaran
HLT 1111 Hentikan pemrosesan

11
Pemprograman SAP-1
Bagaimana cara memprogram SAP-1 untuk
menyelesaikan persoalan aritmetik ini ?
16 + 20 + 24 32
Desimal Biner (8 bit) Hexa
16
20
24
32
12
Pemprograman SAP-1
Bagaimana cara memprogram SAP-1 untuk
menyelesaikan persoalan aritmetik ini ?
16 + 20 + 24 32
Desimal Biner (8 bit) Hexa
16 0001 0000 10H
20 0001 0100 14H
24 0001 1000 18H
32 0010 0000 20H
13
Pemprograman SAP-1
(Bahasa Assembly)
16 + 20 + 24 32 Alamat Isi_memori
Desimal Biner Hexa 0H LDA 9H
(8 bit) 1H ADD AH
16 0001 0000 10H
2H ADD BH
3H SUB CH
20 0001 0100 14H 4H OUT
24 0001 1000 18H 5H HLT
32 0010 0000 20H 6H
7H
8H
Mnemonik Kode Biner 9H 10H
LDA 0000 AH 14H
BH 18H
ADD 0001
CH 20H
SUB 0010 DH
OUT 1110 EH
HLT 1111 FH 14
Pemprograman SAP-1
(Bahasa Mesin)
16 + 20 + 24 32 Alamat Isi_memori
Desimal Biner Hexa 0000 0000 1001
(8 bit) 0001 0001 1010
16 0001 0000 10H
0010 0001 1011
0011 0010 1100
20 0001 0100 14H 0100 1110 XXXX
24 0001 1000 18H 0101 1111 XXXX
32 0010 0000 20H 0110
0111
1000
Mnemonik Kode Biner 1001 0001 0000
LDA 0000 1010 0001 0100
1011 0001 1000
ADD 0001
1100 0010 0000
SUB 0010 1101
OUT 1110 1110
HLT 1111 1111 15
T2
Siklus
Pengambilan
T1
(Fetch Cycle)
T1,T2,T3
Berlaku untuk
setiap instruksi
T3

16
Siklus
Eksekusi T5
T4,T5,T6

Instruksi LDA

T4

T4
T6 = NOP
(No Operation)

17
Siklus
Eksekusi T6
T4,T5,T6
T5

T4
Instruksi ADD
T4

18
Kinerja SAP-1
Satu siklus mesin pada SAP-1 memiliki 6 keadaan
yaitu T1 T6 (6 clock).
Setiap instruksi membutuhkan satu siklus mesin.

19
CPU Execution Time
CPU execution time or CPU time is the actual
time the CPU spends computing for a specific
task.
CPU time =
Instruction count x CPI x Clock cycle time
(CPI : Cycles per instruction)
Misalkan processor SAP-1 memiliki frekuensi clock 1
KHz. Hitunglah CPU time untuk memproses program
aritmetika: 16 + 20 + 24 32

20
Full Adder
Add two bits and carry-in, produce one-bit sum and
carry-out.

21
Four-bit Adder

22

You might also like