Anda di halaman 1dari 15

22/09/2015

H er ma n B udi H a r j a ST., M T
JU R U SAN T EK NIK M ESIN
U NJANI
2015

Penjumlahan bil. biner


Mari kita hitung :

0+0=0
0+1=1
1+0=1
1 + 1 = 0, carry 1

22/09/2015

Pengurangan bil. biner


Mari kita hitung :

0-0=0
1-0=1
1-1=0
10 - 1 = 1

Bilangan tak bertanda


Bilangan yang tidak memiliki tanda + ataupun -
Contoh :

bilangan 8 bit

: 0000000 - 11111111
: 00 - FFH
: 0 255

Penjumlah pada bil. tak bertanda dpt mengakibatkan


overflow sehingga dibutuhkan bit carry.

22/09/2015

Bilangan bertanda
Bilangan yang memiliki tanda + ataupun -
Bit MSB : tanda + ataupun -
0 : tanda positif, dan
1 : tanda negatif.

Contoh :
+38 = 0 0 1 0 0 1 1 0
-38 = 1 0 1 0 0 1 1 0
+25 = 0 0 0 0 0 0 0 1 1 0 0 1
-25 = 1 0 0 0 0 0 0 1 1 0 0 1

Binary, Decimal addition


Decimal
34
+ 17
-----51
from LSD to MSD:
7+4 = 1; with carry out of 1
to next column
1 (carry) + 3 + 1 = 5.
answer = 51.

Binary
1010112
+ 0000012
--------------1011002
From LSB to MSB:
1+1 = 0, carry of 1
1 (carry)+1+0 = 0, carry of 1
1 (carry)+0 + 0 = 1, no carry
1+0 =1
0+0=0
1+0=1
answer = 1011002

22/09/2015

Binary Addition, Subtraction (single digit)


The rules for binary addition are:

The rules for binary subtraction are:

0 + 0 = 0, carry = 0

0 - 0 = 0, borrow = 0

1 + 0 = 1, carry = 0

1 - 0 = 1, borrow = 0

0 + 1 = 1, carry = 0

0 - 1 = 1, borrow = 1

1 + 1 = 0, carry = 1

1 - 1 = 0, borrow = 0

Multiple digits:
Borrows, Carries from digits to left of current of digit.
Binary subtraction, addition works just the same as decimal addition,
subtraction.
7

Subtraction
Binary

Decimal
900

1002

- 001
------899

0-1 = 9; with borrow of 1


from next column
0 -1 (borrow) - 0 = 9, with
borrow of 1
9 - 1 (borrow) - 0 = 8.
Answer = 899.

0-1 = 1; with borrow of 1


from next column
0 -1 (borrow) - 0 = 1, with
borrow of 1
1 - 1 (borrow) - 0 = 0.
Answer = 0112.

0012
------0112

22/09/2015

Definisi
Rangkaian aritmetika digital dasar
terdiri dari dua macam :
Adder, atau rangkaian penjumlah, berfungsi
menjumlahkan dua buah bilangan yang telah
dikonversikan menjadi bilangan-bilangan biner
Subtraktor, atau rangkaian pengurang, yang berfungsi
mengurangkan dua buah bilangan.
Sebuah rangkaian Adder terdiri dari Half Adder
dan Full Adder.

Half Adder (1-bit)


A

Half
Adder

Sum

Cout

S(um)

C(arry)

Half Adder menjumlahkan dua buah bit input, dan menghasilkan nilai jumlahan
(sum) dan nilai lebihnya (carry-out).
Half Adder diletakkan sebagai penjumlah dari bit-bit terendah (Least Significant
Bit).

22/09/2015

Breaking Down the Truth Table


INPUTS

OUTPUTS

Notice the Q

column (carry line)


from the truth
table? Recognize it?
Its an AND!:
Q=AB

Breaking Down the Truth Table


INPUTS

OUTPUTS

Notice the Q

column (carry line)


