SOEN 228 Chapter Notes - Chapter 1: Modular Arithmetic

1627 views17 pages

Document Summary

Modular arithmetic (unsigned & signed (must be in 2s complement! Fraction representation associative power starting from 0: 3. 14 = (3*100) + (1*10-1) + (4*10-2) General rule: 1996 = (1*103) + (9*102) + (9*101) + (6*100) each position has an, n = a5a4a3a2a1. a-1a-2a-3 (most significant bit least significant, let b = base: N = (a5*b5) + (a4*b4) + (a3*b3) + (a2*b2) + (a1*b1) + (a0*b0) + (a- Binary (base 2: 0 and 1. Ternary (base 3: 0, 1, and 2. Original# = (base * largest number possible) + remainder only good for. 1 = (2*0) + 1 ***stop at 0 (14)10 = (1110)2 (b) Base * (original number) = somenumnber base * (decimal of. Somenumber) = somenumber: number before decimal = new number (msb lsb) 2*(0. 25) = 0. 50 2*0. 50 = 1. 00 (stop @ 0); (0. 625)10 = (0. 101)2. |x 100 (convert to decimal first)calculating % error (accuracy) = Example: round to 4 bits: n = (0. 01111001)2 = (0. 47265625)10, step 1 & 2:

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents