of 32 /32
Arithmetic for Computers CPSC 252 Computer Organization Ellen Walker, Hiram College
• Author

hugh-fisher
• Category

## Documents

• view

214

1

Embed Size (px)

### Transcript of Arithmetic for Computers CPSC 252 Computer Organization Ellen Walker, Hiram College.

• Slide 1
• Arithmetic for Computers CPSC 252 Computer Organization Ellen Walker, Hiram College
• Slide 2
• Encoding Numbers Two symbols (1 vs. 0) Binary logic easiest to implement electronically How to represent arbitrary numbers? Ascii Characters 4 bits per decimal digit (Binary Coded Decimal) Raw binary (base 2 numbers)
• Slide 3
• ASCII vs. BCD vs. Binary 33 in ASCII 00110011 00110011 (8*log10 bits) 33 in Binary Coded Decimal 0011 0011 (4*log10 bits) 33 in Binary 100001log2 bits
• Slide 4
• Bit Numbering Convention Bits numbered from right to left, starting with 0 33 = 0 0 1 0 0 0 0 1 Bits: 7 6 5 4 3 2 1 0 Bit 0 is Least Significant Bit (LSB) Bit 7 is Most Significant Bit (MSB)
• Slide 5
• Signed Numbers (Sign / Magnitude) Sign + Magnitude One bit used for sign (convention 1 = negative) N-1 bits for magnitude Difficulties 2 representations for 0 Where does the sign go? (MSB vs. LSB) Complex addition algorithm
• Slide 6
• Twos Complement MSB (sign bit) is the -2^(N-1) place and all other bits are 2^x (0