Binary Arithmetic

Each digit in binary is a 0 or a 1 and is called a bit, which is an abbreviation of binary digit.
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 010011112 = 027 + 126 +  + 120 = 64 + 8 + 4 + 2 + 1 = 7910 (Generally the subscripts will be omitted, since it will be clear from the context.) To convert from base 10 to binary, one can use a decomposition like above, or use the following algorithm illustrated by 79: 79=2 = 39, remainder 1, then 39=2 = 19 r 1, and so forth. Then assemble all the remainders in reverse order. 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, 01 = 0, and 1  1 = 1. Note that this is di erent from Boolean algebra, as we shall see shortly, where 1 + 1 = 1.
Another convention is called BCD (\binary coded decmal”). In this case each decimal digit is separately converted to binary. Therefore, since 7 = 01112 and 9 = 10012, then 79 = 01111001 (BCD). Note that this is di erent than our previous result. We will use BCD quite often in this course. It is quite convenient, for example, when decimal numerical displays are used.

This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>