Study sets, textbooks, questions
Upgrade to remove ads
Terms in this set (23)
What are the rules for unsigned binary addition?
1 + 0 = 1
0 + 1 = 1
0 + 0 = 0
1 + 1 = 10
What happens if the addition results in 6 bits but the computer system uses 5 bits?
5 bits to 6 bit: some computer systems will not accept using numbers above a certain number of bits e.g. a 5-bit system would discard the first bit on the left & store the number 01010 ← called overflow
What is overflow?
result of a computation is to large to be stored in the format for numbers
What happens if some computers detect an overflow?
Some computers would notice an overflow has occurred & implement an overflow bit- detects whether 6th bit is non 0 & halts arithmetic & alerts that the addition can't be done (in the constraints of the computer system)
What would other computers try to do with an overflow?
Some computers would try to store the result- may result in the breakdown of a computer system
What are the rules for unsigned binary subtraction?
0 - 0 = 0
1 - 0 = 1
1 - 1 = 0
0 - 1 = borrow (as can't store negative values)
When can you not perform an unsigned binary subtraction?
no value to borrow = can't perform subtraction as negative result
What are the steps for unsigned binary multiplication?
1. Select the number with the smaller number of 1s
2. Split the number into parts
3. Multiply each part to the number with the greater number of 1s (bit-shifting)
4. Sum the resulting products
How do you do unsigned binary division?
Binary long division is similar to decimal long division
What are the steps for signed-magnitude binary addition if the signs are the same?
If the signs are the same:
1. Add the magnitudes to get the magnitude of the result
2. The signed bit is the same as the 2 operands
What are the steps for signed-magnitude binary addition if the signs are not the same?
1. Which operand has the smaller magnitude
2. Subtract the smaller magnitude from the larger magnitude
3. Use the sign of the operand with the larger magnitude
When is there overflow for signed magnitude?
When there is overflow into the signed bit
How do you do signed-magnitude subtraction?
Rearrange subtraction to an addition —> a - b = a + (-b)
Flip the sign of the number
How do you do signed-magnitude multiplication/division?
1. Multiply or divide magnitudes as unsigned binary
2. same sign = result has a positive sign, different signs =. result has a negative sign
How is complement arithmetic different?
Don't need any specialised logic to determine whether a result is positive or negative.
Sets found in the same folder
Essentials of Computer Systems
Other sets by this creator
9 Making the most of models
8 Agile Software Development
10 Sorting Algorithms
9 Search Tree Structures