3 arsitektur mikroprocessor - general

39
By : Ranjiv Maulana Email : [email protected] KULIAH Microprocessor Arsitektur Miroprocessor

Upload: amg-gebiyosta

Post on 20-Jan-2016

34 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

KULIAH Microprocessor Arsitektur Miroprocessor

Page 2: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

ARSITEKTUR MIKROKOMPUTER Suatu sistem Mikrokomputer terdiri atas tiga bagian utama:

1. CPU (Central Processing Unit) Uni t ini melaksanakan komputasi aktual atau “number processing/olah angka” didalam komputer manapun. CPU terbagi 3 yaitu: CU (Control Unit), Unit pengendali yang mengatur urutan operasi

seluruh sistem/alir informasi. ALU (Arithmetic Logic Unit), Unit ini berfungsi melaksanakan

operasi aritmatik serta operasi-operasi logika. Registers, Kawasan penyimpanan kecepatan tinggi di dalam CPU

yang menyimpan data dan sejumlah instruksi yg sangat kecil untuk menyingkat periode waktu.

2

Page 3: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

ARSITEKTUR MIKROKOMPUTER

2. Memory Unit Unit-unit ini mengandung program-program yang melaksanakan perintah dan data yang sedang diolah.

3. I/O (Unit Masukan dan Pengeluaran) Unit-unit ini mengandung program-program yang bersangkutan dan data yang sedang diolah.

3

Page 4: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

ARSITEKTUR MIKROKOMPUTER (2)

4

Page 5: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

CPU Lanjutan….

• Machine instruction cycle: Siklus pemrosesan komputer, yang kecepatannya terukur dalam kaitan dengan banyaknya instruksi suatu chip untuk memproses per detik-nya.

• Clock speed: Kecepatan yg ditetapkan lebih dulu sebagai jam komputer yg menandai semua aktivitas chip, yang diukur dalam MHz dan GHz.

• Word length: Bilangan bit (0-an dan 1-an) yang dapat diproses oleh CPU pada waktu kapanpun.

• Bus width: Ukuran dari alur fisik yang mana data dan instruksi-instruksi melintasinya dalam bentuk impuls/getaran elektrik pada chip komputer

• Line width: Jarak antar transistor-transistor. Semakin kecil lebar jarak, semakin cepat chip.

5

Page 6: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

Sistem Bus • Bus adalah jalur komunikasi umum yang digunakan untuk membawa

informasi antar semua komponen dalam unit mikrokomputer. • The term BUS refers to a group of wires or conduction tracks on a

printed circuit board (PCB) though which binary information is transferred from one part of the microcomputer to another

• Ada 3 tipe bus yaitu: – Data Bus (bus-D), bus dengan delapan penghantar, data dapat

dihantarkan dalam arah bolak-balik (lebar data 8 bit) yaitu dari mikroprosesor ke unit memori atau modul I/O dan sebaliknya.

– Control Bus (bus-C), meneruskan sinyal-sinyal yang mengatur masa aktif modul mikrokomputer sesuai dengan kondisi kerja yang diinginkan.

– Address Bus (bus-A), meneruskan data alamat (misal alamat 16 bit), dari penyimpan atau dari saluran masukan/keluaran yang diaktifkan pada saat tertentu.

6

Page 7: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

I/O System • I/O adalah jembatan penghubung antara MPU

(Microprocessor Unit) dengan dunia luar. • An input port is a circuit through which an external

device can send signals (data?) to the MPU. • An output port is a circuit that allows the MPU to send

signals (data?) to external devices. • I/O ports connect both digital and analogue devices by

DAC and ADC

7

There are three main bus groups – ADDRESS BUS – DATA BUS – CONTROL BUS

Page 8: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

Data Bus Data Bus (bus-D) adalah bus dengan delapan penghantar, dimana data dhantarkan dalam arah bolak-balik (lebar data 8 bit), yaitu dari mikro-prosesor ke unit memori atau modul I/O dan sebaliknya.

• The Data Bus carries the data which is transferred throughout the system.

( bi-directional)

• Examples of data transfers – Program instructions being read from memory into MPU. – Data being sent from MPU to I/O port – Data being read from I/O port going to MPU – Results from MPU sent to Memory • These are called read and write operations

8

Page 9: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

Adress Bus Address Bus (bus-A) adalah bus yang meneruskan data alamat (misalnya. alamat 16 bit), dari penyimpan atau dari saluran masukan/keluaran yang diaktifkan pada saat tertentu.

• An address is a binary number that identifies a specific memory storage

location or I/O port involved in a data transfer • The Address Bus is used to transmit the address of the location to the

memory or the I/O port. • The Address Bus is unidirectional ( one way ): addresses are always

