Binary Arithmetic Flashcards

All 9 cards in this deck

State the four rules of binary addition.

0+0=00+0=0, 0+1=10+1=1, 1+1=101+1=10 (0 carry 1), 1+1+1=111+1+1=11 (1 carry 1).

What are the steps to add two binary numbers?
e.g. 0011+01100011 + 0110

  1. Line up the numbers and add each column starting from the right-hand column.
  2. Carry a 1 into the next column whenever a column totals 2 or 3.
  3. Answer: 1001.

What is the effect on a number's value of a left binary shift of nn places?

It multiplies the number by 2n2^n.
e.g. a shift left of 2 places multiplies by 4.

What is the effect on a number's value of a right binary shift of nn places?

It divides the number by 2n2^n (any remainder is lost).
e.g. a shift right of 1 place halves the number.

True or false? No data is ever lost when a binary shift is carried out.

False. Bits shifted off either end are lost and cannot be recovered.

What are the steps to carry out a left binary shift?
e.g. shift 00001011 two places left

  1. Move every bit the given number of places to the left.
  2. Fill the empty places on the right with 0s.
  3. Result: 00101100 (11 becomes 44).

How can you add three binary numbers in two stages?
e.g. 0001+0011+01010001 + 0011 + 0101

  1. Add the first two numbers: 0001+0011=01000001 + 0011 = 0100.
  2. Add the third number to the result: 0100+0101=10010100 + 0101 = 1001.

In what situation can a binary shift be used?

To multiply or divide a number by a power of two, such as 2, 4 or 8.

What are the steps to carry out a right binary shift?
e.g. shift 01101011 two places right

  1. Move every bit the given number of places to the right.
  2. Fill the empty places on the left with 0s; bits moved off the right-hand end are lost.
  3. Result: 00011010 (107 becomes 26).