Penjumlah Biner adalah rangkaian aritmatika yang berupa penjumlahan setengah dan
penjumlah penuh yang digunakan untuk menjumlahkan dua digit biner.
Rangkaian logika kombinasional umum dan sangat berguna lainnya yang
dapat dibangun hanya dengan menggunakan beberapa gerbang logika dasar
yang memungkinkannya untuk menjumlahkan dua atau lebih bilangan biner
adalah Binary Adder .
Sebuah rangkaian biner Adder dasar dapat dibuat dari standar DAN dan Ex-
OR gerbang memungkinkan kita untuk “menambahkan” bersama-sama dua
single bit angka biner, A dan B .
Penambahan dua digit ini menghasilkan keluaran yang disebut SUM dari
penjumlahan dan keluaran kedua disebut bit CARRY atau Carry-out , (C OUT )
sesuai dengan aturan penjumlahan biner. Salah satu kegunaan utama Binary
Adder adalah dalam rangkaian aritmatika dan penghitungan. Pertimbangkan
penjumlahan sederhana dari dua bilangan denary (basis 10) di bawah ini.
JUMLA
912
H
Penambahan Biner
Penjumlahan Biner mengikuti aturan dasar yang sama seperti untuk
penjumlahan denary di atas kecuali dalam biner hanya ada dua digit dengan
digit terbesar adalah “1”. Jadi saat menambahkan bilangan biner, eksekusi
dihasilkan ketika "SUM" sama dengan atau lebih besar dari dua (1 + 1) dan ini
menjadi bit "CARRY" untuk setiap penambahan berikutnya yang diteruskan
ke kolom berikutnya untuk penambahan dan seterusnya. di. Pertimbangkan
penambahan bit tunggal di bawah ini.
0 0 1 1
+0 +1 +0 +1
0 1 1 (membawa) 1 ← 0
Untuk masalah penjumlahan 1-bit sederhana di atas, bit carry yang dihasilkan
dapat diabaikan tetapi Anda mungkin telah memperhatikan sesuatu yang lain
sehubungan dengan penambahan dua bit ini, jumlah penjumlahan binernya
mirip dengan yang ada pada Gerbang OR Eksklusif . Jika kita memberi label
dua bit sebagai A dan B maka tabel kebenaran yang dihasilkan adalah jumlah
dari dua bit tetapi tanpa carry akhir.
B SEBUAH S
0 0 0
0 1 1
1 0 1
2-masukan Ex-OR Gate
1 1 0
Kita dapat melihat dari tabel kebenaran di atas, bahwa gerbang OR-Eksklusif
hanya menghasilkan keluaran “1” ketika salah satu masukan berada pada
logika “1”, tetapi tidak keduanya sama dengan penambahan biner dari dua bit
sebelumnya. Namun untuk melakukan penambahan dua bilangan,
mikroprosesor dan kalkulator elektronik membutuhkan bit carry ekstra untuk
menghitung persamaan dengan benar sehingga kita perlu menulis ulang
penjumlahan sebelumnya untuk memasukkan data keluaran dua bit seperti
yang ditunjukkan di bawah ini.
00 00 01 01
+ 00 + 01 + 00 + 01
00 01 01 10
B SEBUAH C
0 0 0
0 1 0
1 0 0
2-masukan Gerbang AND
1 1 1
Dengan menggabungkan gerbang Exclusive-OR dengan
gerbang AND menghasilkan rangkaian penambah biner digital sederhana
yang umumnya dikenal sebagai rangkaian " Half Adder ".
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Dari tabel kebenaran dari half adder kita dapat melihat bahwa output SUM
( S ) adalah hasil dari gate Exclusive-OR dan Carry-out ( Cout ) adalah hasil
dari gate AND . Kemudian ekspresi Boolean untuk penjumlah setengah
adalah sebagai berikut.
Untuk bit SUM :
JUMLAH = A XOR B = A ⊕ B
Untuk bit CARRY :
BAWA = A DAN B = AB
Satu kelemahan utama dari sirkuit Half Adder ketika digunakan sebagai
penambah biner, adalah bahwa tidak ada ketentuan untuk "Carry-in" dari
sirkuit sebelumnya saat menambahkan beberapa bit data.
Sebagai contoh, misalkan kita ingin menjumlahkan dua byte data 8-bit, bit
carry apapun yang dihasilkan harus dapat “merobek” atau bergerak melintasi
pola bit mulai dari bit yang paling tidak signifikan (LSB). Operasi paling rumit
yang dapat dilakukan oleh setengah penambah adalah “1 + 1” tetapi karena
penambah setengah tidak memiliki masukan yang dibawa, nilai tambah yang
dihasilkan akan salah. Salah satu cara sederhana untuk mengatasi masalah
ini adalah dengan menggunakan rangkaian binary adder tipe Full Adder .
Jumla
C-in B SEBUAH C-out
h
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Pengurang Biner
Pengurangan Biner adalah jenis lain dari rangkaian aritmatika kombinasional yang
menghasilkan keluaran yang merupakan pengurangan dua bilangan biner.
Sesuai dengan namanya, Pengurang Biner adalah rangkaian pengambilan
keputusan yang mengurangi dua bilangan biner satu sama lain, misalnya X -
Y untuk mencari perbedaan yang dihasilkan antara kedua bilangan tersebut.
Berbeda dengan Binary Adder yang menghasilkan JUMLAH dan bit CARRY
ketika dua bilangan biner dijumlahkan, pengurang biner menghasilkan
PERBEDAAN, D dengan menggunakan bit BORROW, B dari kolom
sebelumnya. Maka jelas, operasi pengurangan adalah kebalikan dari
penjumlahan.
Kami belajar dari pelajaran matematika di sekolah bahwa tanda minus, " - "
digunakan untuk perhitungan pengurangan, dan ketika satu angka
dikurangkan dari yang lain, pinjaman diperlukan jika pengurangan lebih besar
dari minuend. Pertimbangkan pengurangan sederhana dari dua bilangan
denary (basis 10) di bawah ini.
(Angka yang
123 X dikurangi)
- 78 Y (Pengurang)
45 PERBEDAAN
Kita tidak bisa langsung mengurangi 8 dari 3 di kolom pertama karena 8 lebih
besar dari 3, jadi kita harus meminjam 10, bilangan dasar, dari kolom
berikutnya dan menambahkannya ke minuend untuk menghasilkan 13
dikurangi 8. Ini “pinjaman ”10 kemudian kembali ke subtrahend dari kolom
berikutnya setelah perbedaannya ditemukan. Matematika sekolah sederhana,
pinjam 10 jika perlu, temukan perbedaannya dan kembalikan pinjamannya.
Pengurangan satu bilangan biner dari yang lain adalah ide yang sama persis
dengan pengurangan dua bilangan desimal tetapi karena sistem bilangan
biner adalah sistem penomoran Basis-2 yang menggunakan "0" dan "1"
sebagai dua digit independennya, biner besar bilangan yang akan
dikurangkan satu sama lain oleh karena itu direpresentasikan dalam istilah "0"
dan "1".
Pengurangan Biner
Pengurangan Biner dapat memiliki banyak bentuk, tetapi aturan
pengurangannya sama dengan proses mana pun yang Anda
gunakan. Karena notasi biner hanya memiliki dua digit, mengurangi "0" dari
"0" atau "1" membuat hasilnya tidak berubah sebagai 0-0 = 0 dan 1-0 =
1 . Mengurangkan “1” dari “1” menghasilkan “0”, tetapi mengurangi “1” dari “0”
membutuhkan pinjaman. Dengan kata lain 0 - 1 membutuhkan pinjaman.
(pinjam) 1
0 1 1
→0
-0 -0 -1 -1
0 1 0 1
Untuk soal pengurangan 1-bit sederhana di atas, jika bit pinjaman diabaikan,
hasil pengurangan binernya mirip dengan Gerbang ATAU Eksklusif. Untuk
mencegah kebingungan dalam tutorial ini antara masukan pengurang biner
berlabel, B dan keluaran bit pinjaman yang dihasilkan dari pengurang biner
juga diberi label, B , kita akan memberi label dua bit masukan
sebagai X untuk minuend dan Y untuk pengurang. Kemudian tabel kebenaran
yang dihasilkan adalah selisih antara dua bit masukan dari pengurang biner
tunggal diberikan sebagai:
Y X Q
0 0 0
0 1 1
1 0 1
2-masukan Ex-OR Gate
1 1 0
Seperti halnya Binary Adder, perbedaan antara dua digit hanya “1” jika kedua
input ini tidak sama dengan yang diberikan oleh ekspresi Ex-OR. Namun, kita
membutuhkan output tambahan untuk menghasilkan bit pinjaman ketika
input X = 0 dan Y = 1 . Sayangnya tidak ada gerbang logika standar yang
akan menghasilkan output untuk kombinasi input X dan Y ini .
Tapi kita tahu bahwa Gerbang AND menghasilkan output “1” ketika kedua
inputnya X dan Y adalah “1” (TINGGI) jadi jika kita menggunakan inverter
atau Gerbang NOT untuk melengkapi input X sebelum diumpankan
ke gerbang AND , kita dapat menghasilkan output pinjaman yang dibutuhkan
ketika X = 0 dan Y = 1 seperti yang ditunjukkan di bawah ini.
Y X PERBEDAAN MEMINJAM
0 0 0 0
0 1 1 0
1 0 1 1
1 1 0 0
0 0 0 0 0
0 0 1 1 0
0 1 0 1 1
0 1 1 0 0
1 0 0 1 1
1 0 1 0 0
1 1 0 0 1
1 1 1 1 1
Binary Adder
Binary Adders are arithmetic circuits in the form of half-adders and full-addersb used to
add together two binary digits
Another common and very useful combinational logic circuit which can be
constructed using just a few basic logic gates allowing it to add together two
or more binary numbers is the Binary Adder.
A basic Binary Adder circuit can be made from standard AND and Ex-
OR gates allowing us to “add” together two single bit binary
numbers, A and B.
The addition of these two digits produces an output called the SUM of the
addition and a second output called the CARRY or Carry-out, ( COUT ) bit
according to the rules for binary addition. One of the main uses for the Binary
Adder is in arithmetic and counting circuits. Consider the simple addition of
the two denary (base 10) numbers below.
123 A (Augend)
+ 789 B (Addend)
912 SUM
From our maths lessons at school, we learnt that each number column is
added together starting from the right hand side and that each digit has a
weighted value depending upon its position within the columns.
When each column is added together a carry is generated if the result is
greater or equal to 10, the base number. This carry is then added to the result
of the addition of the next column to the left and so on, simple school math’s
addition, add the numbers and carry.
The adding of binary numbers is exactly the same idea as that for adding
together decimal numbers but this time a carry is only generated when the
result in any column is greater or equal to “2”, the base number of binary. In
other words 1 + 1 creates a carry.
Binary Addition
Binary Addition follows these same basic rules as for the denary addition
above except in binary there are only two digits with the largest digit being “1”.
So when adding binary numbers, a carry out is generated when the “SUM”
equals or is greater than two (1+1) and this becomes a “CARRY” bit for any
subsequent addition being passed over to the next column for addition and so
on. Consider the single bit addition below.
0 0 1 1
+0 +1 +0 +1
0 1 1 (carry) 1←0
When the two single bits, A and B are added together, the addition of “0 + 0”,
“0 + 1” and “1 + 0” results in either a “0” or a “1” until you get to the final
column of “1 + 1” then the sum is equal to “2”. But the number two does not
exists in binary however, 2 in binary is equal to 10, in other words a zero for
the sum plus an extra carry bit.
Then the operation of a simple adder requires two data inputs producing two
outputs, the Sum (S) of the equation and a Carry (C) bit as shown.
For the simple 1-bit addition problem above, the resulting carry bit could be
ignored but you may have noticed something else with regards to the addition
of these two bits, the sum of their binary addition resembles that of
an Exclusive-OR Gate. If we label the two bits as A and B then the resulting
truth table is the sum of the two bits but without the final carry.
B A S
0 0 0
0 1 1
1 0 1
2-input Ex-OR Gate
1 1 0
We can see from the truth table above, that an Exclusive-OR gate only
produces an output “1” when either input is at logic “1”, but not both the same
as for the binary addition of the previous two bits. However in order to perform
the addition of two numbers, microprocessors and electronic calculators
require the extra carry bit to correctly calculate the equations so we need to
rewrite the previous summation to include two-bits of output data as shown
below.
00 00 01 01
+ 00 + 01 + 00 + 01
00 01 01 10
From the above equations we now know that an Exclusive-OR gate will only
produce an output “1” when “EITHER” input is at logic “1”, so we need an
additional output to produce the carry bit when “BOTH” inputs A and B are at
logic “1”. One digital gate that fits the bill perfectly producing an output “1”
when both of its inputs A and B are “1” (HIGH) is the standard AND Gate.
B A C
0 0 0
0 1 0
1 0 0
2-input AND Gate
1 1 1
By combining the Exclusive-OR gate with the AND gate results in a simple
digital binary adder circuit known commonly as the “Half Adder” circuit.
B A SUM CARRY
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
From the truth table of the half adder we can see that the SUM (S) output is
the result of the Exclusive-OR gate and the Carry-out (Cout) is the result of
the AND gate. Then the Boolean expression for a half adder is as follows.
For the SUM bit:
SUM = A XOR B = A ⊕ B
For the CARRY bit:
CARRY = A AND B = A.B
One major disadvantage of the Half Adder circuit when used as a binary
adder, is that there is no provision for a “Carry-in” from the previous circuit
when adding together multiple data bits.
For example, suppose we want to add together two 8-bit bytes of data, any
resulting carry bit would need to be able to “ripple” or move across the bit
patterns starting from the least significant bit (LSB). The most complicated
operation the half adder can do is “1 + 1” but as the half adder has no carry
input the resultant added value would be incorrect. One simple way to
overcome this problem is to use a Full Adder type binary adder circuit.
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
SUM = (A XOR B) XOR Cin = (A ⊕ B) ⊕ Cin
For the CARRY-OUT (Cout) bit:
CARRY-OUT = A AND B OR Cin(A XOR B) = A.B + Ci
n(A ⊕ B)
As their name implies, a Binary Subtractor is a decision making circuit that
subtracts two binary numbers from each other, for example, X – Y to find the
resulting difference between the two numbers.
Unlike the Binary Adder which produces a SUM and a CARRY bit when two
binary numbers are added together, the binary subtractor produces a
DIFFERENCE, D by using a BORROW bit, B from the previous column. Then
obviously, the operation of subtraction is the opposite to that of addition.
We learnt from our maths lessons at school that the minus sign, “–” is used for
a subtraction calculation, and when one number is subtracted from another, a
borrow is required if the subtrahend is greater than the minuend. Consider the
simple subtraction of the two denary (base 10) numbers below.
123 X (Minuend)
– 78 Y (Subtrahend)
45 DIFFERENCE
We can not directly subtract 8 from 3 in the first column as 8 is greater than 3,
so we have to borrow a 10, the base number, from the next column and add it
to the minuend to produce 13 minus 8. This “borrowed” 10 is then return back
to the subtrahend of the next column once the difference is found. Simple
school math’s, borrow a 10 if needed, find the difference and return the
borrow.
The subtraction of one binary number from another is exactly the same idea
as that for subtracting two decimal numbers but as the binary number
system is a Base-2 numbering system which uses “0” and “1” as its two
independent digits, large binary numbers which are to be subtracted from
each other are therefore represented in terms of “0’s” and “1’s”.
Binary Subtraction
Binary Subtraction can take many forms but the rules for subtraction are the
same whichever process you use. As binary notation only has two digits,
subtracting a “0” from a “0” or a “1” leaves the result unchanged as 0-
0 = 0 and 1-0 = 1. Subtracting a “1” from a “1” results in a “0”, but subtracting
a “1” from a “0” requires a borrow. In other words 0 – 1 requires a borrow.
0 1 1 (borrow)1→ 0
–0 –0 –1 –1
0 1 0 1
For the simple 1-bit subtraction problem above, if the borrow bit is ignored the
result of their binary subtraction resembles that of an Exclusive-OR Gate. To
prevent any confusion in this tutorial between a binary subtractor input
labelled, B and the resulting borrow bit output from the binary subtractor also
being labelled, B, we will label the two input bits as X for the minuend
and Y for the subtrahend. Then the resulting truth table is the difference
between the two input bits of a single binary subtractor is given as:
Y X Q
0 0 0
0 1 1
1 0 1
2-input Ex-OR Gate
1 1 0
As with the Binary Adder, the difference between the two digits is only a “1”
when these two inputs are not equal as given by the Ex-OR expression.
However, we need an additional output to produce the borrow bit when
input X = 0 and Y = 1. Unfortunately there are no standard logic gates that will
produce an output for this particular combination of X and Y inputs.
But we know that an AND Gate produces an output “1” when both of its
inputs X and Y are “1” (HIGH) so if we use an inverter or NOT Gate to
complement the input X before it is fed to the AND gate, we can produce the
required borrow output when X = 0 and Y = 1 as shown below.
Y X DIFFERENCE BORROW
0 0 0 0
0 1 1 0
1 0 1 1
1 1 0 0
From the truth table of the half subtractor we can see that the DIFFERENCE
(D) output is the result of the Exclusive-OR gate and the Borrow-out (Bout) is
the result of the NOT-AND combination. Then the Boolean expression for a
half subtractor is as follows.
For the DIFFERENCE bit:
D = X XOR Y = X ⊕ Y
For the BORROW bit
B = not-X AND Y = X.Y
If we compare the Boolean expressions of the half subtractor with a half
adder, we can see that the two expressions for the SUM (adder) and
DIFFERENCE (subtractor) are exactly the same and so they should be
because of the Exclusive-OR gate function. The two Boolean expressions for
the binary subtractor BORROW is also very similar to that for the adders
CARRY. Then all that is needed to convert a half adder to a half subtractor is
the inversion of the minuend input X.
One major disadvantage of the Half Subtractor circuit when used as a binary
subtractor, is that there is no provision for a “Borrow-in” from the previous
circuit when subtracting multiple data bits from each other. Then we need to
produce what is called a “full binary subtractor” circuit to take into account this
borrow-in input from a previous circuit.
0 0 0 0 0
0 0 1 1 0
0 1 0 1 1
0 1 1 0 0
1 0 0 1 1
1 0 1 0 0
1 1 0 0 1
1 1 1 1 1