Evaluation of Complement Numbers In Binary Number System

Complement Numbers Conversion | Negative Binary Numbers to Decimal Numbers | One's Complement | Two's Complement

Complement In Binary Number System:


This post is in continuation of conversion of binary numbers into decimal numbers. The difference is these numbers are negative numbers. Before starting this article you should know how to convert a binary number into decimal number. Here is my article on binary numbers conversion. And the second thing you should know is the complement system, 1’s complement and 2’s complement. Here is my detailed article on representation of numbers.

Key Questions:
  • Evaluation of Complement Numbers in binary number system using 1’s complement
  • Evaluation of Complement Numbers in binary number system using 2’s can complement

Evaluation of Complement Numbers In Binary Numbers Using 1’s Complement:

There are few steps to follow
  • First look at MSB, either a positive number or a negative number
  • If the number is positive (MSB=0) then the conversion technique remains same
  • If the number is negative (MSB=1) then you have to add (+1) while calculating sum of weights

Example#01:00111101)2

MSB=0; Number is positive.

00111101)2=(0*27)+(0*26)+(1*25)+(1*24)+(1*23)+(1*22)+(0*21)+(1*20)
                    =(0*128)+(0*64)+(1*32)+(1*16)+(1*8)+(1*4)+(0*2)+(1*1)
                    =0+0+32+16+8+4+0+1
                    =61
 Lets verify 
Take 1’s complement of this number 00111101, which is given below:
1’s complement=11000010)2

MSB=1; Number is negative. MSB shows both sign and magnitude of the number. We add (+1) also.

11000010)2=(-1*27)+(1*26)+(0*25)+(0*24)+(0*23)+(0*22)+(1*21)+(0*20)+1
                    =(-1*128)+(1*64)+(0*32)+(0*16)+(0*8)+(0*4)+(1*2)+(0*1)+1
                    =  -128+64+2+1
                    =-61
00111101)2=+61)10
11000010)2=-61)10


Example#02:10110011)2
This time we have a negative number. MSB=1

10110011)2=(-1*27)+(0*26)+(1*25)+(1*24)+(0*23)+(0*22)+(1*21)+(1*20)+1
                    =(-1*128)+(0*64)+(1*32)+(1*16)+(0*8)+(0*4)+(1*2)+(1*1)+1
                    =-128+32+16+2+1+1
                    =-76
Lets verify
1’s complement of this number 10110011)2 which is given below:
1’s complement = 01001100)2

01001100)2=(0*27)+(1*26)+(0*25)+(0*24)+(1*23)+(1*22)+(0*21)+(0*20)
                   =(0*128)+(1*64)+(0*32)+(0*16)+(1*8)+(1*4)+(0*2)+(0*1)
                   =64+8+4
                   =76

10110011)2 = -76)10
01001100)2 = +76)10

Evaluation of Complement Numbers In Binary Numbers Using 2’s Complement:

The following steps to follow:
  • First look at MSB, either a positive number or a negative number
  • If number is positive (MSB=0), the conversion technique remains the same
  • If number is negative you don't need to add (+1) as you did previously

Example#01:01110101)2

MSB=0; Number is positive

01110101)2=(0*27)+(1*26)+(1*25)+(1*24)+(0*23)+(1*22)+(0*21)+(1*20)
                    =(0*128)+(1*64)+(1*32)+(1*16)+(0*8)+(1*4)+(0*2)+(1*1)
                    =64+32+16+4+1
                    =117
Lets verify
Take 2’s complement of this number 01110101 which is given below

1’s complement = 10001010)2
2’s complement = 10001011)2

MSB=1; Number is negative. MSB shows both sign and magnitude of the number.

10001011)2=(-1*27)+(0*26)+(0*25)+(0*24)+(1*23)+(0*22)+(1*21)+(1*20)
                    =(-1*128)+(0*64)+(0*32)+(0*16)+(1*8)+(0*4)+(1*2)+(1*1)
                    =-128+8+2+1
                    =-117

01110101)2=117)10
10001011)2=-117)10


Example#02: 10011100)2

This time we have a negative number. MSB=1

10011100)2=(-1*27)+(0*26)+(0*25)+(1*24)+(1*23)+(1*22)+(0*21)+(0*20)
                     =(-1*128)+(0*64)+(0*32)+(1*16)+(1*8)+(1*4)+(0*2)+(0*1)
                     = -128+16+8+4
                     =-100
           
1’s complement = 01100011)2
2’s complement = 01100100)2

Conversion of this number 01100100)2

01100100)2=(0*27)+(1*26)+(1*25)+(0*24)+(0*23)+(1*22)+(0*21)+(0*20)
                    =(0*128)+(1*64)+(1*32)+(0*16)+(0*8)+(1*4)+(0*2)+(0*1)
                    =64+32+4
                    =100

10011100)2 = -100)10
01100100)2 = 100)10


Recommended Books:

My favorite books by my favorite authors. You can get all digital electronics concepts in these book. loads of examples, illustrations, exercises, applications. This book is very easy to understand for beginner to intermediate level.   

Hexadecimal Division Examples

Hexadecimal Division Examples

This is my fourth and last article on hexadecimal arithmetic. In this post I will solve some examples on hexadecimal number system division. Before starting this topic you should know how to multiply hexadecimal numbers. Here is my article on hexadecimal numbers multiplication.

Key Questions:
  • How to perform division base 16 or hexadecimal number system?
  • How to perform division on fractional hexadecimal numbers?


Hexadecimal Division Examples:

The hexadecimal numbers division is same as the division performs in other number systems. All the rules and principles are same. You can verify your results by using this online calculator.

5÷6  in this 5 is dividend and 6 is divisor

I will discuss three cases with the help of three examples. In first case dividend and divisor both are integers. In second case dividend has a fractional part while divisor is an integer. In third cas both dividend and divisor have fractional parts.

Example#01:AE887)16÷3A)16

First make multiplication table for 3A and it's multiples

3A*1
3A
3A*2
74
3A*3
AE
3A*4
E8
3A*5
122
3A*6
15C
3A*7
196
3A*8
1D0
3A*9
20A
3A*A
244
3A*B
27E


                  3025.A3
         3A⟌AE887  
                 AE      
                   X88
                      74
                      147
                      122
                        250
                        244
                           B0
                           AE
                             2
Answer:3025.A3)16


Example#02:ECE.46)16÷12)16
First make multiplication table for 12


12*1
12
12*2
24
12*3
36
12*4
48
12*5
5A
12*6
6C
12*7
7E
12*8
90
12*9
A2
12*A
B4
12*B
C6
12*C
D8
12*D
EA
 
                       D2.92
         12⟌ECE.46
                 EA
                    2E
                    24
                      A4
                      A2
                         26
                         24
                           2
Answer:D2.92)16


Example#03:257.8A)16÷5.1)16

Shifting hexadecimal point makes the problem easy. According to mathematical rule if you shift hexadecimal point of the dividend upto one place then you have to shift the hexadecimal point of the divisor.

After shifting
2578.A÷51


51*1
51
51*2
A2
51*3
F3
51*4
144
51*5
195
51*6
1E6
51*7
237
51*8
288
51*9
2D9
51*A
32A
51*B
37B
51*C
3CC
51*D
41D


                         76.6D
         51⟌2578.A
                 237
                   208
                  1E6
                     22A
                     1E6
                       440
                       41D
                          33
                                   
Answer: 76.6D)16

Popular Posts