Download presentation
Presentation is loading. Please wait.
1
Dr. Clincy Professor of CS
CS Chapter 2 Dr. Clincy Professor of CS Dr. Clincy Lecture 3
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 2
3
How does the computer multiply integers (shifting) ?
Computer doesn’t actually multiply – it adds and shifts Dr. Clincy Dr. Clincy Lecture 3
4
Examples of Integer Multiplication by 2
Dr. Clincy 4 4
5
Another Example of Integer Multiplication by 2
Dr. Clincy 5 5
6
Examples of Integer Division by 2
Dr. Clincy 6 6
7
Booth’s Algorithm – Faster 2’s Complement Multiplication
Dr. Clincy 7
8
Booth’s Algorithm Concept
Dr. Clincy 8
9
Booth’s Algorithm Concept
Dr. Clincy 9
10
Booth’s Algorithm Standard Approach Booth’s Algorithm Approach
This is where 2’s complement comes into play Dr. Clincy 10
11
Booth’s Algorithm Only consider the first 16 bits – ignore beyond the 16th bit Dr. Clincy 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
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
14
ASCII Dr. Clincy
15
EBCDIC Dr. Clincy
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 9 and 10
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 9 and 10
18
Error Detection Vs Error Correction
Error Detection – determining if an error occurred or not Error Correction – given an error has occurred, correcting the error – much more complex than error detection (Method 1) Fix the error by retransmitting the frame that is in error - Rx ask the Tx to retransmit (Method 2) Forward error control – fixing the error on the Rx side (complex) Dr. Clincy Lecture 9 and 10
19
Error Control Techniques
Trade off between detection probability and processing requirements Approaches Detection Simple Parity (Double Parity) Cyclic Redundancy Checksum Error correction Hamming Approach Dr. Clincy Lecture 9 and 10
20
Error Detection: Single Parity
Bit added to each character to make all bits add up to an even number (even parity) or odd number (odd parity) Good for detecting single-bit errors only High overhead (one extra bit per 7-bit character=12.5%) Examples of parity bits What’s the disadvantage ?: what happens for 2 bit errors ? . Dr. Clincy Dr. Clincy Lecture 9 and 10 Lecture 20 20
21
Do Some Examples w/students
Even, Odd, Odd, Even, 11111 Dr. Clincy Dr. Clincy Lecture 9 and 10 Lecture 21 21
22
Parity Bit Concept Given the word: – add “parity bit” Even Parity: even # of 1’s: Odd Parity: odd # of 1’s: What’s the disadvantage ?: what happens for 2 bit errors ? Another Example: Encode 1100 in (a), even parity added in (b), Error in AC in (c) NOW, do we see how we can use the Parity Bit Concept to Detect Errors Dr. Clincy Lecture
23
Error Detection: Double Parity
Uses horizontal and longitudinal parity Individual characters are grouped together in a block Each row (character) would have a parity bit Each column would have a parity bit The group of parity bits formed by the rows and columns Parity bits (B) If 1 bit is in error, (B) catches it, if 2 bits are in error, (A) catches it Parity bits (A) Dr. Clincy Lecture
24
Do some examples w/students
Even 111101 101010 110011 Odd 11101 11010 11000 Even 110001 100010 110011 Odd 10001 11010 11100 Dr. Clincy Lecture
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.