DL Unit 5 - Arithmetic Circuit
DL Unit 5 - Arithmetic Circuit
INSTITUTE OF ENGINEERING
THAPATHALI CAMPUS
Logic Circuit-EX-502
Unit 5: Arithmetic Circuits
Presented By
Er. Ganesh Kumal
Department of Electronics & Computer Engineering
IOE ,Thapathali Campus
5 May, 2023
Contents
5.1 Binary Addition
5.2. Binary Subtraction
5.3. Unsigned Binary Numbers
5.4. Sign‐Magnitude Numbers
5.5. 2’s Complement Representation
5.6. 2’s Complement Arithmetic
5.7. Arithmetic Building Blocks
5.8. The Adder‐Subtracter
5.9. Fast Adder
5.10. Arithmetic Logic Unit
5.11. Binary Multiplication and Division
5.12. Arithmetic Circuits Using HDL
Binary Arithmetic
• Binary arithmetic is essential part of all the digital computers and
many other digital systems.
Binary Addition
• It is a key for binary subtraction, multiplication and division. There
are four rules of binary addition:
Table 2.2 : Truth Table of Binary Addition Example:
Signed Number:
• To represent negative integers, we need a notation for negative values.
• If the binary number is signed, then the leftmost bit represent the sign and rest of the bits
represent the magnitude.
• The convention is to make the sign bit 0 for positive number and 1 for negative number.
• For example:
+ 9 = 01001
− 9 = 11001
Figure : Block diagram, truth table and circuit diagram of half adder.
7/19/2023 Prepared By: Er. Ganesh Kumal 13
Full-Adder
• A combinational circuit that performs the addition of three bits (two
significant bits and a previous carry) is called a full adder.
• Two of the inputs, denoted by A and B, represent the two bits to be added
and third input Cin represent the carry from the previous lower significant
position.
( A B)C + AB
A – B = A + B’ + 1
✓If K = 0, then each full adder gets the normal bits of number B. So, the four bits
binary adder/subtractor produces an output which is addition of two binary
number A and B.
✓If K = 1, then each full adder gets the complement bits of number B. So, the four
bits binary adder/subtractor produces an output which is subtraction of two binary
number A and B.
7/19/2023 Prepared By: Er. Ganesh Kumal 26
Decimal Adder- BCD Adder
• A BCD adder is a circuit that adds two BCD digits in
parallel and produces sum digit also in BCD.
• Following points should be noted for BCD addition:
i. When binary sum is less than or equal to 1001 (9)10
, corresponding BCD number is identical.
ii. When binary sum is greater than 1001, we obtain invalid
BCD sum.
iii. The addition of 6(0110)2 to the binary sum converts it to
the correct BCD and produces an output carry as
required.
Sum > 9
No carry
Invalid BCD
Sum > 9
carry
generated
7/19/2023
Invalid BCD Prepared By: Er. Ganesh Kumal 29
CONT…
• The logic circuit that detects the necessary correction can be
derived from above table. Correction is needed when
➢The binary sum has output carry K = 1
➢The other six combinations from 1010 to 1111 that have Z8
= 1. To distinguish them from binary 1000 and 1001, which
also have a 1 in position Z8, we specify further that either
Z4 or Z2 must have a 1. The condition for a correction and
an output carry can be expressed by the Boolean function
C = K + Z8Z4 + Z8Z2
Inputs Outputs
M1 M0 Operations
0 0 SUM
0 1 AND
1 0 NOR
1 1 XOR
7/19/2023
1 Stage ALU
Inputs Outputs
f1 f0 Operations
0 0 NOT
0 1 OR
1 0 AND
1 1 SUM
7/19/2023
7/19/2023
4 bit ALU
7/19/2023
What About Subtraction ?
(A - B) is the same as: A + (-B)
ഥ
Bit-wise inverse of B is B
So,
A+B ഥ+ 1 = A + (B ഥ + 1) = A + (-B) = A - B
7/19/2023
7/19/2023
Function Table
Function Selection Inputs Output
Di = Xi + Yi + Cin Function/Microoperation
S1 S0 Cin Xi Yi
0 0 0 A B F = A+B Add
0 0 1 A B F = A+B+1 Add with carry
0 1 0 A ഥ
𝐁 ഥ
F = A+𝐁 Subtract with borrow
0 1 1 A ഥ
𝐁 ഥ +1
F = A+𝐁 Subtract
1 0 0 A 0 F=A Transfer A
1 0 1 A 0 F = A+1 Increment A
1 1 0 A 1 F = A-1 Decrement A
1 1 1 A 1 F=A Transfer A
7/19/2023
From the figure we have
got output of multiplexer
[logical circuit] Yi as
S1 S0 Yi
0 0 B
0 1 ഥ
𝐁
1 0 0
1 1 1
Di = Xi + Yi + Cin
= Ai + Yi + Cin
7/19/2023
Design a combinational circuit that multiplies two 2-bit numbers, a1ao and b1,bo, to produce a 4-
bit product, C3,C2,C1 C0. Use AND gates and half-adders.
Thank You!!
Any Queries??
2’s Complement Representation
2’s Complement Arithmetic
Arithmetic Building Block
Adder/Subtractor
Fast Adder
Arithmetic Logic Unit
Binary Multiplication and Division