Lecture 3
Lecture 3
Chapter 1 – Digital
Computers and Information
Base Conversion
Arithmetic Operations
Decimal Codes
Alphanumeric Codes
Chapter 1 2
Binary Arithmetic
Binary Addition
Binary Subtraction
Binary Multiplication
BCD Addition
Chapter 1 3
Binary Addition
Carries 0 0
Augend 01100 10110
Addend +10001 +10111
Sum
Note: The 0 is the default Carry-In to the
least significant bit.
Chapter 1 4
Binary Subtraction
Borrows 0 0
Minuend 10110 10110
Subtrahend - 10010 - 10011
Difference
Notes: The 0 is a Borrow-In to the least significant
bit. If the Subtrahend > the Minuend, interchange
and append a – to the result.
Chapter 1 5
Binary Multiplication
Chapter 1 7
Warning: Conversion or Coding?
Chapter 1 8
BCD Arithmetic
Given a BCD code, we use binary arithmetic to add the digits:
8 1000 Eight
+5 +0101 Plus 5
13 1101 is 13 (> 9)
Note that the result is MORE THAN 9, so must be
represented by two digits!
To correct the digit, add 6.
8 1000 Eight
+5 +0101 Plus 5
13 1101 is 13 (> 9)
+0110 so add 6
(Carry) 1 0011 leaving 3 + carry
0001 | 0011 Final answer (two digits)
If the digit sum is > 9, add one to the next significant digit
Chapter 1 9
BCD Addition Example
Chapter 1 10
Error-Detection Codes
Chapter 1 11
4-Bit Parity Code Example
Chapter 1 13
Chapter 1 14
Chapter 1 15
ASCII Properties
Chapter 1 16