Binary arithmetic operations
- In
mathematics, the four basic arithmetic operations applied on numbers are
addition, subtraction, multiplications and division.
- In
computers, the same operations are performed inside the central processing
unit by the arithmetic and logic unit (ALU). However, the arithmetic and
logic unit cannot perform binary subtractions directly. It performs binary
subtractions using a process known asFor multiplication and division, the
arithmetic and logic unit uses a method called shifting before
adding the bits.
Representation of
signed binary numbers
- In
computer technology, there are three common ways of representing a signed
binary number.
- Prefixing
an extra sign bit to a binary number.
- Using
ones compliment.
- Using
twos compliment.
Prefixing an extra
sign bit to a binary number
- In
decimal numbers, a signed number has a prefix “+” for a positive number
e.g. +2710 and “-“ for a negative number e.g.-27
- However,
in binary, a negative number may be represented by prefixing a digit 1 to
the number while a positive number may be represented by prefixing a digit
0. For example, the 7-bit binary equivalent of 127 is 11111112.
To indicate that it is positive, we add an extra bit (0) to the left of
the number i.e. (0)11111112.
- To
indicate that it is negative number we add an extra bit (1) i.e.
(1)11111112.
- The
problem of using this method is that the zero can be represented in two
ways i.e.(0)00000002 and (1)00000002.
Binary Addition
It is
a key for binary subtraction, multiplication, division. There are four rules of
binary addition.
In fourth case, a binary addition is creating a sum of (1 + 1 =
10) i.e. 0 is written in the given column and a carry of 1 over to the next
column.
Example − Addition
Binary Subtraction
Subtraction and Borrow, these two words will be
used very frequently for the binary subtraction. There are four rules of binary
subtraction.
Example − Subtraction
Binary Multiplication
Binary
multiplication is similar to decimal multiplication. It is simpler than decimal
multiplication because only 0s and 1s are involved. There are four rules of
binary multiplication.
Example − Multiplication
Binary Division
Binary
division is similar to decimal division. It is called as the long division
procedure.
Example − Division