issued by the MPU.

9

Page 10: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

Control Bus Control Bus (bus-C) adalah Bus yang meneruskan sinyal-sinyal yang mengatur masa aktif modul mikrokomputer sesuai dengan yang kondisi kerja yang diinginkan. • The Control Bus: is another group of signals whose functions are to

provide synchronization (timing control) between the MPU and the other system components.

• Control signals are bi-directional, and are mainly outputs from the MPU.

• Example Control signals – RD: read signal asserted to read data into MPU – WR: write signal asserted to write data from MPU

10

Page 11: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

Buses • The microprocessor controls memory and I/O through

a series of connections called buses. • A bus is a common group of wires that interconnect

components in a computer system • Buses select an I/O or memory device transfer data between an I/O device or memory

and the microprocessor control the I/O and memory system

11

Page 12: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected] 12

Page 13: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected] 13

Page 14: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

Buses • The memory sizes and organizations differ between various member of

the Intel µp family • The control bus contains lines that select the memory or I/O and cause

them to perform a read or write operation. • Ada 4 jenis Control Bus Connections : MRDC: Memory Read Command. MWTC: Memory Write Command. IORC: I/O Read Command. IOWC: I/O Write Command.

• The micro-instructions for READ: – the µp reads the contain of memory location by sending the

memory an address through address bus – the µp sends the memory read control signal (MRDC) to cause

memory to read data – the data read from the memory are passed to the microprocessor

through the data bus 14

Page 15: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected] 15

Page 16: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

Main Memory • Fungsi wajib memory adalah : – Untuk menyimpan Program-program – Untuk menyediakan data ke MPU sesuai permintaan – Untuk menerima hasil dari MPU ke penyimpanan • Main memory Types – ROM : read only memory. Contains program (Firmware). Jenis memory ini tidak mengalami “lost of its contents” ketika tidak ada power (Non-volatile) – RAM: random access memory (read/write memory) digunakan sebagai variable data. RAM akan mengalami “lost of its contents” ketika tidak ada power (volatile). Ketika power di-on kan kembali , RAM akan berisi nilai-nilai data yang random.

16

Page 17: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

Read-Only Memory • uP can read instructions from ROM quickly • Cannot write new data to the ROM • ROM remembers the data, even after power cycled • Typically, when the power is turned on, the microprocessor will start

fetching instructions from the still-remembered program in ROM (bootstrap )

