Professional Documents
Culture Documents
CSE101 - Lecture 2 PDF
CSE101 - Lecture 2 PDF
Number System
1 byte = 8 bits
1011
+ 1101
Subtraction
Before trying subtraction, we need to
understand how negative numbers are
represented in binary. Signed number must all
have same number of bits. 0s are used to fill up
empty bits.
Subtraction
1011
X 1101
Solution
1. 1011 * 1 (multiplier 1's col) = 1011
2. 1011 * 0 (multiplier 2's col) = 00000
3. 1011 * 1 (multiplier 4's col) = 101100
4. 1011 * 1 (multiplier 8's col) = 1011000
5. Sum up. 1011 + 00000 + 101100 + 1011000 = ((1011
+ 00000) + 101100) + 1011000 = (01011 + 101100) +
1011000 = 110111 + 1011000 = 10001111
Division
Binary division is similar to decimal division.
The only difference is that in decimal system,
since we are dividing traditional numbers, the
dividend (or portion of it) can be 0, 1 or more
than 1 times of the divisor. However in binary,
it can only be 0 or 1.
Division
Following decimal division convention
1. We check for a portion of dividend from its left that
is >= the divisor.
2. Then we subtract the multiple of the divisor that is
<= the portion of the dividend. The multiplier (1)
gets appended to the quotient and result of the
subtraction is the remainder.
Division
To divide 6 by 3 or 110 / 11
1. Is 1 (left most bit of 110) >= 11. No (we don’t need
to add 0 to quotient here since 0s on the left are
insignificant).
Division