Thursday, March 12, 2015

Binary Arithmetic

Consist of fundamental operations.

0+ 0 = 0          1 + 1 = 10
0 + 1 = 1          1 + 0 = 1

Fixed point representation is used to represent integer values (from what I taught on Number Systems)
Ex. 100 to base 2 will be 4 to base 10

Magnitude Representation (MR)
- using all bits to represent the magnitude but not the negative values.

Signed- Magnitude Representation (SMR)
-makes use of leftmost bit to represent it whether it is positive or negative.
If the leftmost number or the sign bit is 0, therefore it is positive,
but if it is 1 then it is negative.
Ex. 0100 = + (positive)
 1010= -(negative)

Signed Complement Representation (SCR)
-it is the same with SMR, but if it is negative we can either use 1's complement or 2's complement to convert it to decimal. There is no need to use 1's and 2's complement in a positive bits.

1's Complement Form
-using it with a negative one it will complement all of the bit so that it will be compatible with the negative value.
Ex. 1 11010010(negative)  complement is 00101101(final answer).

2's Complement Form
-using 2's complement form you will complement it first before you have to add one.
Ex. 1 11010010(negative) complement is 00101101 then add 1
= 00101101
+               1
= 00101110(final answer)

The Addition and Subtraction of Binary
-get the SCR of the negative numbers then add the two numbers
-If using 2's - discard end carry, 1's add the end carry to the sum
-In subtraction, convert it first to addition then use SCR then add the two numbers.




No comments:

Post a Comment