Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dr. Clincy Professor of CS

Similar presentations


Presentation on theme: "Dr. Clincy Professor of CS"— Presentation transcript:

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

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

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

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

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

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

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

9 Booth’s Algorithm Concept
Dr. Clincy 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 Dr. Clincy Lecture 4 10

11 Booth’s Algorithm Only consider the first 16 bits – ignore beyond the 16th bit Dr. Clincy 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. Dr. Clincy 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 Dr. Clincy Lecture 4

14 ASCII Dr. Clincy Lecture 4

15 EBCDIC Dr. Clincy 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. Dr. Clincy 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 Dr. Clincy Lecture 4


Download ppt "Dr. Clincy Professor of CS"

Similar presentations


Ads by Google