Dr. Clincy Professor of CS CS 3501 - Chapter 2 Dr. Clincy Professor of CS Dr. Clincy Lecture 4
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
How does the computer multiply integers (shifting) ? Computer doesn’t actually multiply – it adds and shifts Dr. Clincy Dr. Clincy Lecture 4 Lecture 3
Examples of Integer Multiplication by 2 Dr. Clincy Dr. Clincy Lecture 4 4 4
Another Example of Integer Multiplication by 2 Dr. Clincy Dr. Clincy Lecture 4 5 5
Examples of Integer Division by 2 Dr. Clincy Dr. Clincy Lecture 4 6 6
Booth’s Algorithm – Faster 2’s Complement Multiplication Dr. Clincy Dr. Clincy Lecture 4 7
Booth’s Algorithm Concept Dr. Clincy Dr. Clincy Lecture 4 8
Booth’s Algorithm Concept Dr. Clincy Dr. Clincy Lecture 4 9
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
Booth’s Algorithm Only consider the first 16 bits – ignore beyond the 16th bit Dr. Clincy Dr. Clincy Lecture 4 11
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
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
ASCII Dr. Clincy Lecture 4
EBCDIC Dr. Clincy Lecture 4
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
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