You are on page 1of 4

ADAMAS UNIVERSITY

INTRODUCTION TO COMPUTING
ASSIGNMENT

NAME: DEBARUN ROY


CLASS: BCA 1ST YEAR
ROLL NO: UG/02/BCA/2018/002
Q1) Define 1’s and 2’s Complement.

The ones' complement of a binary number is defined as the value obtained by


inverting all the bits in the binary representation of the number (swapping 0s for
1s and vice versa). The ones' complement of the number then behaves like the
negative of the original number in some arithmetic operations. To within a
constant (of −1), the ones' complement behaves like the negative of the original
number with binary addition. However, unlike two's complement, these
numbers have not seen widespread use because of issues such as the offset of
−1, that negating zero results in a distinct negative zero bit pattern, less
simplicity with arithmetic borrowing, etc.

2’s complement of a binary number is 1 added to the 1’s complement of the


binary number.
Examples:

2's complement of "0111" is "1001" 2's complement of "1100" is "0100" 

For 2’s complement, we first find one’s complement. We traverse the one’s
complement starting from LSB (least significant bit), and look for 0. We flip all
1’s (change to 0) until we find a 0. Finally, we flip the found 0. For example,
2’s complement of “01000” is “11000” (Note that we first find one’s
complement of 01000 as 10111).   If there are all 1’s (in one’s complement), we
add an extra 1 in the string. For example, 2’s complement of “000” is “1000”
(1’s complement of “000” is “111”)

Q2) Define Binary Multiplication with Examples


As in decimal system, the multiplication of binary numbers is carried out by
multiplying the multiplicand by one bit of the multiplier at a time and the result
of the partial product for each bit is placed in such a manner that the LSB is
under the corresponding multiplier bit.

Finally the partial products are added to get the complete product. The
placement of the binary point in the product of two binary numbers having
fractional representation is determined in the same way as in the product of
decimal numbers with fractional representation. The total number of places after
the binary point in the multiplicand and the multiplier is counted.

The binary point in the product is then placed before this total number of places
counted from right. It should be noted that a multiplication by zero makes all
the bits of the partial product zero and may thus be ignored in intermediate
steps.

Also, a multiplication by 1 leaves the bits of multiplicand unchanged but shifts


it towards the left by one bit position. The multiplication of binary numbers
becomes more convenient by carrying out intermediate sums of partial products.

In the case of binary multiplication there are certain advantages. The


multiplication is actually the addition of multiplicand with itself after some
suitable shift depending upon the multiplier. Thus multiplication is actually a
process of shifting and adding. This process is to be continued until the shifting
due to MSB of the multiplier is done and final addition is made.

A few examples will make the process of binary multiplication clear:

Multiply:

(i) 10111 by 1101

Solution:

                10111

                                   1 1 0 1

                                 1 0 1 1 1           ← First partial product

                            1 0 1 1 1     

                            1 1 1 0 0 1 1           ← First intermediate sum

                         1 0 1 1 1          

                       1 0 0 1 0 1 0 1 1           ← Final sum.

Hence the required product is 100101011.

Q3) Define Binary Division with Examples


To divide two numbers which result is an exact division, we basically need to
follow fours steps: division, multiplication, subtraction, and next digit. Let's say
that we want to divide 18 by 3, which in binary will be 10010 divided by 00011
(or 11, it's the same).
The method followed in binary division is also similar to that adopted in
decimal system. However, in the case of binary numbers, the operation is
simpler because the quotient can have either 1 or 0 depending upon the divisor.
The table for binary division is

- 1 0
1 1 Meaning less
0 0 Meaning less

For Example:-

1) 11001 ÷ 101

Solution:

        101)   11001   (101


                 101      
                     101
                     101      

Hence the quotient is 101

2) 11101.01 ÷ 1100

Solution:

        1100)   11101.01   (10.0111


                   1100        
                       10101
                         1100      
                             0010
                             1100      
                               1100
                               1100      

Hence the quotient is 10.0111

You might also like