from the truth
table? Recognize it?
Its an AND!:
Q=AB

22/09/2015

Circuit
Diagram
Q = (~A B) + (A ~B)
A

Q
B

XOR
Symbol
The symbol for the XOR Gate:
A
Q
B

Q=A+B

22/09/2015

Re-Writing the Truth Table


INPUTS
A

OUTPUTS
Q

AB

A+B

The XOR circuit delivers


the Sum Line (R) of
adding two single digits.
The AND circuit
produces the Carry Line
(Q).
Weve just created a
fundamental circuit
called a Half Adder,
which provides the
capability of adding two
single bit numbers.

Half Adder (1-bit)


A
Sum
B

S(um)

C(arry)

Carry

S AB AB A B
C AB

22/09/2015

Breaking down the Truth Table


R will be high iff one and exactly one input is high.
What expression can we use to prove this statement?

R = (~A B) + (A ~B)

Full Adder
A
B
CIN

QCARRY

FULL
ADDER

RSUM

Sebuah Full Adder menjumlahkan dua bilangan yang telah dikonversikan menjadi
bilangan-bilangan biner. Masing-masing bit pada posisi yang sama saling dijumlahkan.
Full Adder sebagai penjumlah pada bit-bit selain yang terendah.
Full Adder menjumlahkan dua bit input ditambah dengan nilai Carry-Out dari
penjumlahan bit sebelumnya. Output dari Full Adder adalah hasil penjumlahan (Sum)
dan bit kelebihannya (carry-out).

22/09/2015

Truth Table
for the Full OUTPUTS
Adder
INPUTS
A

CIN

QCARRY

RSUM

Circuit Diagram for the Full Adder


A

RSUM

B
QCARRY
CIN

10

22/09/2015

Full Adder
Cin

S(um)

Cout

AB
00

01

11

10

Cin(A B AB) Cin ( AB A B)

Cin(A B) Cin (A B)
Cin A B

Cin
0

S Cin A B Cin AB CinAB CinA B

AB

AB

Cin

00

01

11

10

Cin

Or

Cout CinB CinA AB

00

01

11

10

Cout AB Cin( AB A B) AB Cin(A B)

Full Adder
Sum Cin A B

Cout AB Cin(A B)
H.A.

H.A.

A
B

Sum

Cin
Co

11

22/09/2015

Full Adder
Sum Cin A B

Cout AB Cin(A B)

Sum

Half
Adder
B

Sum

Sum

Half
Adder
Co

Co

Co

Cin

Circuit Diagram for the Full Adder


A

RSUM

B
QCARRY
CIN

Sum Cin A B
Cout CinB CinA AB

12

22/09/2015

4-bit Ripple Adder using Full Adder

Carry

A3

B3

A2

B2

A1

B1

A0

B0

Full
Cin
Adder

Full
Cin
Adder

Cout

Full
Cin
Adder

Cout

Full
Cin
Adder

Cout

Cout

S3

S2

S1

S0
S

A
B

A
H.A. B
Cin
Full Adder
H.A.

Cout
C

Half Adder

Disain Subtractor
B3

B2

B1

B0
Subtract

A3

A2

A
C

Full
Cin
Adder

Cout

A1

Full
Cin
Adder

Cout

A0

Full
Cin
Adder

Cout

Full
Cin
Adder

Cout

S3

S2

S1

S0

A B = A + (-B)
Lakukan komplemen 2 pada B
Jadikan penjumlahan A dan komplemen 2 dari B

13

22/09/2015

Sebuah rangkaian Subtractor terdiri dari Half Subtractor


dan Full Subtractor.
Half Subtractor mengurangkan dua buah bit input, dan
menghasilkan nilai hasil pengurangan (Remain) dan nilai
yang dipinjam (Borrow-out).
Half Subtractor diletakkan sebagai pengurang dari bit-bit
terendah (Least Significant Bit).

ADDER/SUBSTRACTOR UNIT

14

22/09/2015

15

Anda mungkin juga menyukai