Binary Arithmetic Flashcards
What is a carry
when we run out of digits for storage, a carry will store the last digit
what is the amount of bits we are limited to in our arm architecture
32
What is the largest number we can represent with 32 bits
2^32
What are the four condition control flags
Negative
Overflow
Zero
Carry
what does the carry flag let us know
that the register does not store the actual answer as it was too big to be stored
how do we tell the processor to update the condition code flags
using s-bit. eg. ADDS, MOVS,
If s bit is set to 0 what does this mean
the condition code fags did not need to be set (false)
If s bit is set to 1 what does this mean
the condition code fags needed to be set (true)
how does the processor remember the results of the compare instruction
by updating the condition code flags
example of everyday modulo arithmetic
12 hour clock
modulo arithmetic used in binary
twos complement
how does twos complement work
the second half of the binary pattern is used again to represent minus numbers. Which way we see it should be from our interpretation of the numbers as the computer doesn’t know whether we are choosing a signed or unsigned interpretation
if the interpretation is negative, what is the most significant bit
1
if the interpretation is positive, what is the most significant bit
0
how to represent a minus number
- get positive version in binary
- invert
- add 1