1 / 16

Binary Arithmetic

Binary Arithmetic. CPSC 101: Chp 2 John Lamertina. Early Need to Count. One-to-One Sets. |||||||||||||||||||||||||||||. 27 pebbles ≡ 27 sheep. Counting in 10s. Up to TEN More than TEN?. Countable Sets of 10. 10. 10. 7. Why Decimal Numbers?. 10 fingers 10 digits (0,1,2,3,…,9)

Mercy
Download Presentation

Binary Arithmetic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Binary Arithmetic CPSC 101: Chp 2 John Lamertina

  2. Early Need to Count

  3. One-to-One Sets ||||||||||||||||||||||||||||| 27 pebbles ≡ 27 sheep

  4. Counting in 10s Up to TEN More than TEN?

  5. Countable Sets of 10 10 10 7

  6. Why Decimal Numbers? • 10 fingers • 10 digits (0,1,2,3,…,9) • Countable Sets of 10 • Ones • Tens • Hundreds • Thousands • etc

  7. Simple Decimal Number 27 = 20 + 7 = 2 tens + 7 ones = (2×10) + (7×1) = (2×101) + (7×100) Anything to the zero power is 1 Powers of 10

  8. Another Decimal Number 9327 = 9000 + 300 +20 + 7 = 9 thousands + 3 hundreds + 2 tens + 7 ones = (9×1000) + (3×100) + (2×10) + (7×1) = (9×103) + (3×102) + (2×101) + (7×100) Powers of 10

  9. A Decimal Number with Zeros 7009 = 7000 + 0 + 0 + 9 = 7 thousands + 0 hundreds + 0 tens + 9 ones = (7×1000) + (0×100) + (0×10) + (9×1) = (7×103) + (0×102) + (0×101) + (9×100) Powers of 10

  10. Decimal vs Binary • Decimal numbers are powers of 10 • Deci = 10 • Binary numbers are powers of 2 • Bi = 2

  11. Why Binary Numbers? • Electronic circuits have two possible states or values: Off and On • Off and On: Zero and One (0, 1) • Two digits (0, 1): binary number system • Thus computers operate on the binary number system

  12. Simple Binary Number 1012 = 1002 + 02 + 12 = (1×22) + (0×21) + (1×20) Read “101, base 2” not 101 squared. Powers of 2

  13. Simple Binary Number 1012 = 1002 + 02 + 12 = (1×22) + (0×21) + (1×20) = 410 + 010 + 110 = 510 1012 = 510

  14. Simple Decimal Number vs Simple Binary Number 15 = 10 + 5 = 1 ten + 5 ones = (1×10) + (5×1) = (1×101) + (5×100) 11112 = 10002 + 1002 + 102 + 12 = (1×23) + (1×22) + (1×21) + (1×20) = 810 + 410 + 210 + 110 = 1510 Powers of 10 Powers of 2

  15. Convert Binary to Decimal 101101012 (1×27) + (0×26) + (1×25) + (1×24) + (0×23) + (1×22) + (0×21) + (1×20) = 128 + 0 + 32 + 16 + 0 + 4 + 0 + 1 = 18110

  16. Convert Decimal to Binary:“Successive Division by Two” Example Decimal Number: 29 1 0 1 1 1 Binary Result: 1 1 1 0 1

More Related