electroRF
Member
Hi,
I'm wondering about the following question:
assume W,X,Y,Z are 8-bit registers.
Given the following expression:
how many bits are needed to prevent overflow?
I'm wondering what would be a 'neat' way to solve it?
* it isn't mentioned in the question, but I assumed the registers are signed 8-bit numbers, because I think that gives the maximum number of bits required to avoid overflow.
I'm wondering about the following question:
assume W,X,Y,Z are 8-bit registers.
Given the following expression:
C:
(((W-X)>>3) + Y-Z+4)<<2
how many bits are needed to prevent overflow?
I'm wondering what would be a 'neat' way to solve it?
* it isn't mentioned in the question, but I assumed the registers are signed 8-bit numbers, because I think that gives the maximum number of bits required to avoid overflow.
Last edited: