Operasi Aritmatika
PENGALIAN
Operasi pengalian lebih rumit dibandingkan
operasi penjumlahan atau pengurangan, baik
dalam hardware maupun software
Ada beberapa jenis algoritma yang digunakan
dalam bermacam-macam komputer
Multiplicand (11)
Mutiplier
(13)
1 0 1 1
0 0 0 0
1 0 1 1
Partial
Product
1 0 1 1
1 0 0 0 1 1 1 1
Product
(143)
3
yg diambil selalu Q0
M=1011
PENGALIAN KOMPLEMEN-2
ALGORITMA BOOTH
memiliki kelebihan kecepatan proses
perkaliannya, relatif terhadap pendekatan
langsung
terdapat register Q(multiplier), M(multiplicand),
A(accumulator), dan register 1-bit di kanan Q yg
ditandai dengan Q-1
10
ALGORITMA BOOTH
A
11
ALGORITMA BOOTH
12
ALGORITMA BOOTH
13
ALGORITMA BOOTH
sub
shift
add
1101
10
01
1-0
14
PEMBAGIAN
Operasi Aritmatika
15
PEMBAGIAN-UNSIGNED BINARY
1 3
1 1
1 4 7
1 1
3 7
3 3
4
T.Informatika UAD
16
PEMBAGIAN-UNSIGNED BINARY
E0
M divisor
A,Q dividend
Count n
17
PEMBAGIAN-UNSIGNED BINARY
M = 1011
M = 0101 (2nd-c)
E
0
1
1
1
0
1
1
0
0
1
0
1
1
remainder
A
1
0
0
0
0
1
0
0
0
0
0
1
1
0
1
0
0
0
0
0
1
1
1
1
1
0
0
1
1
1
0
1
1
1
1
1
Q
0
1
0
1
1
1
0
1
1
1
0
0
1
1
1
0
0
0
1
0
1
1
1
0
1
1
1
1
1
0
1
1
1
1
0
0
0 0 1 1
0 1 1 0
Initial
Shift Left
0 1 1 1
1 1 1 0
A A - M
Set Q0
Shift Left
1 1 1 1
1 1 1 0
A A - M
Set Q0
Shift Left
A A - M
1 1 1 0
1 1 0 0
A A + M (restore A)
Shift Left
1 1 0 1
A A - M
Set Q0
quotient
18
PEMBAGIAN KOMPLEMEN-2
Muatkan divisor ke M, dividend ke A dan Q. dividend
diekspresikan sbg komplemen-2 2n-bit.
Geser A dan Q 1-bit ke kiri
Bila M dan A memiliki tanda yg sama, lakukan A A
M; bila tandanya beda, A A + M
Operasi tsb akan berhasil bila tanda A sesudah dan
sebelum operasi sama
19
PEMBAGIAN KOMPLEMEN-2
20
PEMBAGIAN KOMPLEMEN-2
21
PEMBAGIAN KOMPLEMEN-2
22
PEMBAGIAN KOMPLEMEN-2
(-7)/(3)
= dividend
Q = quotient
V = divisor
R = remainder
23
Daftar Pustaka:
1.William Stallings, Computer and Architecture
2.E. Haodudin Nurkifli, Universitas Ahmad Dahlan