Книга: Introduction to Microprocessors and Microcontrollers

Addition

Addition

Example

Add 01011010 + 00011011.

The steps are just the same as in ‘normal’ denary arithmetic. Step 1 Lay them out and start from the lsb (least significant bit) or right-hand bit


Add the right-hand column and we have 0+1=1. So we have


Step 2 Next we add the two 1s in the next column. This results in 2, or 10 in binary. Put the 0 in the answer box and carry the 1 forward to the next column


Step 3 The next column is easy 0+0+1=1


Step 4 The next line is like the second column, 1+1=10. This is written as an answer of 0 and the 1 is carried forward to the next column


Step 5 We now have 1 in each row and a 1 carried forward so the next column is 1+1+1=3 or 11 in binary. This is an answer of 1 and a 1 carried forward to the next column


Step 6 The next column is 0 + 0 + 1 = 1, and the next is 1 + 0 = 1 and the final bit or msb is 0 + 0 = 0, so we can complete the sum


Оглавление книги


Генерация: 0.770. Запросов К БД/Cache: 2 / 0
поделиться
Вверх Вниз