• Masked ROM or just ROM • PROM or programmable ROM (once only) • EPROM (erasable via ultraviolet light) • Flash (can be erased and re-written about 10000 times, usually must write

a whole block not just 1 byte or 2 bytes, slow writing, fast reading) • EEPROM (electrically erasable read-only memory, also known as

EEROM—both reading and writing are very slow but can program millions of times…useless for storing a program but good for configure the information.

17

Available ROMs

Page 18: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

Random Access Memory (RAM)

• The uP can read the data from RAM quickly • The uP can write new data quickly to RAM • RAM forgets its data if power is turned off • Two type of is available : – Static RAM(SRAM): ff base, fast, expensive, low capacity/volume, applied for cache, no refresh – Dynamic RAM (DRAM): cap base, slow , low cost high capacity/volume , applied for main memory(pc), need refresh.

18

Page 19: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

19

Microprocessor (Typical) Ciri-ciri: • Bus data : masukan /

keluaran, memiliki sifat tiga keadaan dan dua-arah (Bidirec-tional andTri State)

• Bus alamat : keluaran yang memiliki sifat keluaran tiga keadaan dan satu arah (tristate)

• Bus Kendali : sebagian keluaran dan sebagian masukan

Page 20: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

20

ROM (Typical) Ciri-ciri: •Bus data : masukan / keluaran, memiliki sifat tiga keadaan dan dua-arah (Bidirec-tional and Tri State) •Bus alamat : keluaran yang memiliki sifat keluaran tiga keadaan dan satu arah (tristate) •Bus Kendali : sebagian keluaran dan sebagian masukan

Page 21: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

21

RAM (Typical) Ciri-ciri: • Bus data : masukan dan keluaran, memiliki sifat tiga keadaan dan

dua-arah (bidirectional and tri state) • Bus alamat : keluaran, memiliki sifat tiga keadaan dan satu arah (Tri

State) • Bus Kendali : sebagian keluaran dan sebagian masukan

Page 22: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

PIRANTI I/O (TYPICAL)

22

Piranti I/O dapat berupa saluran paralel, maupun saluran serial.

Piranti I/O paralel dapat disusun dengan chip yang tetap (tidak programable) dan dapat pula disusun dengan chip khusus yang bersifat dapat diprogram (programable I/O).

Ciri-ciri Data Bus : masukan, memiliki sifat tiga keadaan satu arah Address Bus : masukan Control Bus : sebagai kendali untuk membaca data (READ)

a. Piranti Input Tidak "programable"

Page 23: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

PIRANTI I/O (TYPICAL)

23

b. Piranti Output Tidak "programable"

Ciri-ciri Bus data : Keluaran, memiliki sifat tiga dan keadaan satu arah Bus alamat : masukan Bus Kendali : sebagai kendali untuk menulis data ke PORT (WRITE). PORT memiliki sifat LATCH, maka keadaan data pada PORT akan tetap dipertahankan sampai ada perintah WRITE berikutnya diberikan.

Page 24: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

24

Programmable I/O

Page 25: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

25

Ciri-ciri • Bus alamat : masukan • Bus data : Keluaran dan masukkan , memiliki sifat tiga keadaan satu/dua arah • Bus Kendali : sebagai kendali untuk menulis data ke PORT

(WRITE) dan kendali untuk membaca data dari PORT (READ) • PORT keluaran memiliki sifat LATCH, maka keadaan data pada

PORT akan tetap dipertahankan sampai ada perintah WRITE berikutnya diberikan

• Programable I/O memiliki beberapa register didalamnya, yang berfungsi untuk transfer data maupun untuk mengendalikan (memprogram) sifat PORT, yaitu sebagai port masukan atau sebagai port keluaran. Sebelum digunakan piranti I/O ini harus diinisialisasi terlebih dahulu.

Page 26: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

26

• Fungsi decoder adalah untuk memilih salah satu dari chip yang akan diakses oleh mikroprosesor. (pada suatu saat uP hanya dapat mengakses satu chip saja)

• Chip memori/piranti I/O diaktif-kan(enable) melalui saluran pemilih chip CS (chip select). Masukan decoder berupa sandi biner dari sebagian bus alamat CPU.

Decoder

Page 27: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

27

Dekoder (typical) untuk dekoder memori maupun dekoder I/O

• Untuk N-bit masukan, maka jumlah keluaran adalah 2N.

• Keluaran dari decoder dihubungkan dengan CS pada masing-masing chip.

• Jika decoder tersebut digunakan untuk decoder memori maka keluaran decoder dihubungkan dengan CS chip masing-masing memori.

• Jika decoder tersebut digunakan untuk decoder I/O maka keluaran decoder dihubungkan dengan CS chip masing-masing piranti I/O.

Page 28: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

28

Daftar kapasitas memori berdasarkan lebar bus alamat

Page 29: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

29

Untuk lebar bus data 8-bit (1 byte), maka ruang alamat memori

• 1.024 = 1 kb (kilo byte) • 2.048 = 2 kb • 4.096 = 4 kb • 8.192 = 8 kb • 16.384 = 16 kb • 32.768 = 32 kb • 65.536 = 64 kb • .... • 1.048.476 = 1.024 kB = 1 Mb • 2.096.952 = 2.048 kB = 2 Mb • 4.193.904 = 4.096 kB = 4 Mb • 8.387.808 = 8.192 kB = 8 Mb

Page 30: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

PERANCANGAN SISTEM BUS DATA Hubungan bus data antara mikroprosesor dengan

memori atau I/O adalah sangat sederhana, karena semua saluran bus data dapat langsung dihubungkan.

Apabila jumlah memori dan I/O banyak (melampaui fan out-nya bus data mikroprosesor), maka diperlukan gerbang penyangga (buffer) pada masing-masing bit bus data.

Page 31: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

31

PERANCANGAN BUS ALAMAT

Sulitnya sebuah perancangan suatu sistem mikroprosesor adalah perkawatan bus alamat. Agar perancangan menjadi lebih mudah dan sistematis serta sebagai dokumentasi dalam pengembangannya ataupun pemeliharannya, maka perancangan sebaiknya meliputi:

• Peta Memori, • Peta I/O, • Daftar Memori, • Daftar I/O, • Dekoder Alamat, • dan Dekoder I/O.

Page 32: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

Contoh Perancangan Bus Alamat

Suatu sistem yang terdiri atas: Mikroprosesor (8-bit) memiliki lebar bus alamat memori 16-bit. • 1 buah ROM (dengan kapasitas 2 kbyte) dipasang pada alamat 0000h. • 2 RAM ( RAM 1 dam RAM 2 ) yang dipasang secara contiguous (berdekatan /berskesinambungan) dengan ROM, masing-masing berkapasitas 2 kbyte. • 2 Buah I/O, yaitu port masukan dan port keluaran (lebar bus alamat untuk I/O 8-bit dengan alamat 40h dan

80h),

Page 33: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

33

Peta Memori

Urutan perancanan agat sistem terbentuk secara sistematis dan terdokumentasi adalah sbb: a) Peta Memori, b) Peta I/O c) Daftar Memori d) Daftar I/O e) Realisasi Dekoder Memori f) Realisasi Dekoder I/O

