4. What is Binary Arithmetic?
LFU 20144
Binary arithmetic is essential part of all the digital
computers and many other digital system such as
mobile phones .
Binary numbers are NUMBERS: That means you
can add, subtract, multiply, and divide.
2 + 2 = 4 , and
in Binary: 10 + 10 = 100
11. LFU 201411
1's Complement of Binary Number
As the binary system has base radix = 2. So the two types of
complements for the binary system are 2's complement and 1's
complement.
Complements are used in the digital computers in order to simplify
the subtraction operation and for the logical manipulations, and also
to represent negative numbers.
The 1's complement of a number is found by changing all 1's to 0's
and all 0's to 1's. This is called as taking complement or 1's
complement. Example of 1's Complement is:
Note: All complements should deal with a specific byte or bit size. For example the number above
is 5bits long.
13. 2's Complement of Binary Number
LFU 201413
The 2's complement of binary number is obtained by adding 1 to the
Least Significant Bit (LSB) of 1's complement of the number.
2's complement = 1's complement + 1
Example of 2's Complement is as follows.
The problems of multiple representations of 0 and the need for the end-around
carry are solved by a system called two's complement. In two's complement,
negative numbers are represented by the bit pattern which is one greater (in an
unsigned sense) than the ones' complement of the positive value. In two's-
complement, there is only one zero, represented as 00000000.
16. Binary Coded Decimal (BCD)
LFU 201416
Binary Coded Decimal (BCD):
In computing and electronic systems, binary-coded decimal (BCD) is
a class of binary encodings of decimal numbers where each decimal
digit is represented by a fixed number of bits, usually four or eight,
17. Gray Code
LFU 201417
The reflected binary code, which invented by Frank
Gray, is a binary numeral system where two
successive values differ in only one bit.
The Gray code was originally designed
to prevent false output from
electromechanical switches. Today, Gray
codes are widely used to facilitate error
correction in digital communications such
as digital terrestrial television and some
cable TV systems.
18. Binary to Gray code conversion
LFU 201418
It is easy to convert binary code to gray, by following these steps:
(1) The M.S.B. of the gray code will be exactly equal to the first bit of
the given binary number.
(2) Now the second bit of the code will be exclusive-or of the first
and second bit of the given binary number, i.e if both the bits are
same the result will be 0 and if they are different the result will be 1.
(3)The third bit of gray code will be equal to the exclusive-or of the
second and third bit of the given binary number. Thus
the Binary to gray code conversion goes on. One example given
below can make your idea clear on this type of conversion.
Let (01001) be the given binary number
Thus the equivalent gray code is 01101.
19. Gray to Binary code conversion
LFU 201419
It is also very easy process. Just follow these steps:
(1) The M.S.B of the binary number will be equal to the M.S.B of the
given gray code.
(2) Now if the second gray bit is 0 the second binary bit will be same
as the previous or the first bit. If the gray bit is 1 the second binary bit
will alter. If it was 1 it will be 0 and if it was 0 it will be 1.
(3) This step is continued for all the bits to do Gray code to binary
conversion.
One example given below will make your idea clear.
Let the gray code be 01101
The binary code = (01001)
21. Excess 3 Code
LFU 201421
It is a complementary BCD code and numeral system. It is
basically a binary code which is made by adding 3 to the
equivalent decimal of a binary number and again converting it
into binary number.
Examples:
Excess-3 of 12 is 0001 0010 + 0011 0011 = 0100 0101 (45) .
Excess-3 of 6 is 0110(6) + 0011(3)= 1001(9) .