Zusammenfassung der Ressource
Ch1: Five Binary Concepts
- The Three Conversions
- Stripping
- Rightmost = Divide, Get
Remainder
- Each time you divide something by
its base, you strip off the rightmost
digit (as remainder)
- Use for: decimal to BASE
(dec to binary)
- Keep dividing by BASE until
the quotient is 0. Collect
REMAINDERS in REVERSE
order
- Last result%(base) = (binary digit)
- 5(dec)
is ......
5%2 = 1,
2%2 = 0,
1%2 = 1
- NOTE: 1%2 = 1, 1/2 = 0
- Leftmost = Multiply,
Get Integer
- Each time you multiply a
FRACTIONAL part by its base, you
strip off the leftmost digit (as
integer)
- Use for: decimal to BASE
(Fractional part) (dec to binary)
- Keep multiplying THE FRACTIONAL
PART by BASE the fractional part
becomes 0, collect REMAINDER in
FORWARD order
- Law Of Base^Order Sum (BOS)
- Each digit is multiplied by
Base^Order then summed.
- Use for: binary to anything
(binary to dec)
- Groups
- Use for: Binary to hex
- Groups of 4
- Use for: Binary to oct
- Groups of 3
- Complements
- Radix (2's)
- [N] = base^n - (N)
- 2's Complement: Copy until first 1
(included) then
complement
- 2' Complement =
Negative of
original number
- Diminished (1's)
- [N]diminished = (base^n - 1)r - (N)
- 1's Complement :
Complement each bit
- Codes &
Registers
- Overflow
- Occurs when the sum
falls outside the range of
the register
- Complement
carry's do not
count as
overflow
- Occurs when the
addition of two positive
numbers result in a
negative number
- Rule: leftmost digit 0 +
leftmost digit 0 = leftmost
digit 0
- Otherwise, overflow
- BCD
- Each digit is converted into 4-bit
representation then stringed back
together
- (123) = 0001 0010 0011
- Signed binary
numbers
- Use left-most digit to
represent signed
binary numbers
(hardware limitation)
- 0 for positive
- 1 for negative
- Binary Arithmetic
- Subtraction
- 0 -1 = 1 (and borrow 1
from next)
- Add 2's
complement (add
negative number)
- Discard final carry
- Add 1's
complement
- Add end
carry back
to sum
- Multiplication
- Multiply as if you
would do
decimals, same
rules as AND
- Divison