0% found this document useful (0 votes)
9 views

AK07 Operasi Unit Kontrol

The document discusses the operation of control units in CPUs. It describes how control units can be implemented using either hardwired logic or microprogramming. Microprogramming allows the control signals for each microoperation to be stored in a control memory and accessed sequentially to execute instructions. The document covers various approaches to microprogramming including vertical vs horizontal formats and nanoprogramming.

Uploaded by

FATIMAH
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

AK07 Operasi Unit Kontrol

The document discusses the operation of control units in CPUs. It describes how control units can be implemented using either hardwired logic or microprogramming. Microprogramming allows the control signals for each microoperation to be stored in a control memory and accessed sequentially to execute instructions. The document covers various approaches to microprogramming including vertical vs horizontal formats and nanoprogramming.

Uploaded by

FATIMAH
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

AK 07 Operasi Unit Kontrol.

doc Hlm = 14 1

07. OPERASI UNIT KONTROL


Overview
Sejauh pembahasan sebelumnya, kita telah membahas rancangan prosesor
dan diasumsikan bahwa seluruh kontrol bekerja dengan baik.
Dalam bab ini, kita akan
– membahas operasi unit kontrol
– menggaris-bawahi metode rancangan dengan menggunakan
» Kontrol rangkaian
» Kontrol microprogram

Control Unit Function


♦ Kita telah melihat bahwa
– Programs dieksekusi secara instruksi berurut
– Setiap instruksi terdiri dari sederetan langkah yang membentuk
siklus instruksi -- fetch, decode, etc.
♦ Setiap langkah ini, in turn, membuat sejumlah langkah berada pada a
smaller series of steps called microoperations
♦ Thus, the control unit operation can be defined by
– Defining the elements of the CPU
– Defining the microoperations the CPU performs
– Determining the functions the control unit must perform to cause the
execution of the microoperations in the desired time sequence
» Sequencing
» Execution

Microoperations
♦ Each step of the instruction cycle can be decomposed into
microoperation primitives that are performed in a precise time sequence
– Instruction fetch:
t1: MAR <-- (PC)
t2: MBR <-- memory
PC <-- PC+1
t3: IR <-- (MBR)

Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer


AK 07 Operasi Unit Kontrol.doc Hlm = 14 2
– Add R1, X
t1: MAR <-- (IR(address))
t2: MBR <-- memory
t3: R1 <-- (R1) + (MBR)
♦ Each microoperation is initiated and controlled based on the use of
control signals / lines coming from the control unit
– Cause data to move from one register to another
– Activate specific ALU functions
♦ Control unit design is then the collection and the implementation of all
of the needed control signals

♦ Two approaches
– Hardwired logic
» Control unit is viewed as a sequential logic circuit
» Used to generate fixed sequences of control signals
» Implemented using any of a variety of “standard” digital logic
techniques
» Principle advantages
ƒ High(er) speed operation
ƒ Smaller implementations (component counts)

Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer


AK 07 Operasi Unit Kontrol.doc Hlm = 14 3
» Modifications to the design can be hard to do
» Favored approach in RISC style designs
– Microprogrammed control unit
» Control signal values for each microoperation are stored in a
memory device -- the control store
» Reading the contents of the control store in a prescribed order
is equivalent to sequencing through the microoperations
» Since the “program” of microoperations and their control signal
values are stored in memory, microprogrammed units
• Are more systematic with a well defined format
• Can be easily modified during the design process
• Require more components to implement
• Tend to be slower than hardwired units (due to having to
perform memory read operations)

Hardwired approach
♦ Three general design approaches
– Traditional “state-table” method from a digital logic course
» Can produce the minimum component design
» Complex design that may be hard to modify
– Clocked delay element
» Straight-forward layout based on flowchart of the intruction
implementation
» Requires more delay elements (flip flops) than are really needed
– Sequence counter approach
» Polyphase clock signals are dervied from the master clock using a
standard counterdecoder approach
» These signals are applied to the combinational portion of the
circuit
♦ Example: load register B (control signal C12)
– C12 = T4I3 +T5I6Z +T6I24P

Microprogramming
♦ The concept of microprogramming was developed by Maurice Wilkes in
1951, using diode matrices for the memory element

Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer


AK 07 Operasi Unit Kontrol.doc Hlm = 14 4

Figure 15.5 Wilkes’ microprogrammed control unit

♦ Modern microprogrammed control units have replaced the diode


matrices with standard memory components
– The control unit operates by performing consecutive control storage
reads to generate the next set of control function outputs
♦ Performing the series of control memory accesses is, in effect, executing
a program for each instruction in the machine’s instruction set -- hence
the term microprogramming
♦ The control unit appears to be a complete computer within the larger
computer -- with all of its problems
– How do you specify the next microinstruction to be executed?
– How are branches handled?

Figure 15.6 More complex unit

Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer


AK 07 Operasi Unit Kontrol.doc Hlm = 14 5

Figure 15.7 Simple microprogrammed control unit

♦ For the typically large microprocessor systems today, there are


– Many instructions and and associated registerlevel hardware
– Many control point to be manipulated
♦ This can result in a control memory that
– Contains a large number of words -- cooresponding to the number of
instructions to be executed
– Has a wide word width -- due to the large number of control points
to be manipulated
♦ Most modifications to the basic design of a microprogrammed control
unit have been concerned with the word length
♦ Length is based on 3 factors
– Maximum number of simultaneous microoperations that must be
supported
– The was the control information is represented or encoded
– The way in which the next microinstruction address is specified
♦ Designer must choose the parallel “power” of each instruction
– Each microinstruction specifies a single (or few) microoperations to
be performed (vertical microprogramming)
– Each microinstruction specifies many different microoperations to be
performed in parallel (horizontal microprogramming)
♦ Vertical microprogramming
– Width is narrow: n control signals can be encoded into log2n control
bits
– Limited ability to express parallelism
Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer
AK 07 Operasi Unit Kontrol.doc Hlm = 14 6
– Considerable encoding of control information requires external
memory word decoder to identify the exact control line being
manipulated
♦ Horizontal microprogramming
– Wide memory word
– High degree of parallel operations are possible
– Little to no encoding of control information
♦ Compromise
– Divide control signals into disjoint groups
– Implement each group as a separate field in the memory word
– Supports reasonable levels of parallelism without too much
complexity

Control field formats [Hay88]

♦ Second compromise: nanoprogramming


– Use a 2-level control storage organization
– Top level is a vertical format memory
» Output of the top level memory drives the address register of the
bottom (nano-level) memory
– Nanomemory uses the horizontal format
» Produces the actual control signal outputs
– The advantage to this approach is significant saving in control
memory size (bits)
– Disadvantage is more complexity and slower operation (doing 2
memory accesses fro each microinstruction)

Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer


AK 07 Operasi Unit Kontrol.doc Hlm = 14 7

Nanoprogrammed machine [Hay88]


– Example: Supppose that a system is being designed with 200 control
points and 2048 microinstructions
– Assume that only 256 different combinations of control points are
ever used
– A single-level control memory would require 2048x200=409,600
storage bits
– A nanoprogrammed system would use
» Microstore of size 2048x8=16k
» Nanostore of size 256x200=51200
» Total size = 67,584 storage bits
♦ Nanoprogramming has been used in many CISC microprocessors
♦ Microprogramming application: emulation
– The use of a microprogram on one machine to execute programs
originally written to run on another (different!) machine
– By changing the microcode of a machine, you can make it execute
software from another machine
– Commonly used in the past to permit new machines to continue to
run old software
» VAX11-780 had 2 “modes”
ƒ Normal 11-780 mode
ƒ Emulation mode for a PDP-11
– The Nanodata QM-1 machine was marketed with no native
instruction set!
» Universal emulation engine

Operasi Mikro
Operasi mikro adalah operasi fungsional atau operasi atomik suatu CPU.

Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer


AK 07 Operasi Unit Kontrol.doc Hlm = 14 8
Siklus Pengambilan
Siklus pengambilan terjadi pada awal setiap siklus instruksi dan akan
menyebabkan pengambilan instruksi dari memori.
Diasumsikan organisasi CPU berisi empat buah register sbb.:
o Memory Address Register (MAR) :
ƒ Dihubungkan dengan saluran alamat. MAR menspesifikasikan
alamat di dalam memori untuk operasi read dan write.
o Memory Buffer Register (MBR) :
ƒ Dihubungkan dengan saluran data. MBR berisi nilai yang akan
disimpan di memori atau nilai terakhir yang dibaca dari memori.
o Program Counter (PC) :
ƒ Menampung alamat instruksi berikutnya yang akan diambil.
o Instruction Register (IR) :
ƒ Menampung instruksi terakhir yang diambil.

Pada awal siklus pengambilan, alamat instruksi berikutnya yang akan


dieksekusi berada di dalam penghitung program (PC); dalam hal ini
alamatnya adalah 1100100.
ƒ Langkah pertama adalah memindahkan alamat ke memori address
register (MAR), karena register ini merupakan satu-satunya register
yang terhubung dengan bus alamat.
ƒ Langkah kedua adalah memasukkan instruksi. Alamat yang diinginkan
(di MAR) disimpan di bus alamat, unit kontrol mengeluarkan perintah
READ pada bus kontrol. Hasilnya muncul di bus data dan disalin ke
MBR.
Isi PC bertambah satu untuk menyiapkan instruksi berikutnya.
ƒ Langkah ketiga adalah memindahkan isi MBR ke IR.

Jadi siklus pengambilan terdiri dari tiga langkah dengan empat


operasi mikro. Setiap operasi mikro meliputi perpindahan kedalam
atau keluar register.

Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer


AK 07 Operasi Unit Kontrol.doc Hlm = 14 9
Contoh siklus pengambilan sbb.:
MAR MAR 0000000001100100
MBR MBR
PC 0000000001100100 PC 0000000001100100
IR IR
AC AC

a) Awal b) Langkah Pertama

MAR 0000000001100100 MAR 0000000001100100


MBR 0001000000100000 MBR 0001000000100000
PC 0000000001100101 PC 0000000001100101
IR IR 0001000001000000
AC AC
a) Langkah Kedua b) Langkah Ketiga

Rangkaian siklus pengambilan dapat dituliskan sebagai berikut:


t1 : MAR ← (PC)
t2 : MBR← Memori
PC ← (PC) + 1
t3 : IR ← (MBR)

dijelaskan
pada pulsa waktu pertama : Memindahkan isi PC ke MAR
pada pulsa waktu kedua : Memindahkan isi lokasi memori yang
dispesifikasi kan MAR ke MBR.
Menambahkan 1 ke isi PC.
Pada pulsa waktu ketiga : Memindahkan isi MBR ke IR.

Operasi mikro kedua dan ketiga terjadi pada satuan waktu kedua. Operasi
mikro ketiga dapat dikelompokkan dengan operasi mikro yang keempat
tanpa mempengaruhi operasi pengambilan.

t1 : MAR ← (PC)
t2 : MBR← Memori
t3 : PC ← (PC) + 1
IR ← (MBR)

Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer


AK 07 Operasi Unit Kontrol.doc Hlm = 14 10
Pengelompokan operasi mikro harus mengikuti dua aturan sbb.:
1. Rangkaian kejadian yang benar harus dipenuhi.
Jadi (MAR ← (PC)) harus mendahului (MBR ← Memori) karena
operasi pembacaan memori menggunakan alamat yang terdapat di
dalam MAR.
2. Terjadinya konflik harus dihindari. Sebuah operasi mikro tidak
diijinkan membaca dari register yang sama atau menulis ke register
yang sama, karena hasilnya akan sulit diprediksi.
Misalnya, operasi mikro (MBR ← Memori) dan (IR ← (MBR)) tidak
boleh terjadi dalam satuan waktu yang sama.

Siklus Tak Langsung


Setelah instruksi diambil, langkah berikutnya adalah instruction decoding
dan mengambil operand.

Aliran datanya adalah sbb.:


t1 : MAR ← (IR(Alamat))
t2 : MBR ← Memori
t3 : IR(Alamat)← (MBR(Alamat))

