
- Digital Electronics - Home
- Digital Electronics Basics
- Types of Digital Systems
- Types of Signals
- Logic Levels And Pulse Waveforms
- Digital System Components
- Digital Logic Operations
- Digital Systems Advantages
- Number Systems
- Number Systems
- Binary Numbers Representation
- Binary Arithmetic
- Signed Binary Arithmetic
- Octal Arithmetic
- Hexadecimal Arithmetic
- Complement Arithmetic
- Base Conversions
- Base Conversions
- Binary to Decimal Conversion
- Decimal to Binary Conversion
- Binary to Octal Conversion
- Octal to Binary Conversion
- Octal to Decimal Conversion
- Decimal to Octal Conversion
- Hexadecimal to Binary Conversion
- Binary to Hexadecimal Conversion
- Hexadecimal to Decimal Conversion
- Decimal to Hexadecimal Conversion
- Octal to Hexadecimal Conversion
- Hexadecimal to Octal Conversion
- Binary Codes
- Binary Codes
- 8421 BCD Code
- Excess-3 Code
- Gray Code
- ASCII Codes
- EBCDIC Code
- Code Conversion
- Error Detection & Correction Codes
- Logic Gates
- Logic Gates
- AND Gate
- OR Gate
- NOT Gate
- Universal Gates
- XOR Gate
- XNOR Gate
- CMOS Logic Gate
- OR Gate Using Diode Resistor Logic
- AND Gate vs OR Gate
- Two Level Logic Realization
- Threshold Logic
- Boolean Algebra
- Boolean Algebra
- Laws of Boolean Algebra
- Boolean Functions
- DeMorgan's Theorem
- SOP and POS Form
- POS to Standard POS Form
- Minimization Techniques
- K-Map Minimization
- Three Variable K-Map
- Four Variable K-Map
- Five Variable K-Map
- Six Variable K-Map
- Don't Care Condition
- Quine-McCluskey Method
- Min Terms and Max Terms
- Canonical and Standard Form
- Max Term Representation
- Simplification using Boolean Algebra
- Combinational Logic Circuits
- Digital Combinational Circuits
- Digital Arithmetic Circuits
- Multiplexers
- Multiplexer Design Procedure
- Mux Universal Gate
- 2-Variable Function Using 4:1 Mux
- 3-Variable Function Using 8:1 Mux
- Demultiplexers
- Mux vs Demux
- Parity Bit Generator and Checker
- Comparators
- Encoders
- Keyboard Encoders
- Priority Encoders
- Decoders
- Arithmetic Logic Unit
- 7-Segment LED Display
- Code Converters
- Code Converters
- Binary to Decimal Converter
- Decimal to BCD Converter
- BCD to Decimal Converter
- Binary to Gray Code Converter
- Gray Code to Binary Converter
- BCD to Excess-3 Converter
- Excess-3 to BCD Converter
- Adders
- Half Adders
- Full Adders
- Serial Adders
- Parallel Adders
- Full Adder using Half Adder
- Half Adder vs Full Adder
- Full Adder with NAND Gates
- Half Adder with NAND Gates
- Binary Adder-Subtractor
- Subtractors
- Half Subtractors
- Full Subtractors
- Parallel Subtractors
- Full Subtractor using 2 Half Subtractors
- Half Subtractor using NAND Gates
- Sequential Logic Circuits
- Digital Sequential Circuits
- Clock Signal and Triggering
- Latches
- Shift Registers
- Shift Register Applications
- Binary Registers
- Bidirectional Shift Register
- Counters
- Binary Counters
- Non-binary Counter
- Design of Synchronous Counter
- Synchronous vs Asynchronous Counter
- Finite State Machines
- Algorithmic State Machines
- Flip Flops
- Flip-Flops
- Conversion of Flip-Flops
- D Flip-Flops
- JK Flip-Flops
- T Flip-Flops
- SR Flip-Flops
- Clocked SR Flip-Flop
- Unclocked SR Flip-Flop
- Clocked JK Flip-Flop
- JK to T Flip-Flop
- SR to JK Flip-Flop
- Triggering Methods:Flip-Flop
- Edge-Triggered Flip-Flop
- Master-Slave JK Flip-Flop
- Race-around Condition
- A/D and D/A Converters
- Analog-to-Digital Converter
- Digital-to-Analog Converter
- DAC and ADC ICs
- Realization of Logic Gates
- NOT Gate from NAND Gate
- OR Gate from NAND Gate
- AND Gate from NAND Gate
- NOR Gate from NAND Gate
- XOR Gate from NAND Gate
- XNOR Gate from NAND Gate
- NOT Gate from NOR Gate
- OR Gate from NOR Gate
- AND Gate from NOR Gate
- NAND Gate from NOR Gate
- XOR Gate from NOR Gate
- XNOR Gate from NOR Gate
- NAND/NOR Gate using CMOS
- Full Subtractor using NAND Gate
- AND Gate Using 2:1 MUX
- OR Gate Using 2:1 MUX
- NOT Gate Using 2:1 MUX
- Memory Devices
- Memory Devices
- RAM and ROM
- Cache Memory Design
- Programmable Logic Devices
- Programmable Logic Devices
- Programmable Logic Array
- Programmable Array Logic
- Field Programmable Gate Arrays
- Digital Electronics Families
- Digital Electronics Families
- CPU Architecture
- CPU Architecture
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 2s 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 2s 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 2s complement of it in order to get the magnitude.
Example 1
Let us perform the addition of two decimal numbers +7 and +4 using 2s complement method.
The 2s complement representations of +7 and +4 with 5 bits each are shown below.
$$\mathrm{(+7)_{10} \: = \: (00111)_{2}}$$
$$\mathrm{(+4)_{10} \: = \: (00100)_{2}}$$
The addition of these two numbers is
$$\mathrm{(+7)_{10} \: + \: (+4)_{10} \: = \: (00111)_{2} \: + \: (00100)_{2}}$$
$$\mathrm{\Rightarrow \: (+7)_{10} \: + \: (+4)_{10} \: = \: (01011)_{2}}$$
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 2s complement method.
The 2s complement representation of -7 and -4 with 5 bits each are shown below.
$$\mathrm{(7)_{10} \: = \: (11001)_{2}}$$
$$\mathrm{(4)_{10} \: = \: (11100)_{2}}$$
The addition of these two numbers is
$$\mathrm{(7)_{10} \: + \: (4)_{10} \: = \: (11001)_{2} \: + \: (11100)_{2}}$$
$$\mathrm{\Rightarrow \: (7)_{10} \: + \: (4)_{10} \: = \: (110101)_{2}}$$
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)10 + (4)10 = (10101)2.
The sign bit 1 indicates that the resultant sum is negative. So, by taking 2s 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 2s complement form. We know that 2s complement of positive number gives a negative number. So, whenever we have to subtract a number B from number A, then take 2s complement of B and add it to A. So, mathematically we can write it as
A - B = A + (2's complement of B)
Similarly, if we have to subtract the number A from number B, then take 2s complement of A and add it to B. So, mathematically we can write it as
B - A = B + (2's complement of A)
So, the subtraction of two signed binary numbers is similar to the addition of two signed binary numbers. But, we have to take 2s complement of the number, which is supposed to be subtracted. This is the advantage of 2s complement technique. Follow, the same rules of addition of two signed binary numbers.
Example 1
Let us perform the subtraction of two decimal numbers +7 and +4 using 2s complement method.
The subtraction of these two numbers is
$$\mathrm{(+7)_{10} \: \: (+4){10} \: = \: (+7)_{10} \: + \: (4)_{10}}$$
The 2s complement representation of +7 and -4 with 5 bits each are shown below.
$$\mathrm{(+7)_{10} \: = \: (00111)_{2}}$$
$$\mathrm{(+4)_{10} \: = \: (11100)_{2}}$$
$$\mathrm{\Rightarrow \: (+7)_{10} \: + \: (+4)_{10} \: = \: (00111)_{2} \: + \: (11100)_{2} \: = \: (00011)_{2}}$$
Here, the carry obtained from sign bit. So, we can remove it. The resultant sum after removing carry is
$$\mathrm{(+7)_{10} \: + \: (+4)_{10} \: = \: (00011)_{2}}$$
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 2
Let us perform the subtraction of two decimal numbers +4 and +7 using 2s complement method.
The subtraction of these two numbers is
$$\mathrm{(+4)_{10} \: \: (+7)_{10} \: = \: (+4)_{10} \: + \: (7)_{10}}$$
The 2s complement representation of +4 and -7 with 5 bits each are shown below.
$$\mathrm{(+4)_{10} \: = \: (00100)_{2}}$$
$$\mathrm{(-7)_{10} \: = \: (11001)_{2}}$$
$$\mathrm{\Rightarrow \: (+4)_{10} \: + \: (-7)_{10} \: = \: (00100)_{2} \: + \: (11001)_{2} \: = \: (11101)_{2}}$$
Here, carry is not obtained from sign bit. The sign bit 1 indicates that the resultant sum is negative. So, by taking 2s 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.