Friday, 15 March 2013

Binary Arithmetic

As I mention in previous post today i start with Binary Arithmetic From Group B (Number systems;
Boolean algebra. Hardware . Introduction to logic gates an flip flops;)

Binary Arithmetic

To start with Binary arithmetic at first we have to know about Binary digit Now question is What is Binary Digit ?
The answer is just two digit available in binary world a 0 or a 1 and is called a bit .There are several common conventions for representation of numbers in binary. The most familiar is unsigned binary. An example of a 8-bit number in this case is 01001111 = 0x2^7
+ 1x 2^6 + 0x2^5 + 0x2^4 + 1x2^3 + 1x2^2 + 1x2^1 + 1x 2^0 = 0 + 64 + 0 + 0 + 8 + 4 + 2 + 1 = 79.

The largest number which can be represented by n bits is 2n − 1. For example, with 4 bits the largest number is 11112 = 15. The most signi cant bit (MSB) is the bit representing the highest power of 2, and the
LSB represents the lowest power of 2.
Arithmetic with unsigned binary is analogous to decimal. For example 1-bit addition and multiplication are as follows: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 0, 0 0 = 0, 0 1 = 0, and 1 1 = 1. Note that this is die rent from Boolean algebra, as we shall see shortly, where 1 + 1 = 1.
Another convention is called BCD named binary coded decimal . In this case each decimal digit is separately converted to binary. Therefore, since 7 = 0111 and 9 = 10012, then 79 = 01111001 (BCD).
 Watch that the result 79 is di fferent for both binary conversion and BCD conversion . We will use BCD quite often in this course. It is quite convenient, for example, when decimal numerical displays are used. 

No comments:

Post a Comment