Field alamat instruksi dipindahkan ke MAR. Kemudian field alamat


tersebut digunakan untuk mengambil alamat operand. Selanjutnya, alamat
IR diupdate dari MBR, sehingga field tersebut berisi alamat langsung dan
bukan alamat tak langsung lagi.

Siklus Interrupt
Pada akhir siklus eksekusi instruksi, dilakukan suatu pengujian untuk
menentukan apakah interrupt telah terjadi. Bila terjadi interrupt, maka akan
terjadi siklus interrupt.
Contoh siklus interrupt sbb.:
t1 : MBR ← (PC)
t2 : MAR ← Alamat-simpan
PC ← Alamat-rutin
t3 : Memori ← (MBR)
ƒ Pada langkah pertama, isi PC dipindahkan ke MBR, sehingga isi
tersebut dapat disimpan untuk dapat dikembalikan lagi dari interrupt.
Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer
AK 07 Operasi Unit Kontrol.doc Hlm = 14 11
ƒ Kemudian MAR dimuati dengan alamat dimana isi PC akan disimpan,
dan PC dimuati dengan alamat awal rutin pengolahan interrupt. Kedua
aksi ini dapat merupakan operasi mikro tunggal.
ƒ Langkah selanjutnya menyimpan isi MBR ke memori.

Siklus Eksekusi
Contoh siklus eksekusi pada instruksi penambahan sbb.:
ADD R1,X
Tambahkan isi lokasi X ke register R1.

Rangkaian operasi mikronya sbb.:


t1 : MAR ← (IR(Alamat))
t2 : MBR← Memori
t3 : R1 ← R1 + (MBR)

ƒ Mulai dari IR yang berisi instruksi penambahan.


ƒ Pada langkah pertama, alamat IR dimuatkan ke dalam MAR.
ƒ Kemudian, lokasi memori yang direferensikan dibaca.
ƒ Terakhir isi R1 dan MBR ditambahkan oleh ALU.

Contoh lain siklus eksekusi yang lebih kompleks. Suatu instruksi umum
ditingkatkan dan dilompati apabila sama dengan nol.
ISZ X
Isi lokasi X ditambahkan dengan 1. Apabila hasilnya sama dengan nol,
maka instruksi berikutnya dilompati.
Rangkaian operasi mikronya sbb.:
t1 : MAR ← (IR(Alamat))
t2 : MBR ← Memori
t3 : MBR ← (MBR) + 1
t4 : Memori ← (MBR)
If(MBR=0) then (PC ← PC + 1)

Di sini terjadi aksi bersyarat, nilai PC meningkat bila MBR = 0.


Pengujian dan aksi tersebut dapat diimplementasikan sebagai sebuah
operasi mikro.

Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer


AK 07 Operasi Unit Kontrol.doc Hlm = 14 12
Contoh lain adalah instruksi pemanggilan subrutin, misal instruksi branch-
and-save-address.
BSA X
Alamat instruksi yang berada setelah instruksi BSA disimpan di lokasi X,
dan eksekusi dilanjutkan pada lokasi X + 1.
Alamat yang disimpan akan digunakan kemudian untuk keperluan return.
Berikut operasi mikronya:
t1 : MAR ← (IR(Alamat))
MBR ← (PC)
t2 : PC ← (IR(Alamat))
Memori ← (MBR)
t3 : PC ← (PC) + 1

Siklus Instruksi
Setiap fase siklus instruksi dapat diuraikan menjadi rangkaian operasi
mikro elementer.
Secara umum satu siklus instruksi dapat dibagi menjadi 4 bagian siklus
yaitu:
ƒ siklus pengambilan,
ƒ siklus tak langsung (instruction decoding dan operand fetch),
ƒ siklus eksekusi, dan
ƒ siklus interrupt.

Sinyal Kontrol
Berikut adalah gambaran model unit kontrol yang menunjukkan seluruh
input dan outputnya.
Register Instruksi Bus Kontrol

Sinyal Kontrol
dalam CPU

Flags Sinyal Kontrol


