Digital Circuits - Signed Binary Arithmetic




Digital Circuits - Signed Binary Arithmetic

In this chapter, let us discuss about the basic arithmetic operations, which can be performed on any two signed binary numbers using 2’s complement method. The basic arithmetic operations are addition and subtraction.

Addition of two Signed Binary Numbers

Consider the two signed binary numbers A & B, which are represented in 2’s complement form. We can perform the addition of these two numbers, which is similar to the addition of two unsigned binary numbers. But, if the resultant sum contains carry out from sign bit, then discard ignore?????? it in order to get the correct value.

If resultant sum is positive, you can find the magnitude of it directly. But, if the resultant sum is negative, then take 2’s complement of it in order to get the magnitude.

Example 1

Let us perform the addition of two decimal numbers +7 and +4 using 2’s complement method.

The 2’s complement representations of +7 and +4 with 5 bits each are shown below.

+7+710 = 00111001112

+4+410 = 00100001002

The addition of these two numbers is

+7+710 ++4+410 = 00111001112+00100001002

⇒+7+710 ++4+410 = 01011010112.

The resultant sum contains 5 bits. So, there is no carry out from sign bit. The sign bit ‘0’ indicates that the resultant sum is positive. So, the magnitude of sum is 11 in decimal number system. Therefore, addition of two positive numbers will give another positive number.

Example 2

Let us perform the addition of two decimal numbers -7 and -4 using 2’s complement method.

The 2’s complement representation of -7 and -4 with 5 bits each are shown below.

−7−710 = 11001110012

−4−410 = 11100111002

The addition of these two numbers is

−7−710 + −4−410 = 11001110012 + 11100111002

⇒−7−710 + −4−410 = 1101011101012.

The resultant sum contains 6 bits. In this case, carry is obtained from sign bit. So, we can remove it

Resultant sum after removing carry is −7−710 + −4−410 = 10101101012.

The sign bit ‘1’ indicates that the resultant sum is negative. So, by taking 2’s complement of it we will get the magnitude of resultant sum as 11 in decimal number system. Therefore, addition of two negative numbers will give another negative number.

Subtraction of two Signed Binary Numbers

Consider the two signed binary numbers A & B, which are represented in 2’s complement form. We know that 2’s complement of positive number gives a negative number. So, whenever we have to subtract a number B from number A, then take 2’s complement of B and add it to A. So, mathematically we can write it as

A - B = A + 2′scomplementofB2′??????????????

Similarly, if we have to subtract the number A from number B, then take 2’s complement of A and add it to B. So, mathematically we can write it as

B - A = B + 2′scomplementofA2′??????????????

So, the subtraction of two signed binary numbers is similar to the addition of two signed binary numbers. But, we have to take 2’s complement of the number, which is supposed to be subtracted. This is the advantage of 2’s complement technique. Follow, the same rules of addition of two signed binary numbers.

Example 3

Let us perform the subtraction of two decimal numbers +7 and +4 using 2’s complement method.

The subtraction of these two numbers is

+7+710 − +4+410 = +7+710 + −4−410.

The 2’s complement representation of +7 and -4 with 5 bits each are shown below.

+7+710 = 00111001112

+4+410 = 11100111002

⇒+7+710 + +4+410 = 00111001112 + 11100111002 = 00011000112

Here, the carry obtained from sign bit. So, we can remove it. The resultant sum after removing carry is

+7+710 + +4+410 = 00011000112

The sign bit ‘0’ indicates that the resultant sum is positive. So, the magnitude of it is 3 in decimal number system. Therefore, subtraction of two decimal numbers +7 and +4 is +3.

Example 4

Let us perform the subtraction of two decimal numbers +4 and +7 using 2’s complement method.

The subtraction of these two numbers is

+4+410 − +7+710 = +4+410 + −7−710.

The 2’s complement representation of +4 and -7 with 5 bits each are shown below.

+4+410 = 00100001002

−7−710 = 11001110012

⇒+4+410 + −7−710 = 00100001002 + 11001110012 = 11101111012

Here, carry is not obtained from sign bit. The sign bit ‘1’ indicates that the resultant sum is negative. So, by taking 2’s complement of it we will get the magnitude of resultant sum as 3 in decimal number system. Therefore, subtraction of two decimal numbers +4 and +7 is -3.



Frequently Asked Questions

+
Ans: Digital Circuits - Number Systems view more..
+
Ans: Digital Circuits Tutorial view more..
+
Ans: Digital Circuits - Signed Binary Arithmetic view more..
+
Ans: Digital Circuits - Codes view more..
+
Ans: Error Detection & Correction Codes view more..
+
Ans: Digital Circuits - Boolean Algebra view more..
+
Ans: Digital Circuits - Canonical & Standard Forms view more..
+
Ans: Digital Circuits - K-Map Method view more..
+
Ans: Quine-McCluskey Tabular Method view more..
+
Ans: Digital Circuits - Logic Gates view more..
+
Ans: Digital Circuits - Two-Level Logic Realization view more..
+
Ans: Digital Combinational Circuits view more..
+
Ans: Digital Circuits - Decoders view more..
+
Ans: Digital Circuits - Encoders view more..
+
Ans: Digital Circuits - Encoders view more..
+
Ans: Digital Circuits - Multiplexers view more..
+
Ans: Digital Circuits - De-Multiplexers view more..




Rating - NAN/5
464 views

Advertisements