# Binary numbers

Series Geophysical References Series Problems in Exploration Seismology and their Solutions Lloyd P. Geldart and Robert E. Sheriff 7 221 - 252 http://dx.doi.org/10.1190/1.9781560801733 ISBN 9781560801153 SEG Online Store

## Problem

1. Express the decimal numbers 19 and 10 as binary numbers.
2. Add the binary numbers together and convert the sum to a decimal number.
3. Multiply the two binary numbers and convert the product to decimal form.

### Background

Mathematical operations are carried out in binary arithmetic in the same way as in decimal arithmetic. As an example of the similarity between decimal and binary arithmetic, when we add 75 to 129, we add 9 to 5 in the right-hand column and get 4 plus 1 to be carried to the next column. In binary addition, we have only the digits 1 and 0; when we add 1 to 1 we get 0 plus 1 to carry to the next column. In subtraction, when we subtract 1 from 0 we must borrow 1 from the next nonzero column to the left. Multiplication is identical in the two systems. To express a decimal number as a binary number, we subtract the largest power of 2 that is less than the decimal number, then follow the same procedure with the remainders until we end up with 1 or 0.

### Solution

1. ${\displaystyle 19=2^{4}+2^{1}+2^{0}=10011;10=2^{3}+2^{1}=1010.}$
2. ${\displaystyle 10011+1010=11101=2^{4}+2^{3}+2^{2}+2^{0}=16+8+4+1=29.}$
3. ${\displaystyle 10011\times 1010=}$ ${\displaystyle {\begin{array}{c}10\,011\\1\,010\\\hline 100\,110\\10\,011\,0\\\hline 10\,111\,110=2^{7}+2^{5}+2^{4}+2^{3}+2^{2}+2^{1}+0\\\qquad =128+32+16+8+4+2\\=190.\end{array}}}$