1/23
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
1’s complement
A way to represent the negative number in binary by flipping every bit of the positive number.
2’s complement
A way to represent negative numbers in binary by taking the 1’s complement and then adding 1.
(2^n - 1) - P
Mathematical representation to represent the 1’s complement of P(any natural number)
Condition in the 1’s complement signed binary addition when the signed bit is now negative and additionally when the MSB produces a carry output, then that carry output is added to the sum and that gets called as “wrap-carry”.
Meaning of “wrap carry” or “end-carry around” in 1’s complement arithmetic?
That it requires an end-around carry, in order to solve the weird case of two zeroes: +0 and -0
What’s the main issue with 1’s complement?
Redundant-zero system
A number system where zero has two different binary representations (+0 and -0). Redundancy like this causes extra rules like end-carry around/wrap-around to keep the arithmetic consistent.
1) Start scanning from the Right to the left 2) Stop when 1 occurs 3) Take all the bits that are on the left side of the one and flip them 4) Then concatenate them with with 1 and right hand bits where you stopped.
Provide the quick hand rule for the 2’s complement
Magnitude limit in 2’s complement
The largest absolute value representable with n bits.
0
The minimum value in an unsigned number
(2^n) - 1
Formula to calculate the maximum value in an unsigned number.
-(2^(n - 1) - 1)
Formula to calculate the minimum value in the 1’s complement
+(2^(n - 1) - 1)
Formula to calculate the maximum value in the 1’s complement
-(2^(n - 1))
Formula to calculate the minimum value in the 2’s complement
+(2^(n - 1) - 1)
Formula to calculate the maximum value in the 2’s complement
Halfway point
2^(n+1) that sets the split in the negative and positive ranges.
n - 1
Formula for the most significant bit position in an unsigned number
n - 2
Formula for the most significant bit position in signed number
A + (2’s complement); ignore carry-out
How to compute A - B in 2’s complement?
A > B (carry-out always get ignored)
In 2’s complement unsigned number’s subtraction when does the carry-out appears?
B > A
In 2’s complement unsigned number’s when does the carry-out does not appear?
Modulo-16 circle model
A diagram with 16 positions labelled 0-15 around a circle. Numbers wrap around after 15 back to zero. It visually shows arithmetic with wraparound.
Clockwise
Movement around the modulo-16 circle model to perform addition (no. of steps are the addend)
Counterclockwise
Movement around the modulo-16 circle model to perform subtraction (no. of steps are the subtrahend)
Yes, it is true
Is it true that when, counting on the modulo-16 circle model, when the result goes past 15 or below zero,
It wraps back to around the circle. This corresponds to the idea of ignoring carry/borrow beyond 4 bits.