1 / 17

CS 3501 - Chapter 2

CS 3501 - Chapter 2. Dr. Clincy Professor of CS. Multiplication in base 2 – dealing with negative numbers. By hand – signed case – best to use 2’s complement If both numbers are negative, perform as if both numbers are positive

vgomez
Download Presentation

CS 3501 - Chapter 2

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. CS 3501 - Chapter 2 Dr. Clincy Professor of CS Lecture 4

  2. Multiplication in base 2 – dealing with negative numbers By hand – signed case – best to use 2’s complement If both numbers are negative, perform as if both numbers are positive If one is negative and one number is positive, see below – extend out left-most bit Dr. Clincy Lecture Lecture 4 2

  3. How does the computer multiply integers (shifting) ? Computer doesn’t actually multiply – it adds and shifts Dr. Clincy Lecture Lecture 4 3

  4. Examples of Integer Multiplication by 2 Dr. Clincy Lecture 4 4

  5. Another Example of Integer Multiplication by 2 Dr. Clincy Lecture 4 5

  6. Examples of Integer Division by 2 Dr. Clincy Lecture 4 6

  7. Booth’s Algorithm – Faster 2’s Complement Multiplication Dr. Clincy Lecture 4 7

  8. Booth’s Algorithm Concept Dr. Clincy Lecture 4 8

  9. Booth’s Algorithm Concept Dr. Clincy Lecture 4 9

  10. Booth’s Algorithm Standard Approach Booth’s Algorithm Approach This is where 2’s complement comes into play Dr. Clincy Lecture 4 10

  11. Booth’s Algorithm Only consider the first 16 bits – ignore beyond the 16th bit Dr. Clincy Lecture 4 11

  12. Character Codes • Calculations aren’t useful until their results can be displayed in a manner that is meaningful to people. • We also need to store the results of calculations, and provide a means for data input. • Thus, human-understandable characters must be converted to computer-understandable bit patterns using some sort of character encoding scheme. Lecture 4

  13. Character Codes • Binary-coded decimal (BCD) was one of these early codes. It was used by IBM mainframes in the 1950s and 1960s. • In 1964, BCD was extended to an 8-bit code, Extended Binary-Coded Decimal Interchange Code (EBCDIC). • Until recently, ASCII was the dominant character code outside the IBM mainframe world. • Many of today’s systems embrace Unicode, a 16-bit system that can encode the characters of every language in the world Lecture 4

  14. ASCII Lecture 4

  15. EBCDIC Lecture 4

  16. Character Codes • Calculations aren’t useful until their results can be displayed in a manner that is meaningful to people. • We also need to store the results of calculations, and provide a means for data input. • Thus, human-understandable characters must be converted to computer-understandable bit patterns using some sort of character encoding scheme. Lecture 4

  17. Character Codes • Binary-coded decimal (BCD) was one of these early codes. It was used by IBM mainframes in the 1950s and 1960s. • In 1964, BCD was extended to an 8-bit code, Extended Binary-Coded Decimal Interchange Code (EBCDIC). • Until recently, ASCII was the dominant character code outside the IBM mainframe world. • Many of today’s systems embrace Unicode, a 16-bit system that can encode the characters of every language in the world Lecture 4

More Related