Unit Kontrol pada Bus Sistem
Clock
Sinyal Kontrol
pada Bus Sistem
Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer
AK 07 Operasi Unit Kontrol.doc Hlm = 14 13
o Clock : adalah pembangkit pulsa waktu. Unit kontrol menyebabkan
sebuah operasi mikro dibentuk bagi setiap pulsa waktu. Pulsa ini
dikenal sebagai “waktu siklus prosesor” atau “processor cycle time”.
o Instruction Register (Register instruksi) : menentukan operasi mikro
mana yang akan dilakukan selama siklus instruksi.
o Flag : Flag diperlukan oleh unit kontrol untuk menentukan status CPU
dan hasil sebelumnya yang diperoleh dari operasi ALU.
o Control Signals to Control Bus (Sinyal kontrol dari bus kontrol) : bus
kontrol memberikan sinyal-sinyal ke unit kontrol, seperti sinyal
interrupt dan acknowledgment.
o Control Signals Within the CPU (Sinyal kontrol di dalam CPU) :
Sinyal ini terdiri dari dua macam: sinyal-sinyal yang menyebabkan data
dipindahkan dari register yang satu ke register lainnya, dan sinyal-
sinyal yang dapat mengaktivasi fungsi-fungsi ALU yang spesifik.
o Control Signals to Control Bus (Sinyal kontrol bagi bus kontrol) :
Sinyal-sinyal ini juga terdiri dari dua macam : sinyal kontrol bagi
memori, dan sinyal kontrol bagi modul-modul I/O.
Ada tiga macam sinyal kontrol, yaitu:
1. sinyal yang mengaktivasi fungsi ALU
2. sinyal yang mengaktivasi lintasan data
3. sinyal pada bus sistem eksternal.

Beberapa langkah yang dilakukan unit kontrol dalam mengontrol siklus


instruksi:
Pertama : Memindahkan isi PC ke MAR. Unit kontrol melakukan
pemindahan tersebut dengan mengaktivasi sinyal kontrol
yang membuka gate yang terletak diantara bit-bit PC dan bit-
bit MAR.
Selanjutnya : Membaca suatu word dari memori kedalam MBR dan
menambah nilai PC. Unit kontrol melakukannya dengan
mengirimkan sinyal-sinyal kontrol di bawah ini secara
simultan.
1. Sinyal kontrol yang membuka gate dan mengijinkan isi
MAR ke bus alamat.
2. Sinyal kontrol pembacaan memori pada bus kontrol.

Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer


AK 07 Operasi Unit Kontrol.doc Hlm = 14 14
3. Sinyal kontrol yang membuka gate yang mengijinkan isi
bus data untuk disimpan di MBR.
4. Sinyal-sinyal kontrol logika yang menambahkan 1 ke isi
PC dan menyimpan kembali hasilnya ke PC.
Setelah semuanya itu, unit kontrol mengirim sinyal kontrol
yang membuka gate-gate yang berada diantara MBR dan IR.

Summary
♦ This section has oveviewed the operation and the design of the control
unit
♦ Hardwired and microprogramming techniques discussed
– Basic operation of each
– Advantages and disadvantages of each
– “Costs” associated with each

Pertanyaan Pendalaman Materi


1. Jelaskan apa yang dimaksud dengan operasi unit kontrol dalam sistem
komputer.
2. Jelaskan pula apa yang dimaksud dengan microoperation. Berikan
contoh.
3. Jelaskan dua pendekatan dalam desain operasi unit kontrol dalam
sistem komputer.
4. Jelaskan apa yang dimaksud dengan siklus pengambilan, siklus
interupsi dan siklus eksekusi.
5. Jelaskan beberapa sinyal kontrol dalam upaya implementasi
microprogramming.
6. Dalam CPU terdapat beberapa register, di antaranya: MAR, MBR, PC,
IR. Jelaskan fungsi masing-masing register tersebut. Register mana
yang menspesifikasikan alamat memori.
7. Jelaskan tiga macam sinyal kontrol dalam eksekusi instruksi.

Drs. Ign. Djoko Irianto, M.Eng. R0 - 30/12/2007 Arsitektur Komputer

You might also like