Peta I/O

Page 34: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

34

Daftar Memori

Daftar Piranti I/O

Page 35: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

35

Realisasi Decoder Alamat (dengan gerbang-gerbang dasar)

Saluran bus alamat A15, A14, A13, dan A11 tidak berubah untuk masing-masing komponen dari alamat awal hingga alamat akhir. Ketiga komponen tersebut dapat dipilih dari saluran alamat: ROM = 0000, RAM1 = 00001, dan RAM2 = 0010.

Dekoder memori memiliki masukan A15, A14, A13, A12, A11, dan /CS. Masukan dekoder terdiri dari 5 bit, sehingga dapat memilih chip memori dengan kapasitas masing-masing 2 kbyte sebanyak 25 - 32 chip.

Saluran /CS mendapat masukan dari /MREQ (Memory Request) atau sinyal permintaan akses ke memori yang berasal dari mikroprosesor.

Page 36: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

36

Dekoder Memori

Page 37: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

37

Dekoder I/O Realisasi Decoder I/O (dengan gerbang- gerbang dasar) dapat dilakukan dengan beberapa cara: • Gerbang dasar (AND, NAND, OR, NOR, dll) – IC TTL dekoder standar (misalnya 74138, 74139) – IC TTL comparator (misalnya 74688), yang baik untuk dekoder I/O • PLD (Programable Logic Device) misalnya: – PAL (Programmable Logic Array), – PLA (Programable Array Logic), – PROM atau – IC semi custom lainnya. • ASIC (Application Specific IC) memiliki kepadatan tinggi dan digunakan untuk

dekoder pada prosesor yang memiliki lebar bus alamat besar • IC full custom (membuat chip sendiri) dalam komputer mikro sering disebut

Chipset. dekoder yang direalisasikan dengan menggunakan teknologi semikonduktor dengan kepadatan sangat tinggi (VLSI)

• Dekoder cerdas, suatu unit dekoder yang dilengkapi dengan suatu prosesor khusus. Dekoder ini banyak diterapkan dalam sistem mikrokomputer untuk mendukung konsep teknologi PnP (Plug and Play). Penambahan memori atau piranti I/O pun dapat dengan mudah dilakukan.

Page 38: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

MEMORY MAP I/O vs ISOLATED MEMORY MAP I/O

38

• Memory Map I/O : Piranti I/O dianggap sebagai chip memori, sehingga untuk pemilih chip digunakan memory decoder.

• Isolated Memory Map I/O: Pengalamatan piranti I/O terpisah dengani chip memory, sehingga untuk pemilih chip piranti digunakan I/O decoder

• Untuk pengaksesan port pada Memory/Isolated Map I/O digunakan instruksi IN dan OUT.

PERANCANGAN SISTEM BUS KENDALI (READ/WRITE) • Bus kendali read/write pada minimum sistem (sederhana) : - Untuk sistem yang sederhana dapat dihubungkan langsung, dari CPU ke

memory atau ke piranti I/O. - Untuk sistem yang membutuhkan buffer bus data, maka sinyal

read/write ini diperlukan untuk meng-enable dan menentukan aliran data bagi "buffer dua arah tiga keadaan“.

Page 39: 3 Arsitektur Mikroprocessor - General

By : Ranjiv Maulana Email : [email protected]

Referensi Microprocessor Weber, Harmut (2009). Mikrocomputertechnik – Slide Presentation.

Friedberg (Technische Hochschule Mittelhessen). Willa, Lukas. (207). Teknik Digital, Mikroprosesor dan Mikrokomputer.

Bandung: Informatika. Douglas V. Hall. (1991). Microprocessor and Interfacing: Programming

and Hardware. Singapore: MCGraw-Hill. Putra. A.E. (……). Belajar Mikrokontroller AT89C51/52/55.Yogyakarta:

Gava Media. Slide Presentation – Mikroprocessor. Universitas Brawijaya. Malang Atmel Datasheet – ATMega 16. Setyawan. G.E. (…..). Mikrokontroller – Uni Narotama. Surabaya 16-bit Micro-processors Architecture,Software and Interface Techniques Walter A.Triebel, Avtar Singh http://www.intel.com/; • http://www.engr.sjsu.edu/ Hall D.V., Microprocessor Interfacing : Programming and Hardware, McGraw-Hill, Singapore, 1986.