I am actually new to embedded systems. I have a question on determining the minimum register size to store a particular value. Here is the question:
Sounds like this exercise is to get you to understand where the sign bit is in a signed number or where the sign bits are since they sign extend forever. A positive number will have an infinite number of 0s and a negative an infinite number of 1s. so long as you have at least one you can represent that number so your first one is 1111....1110001 the sign bit starts on bit 4 so it only takes a 5 bit register minimum to hold that number. Your second example 0b010010110111 we have to assume the msbit there sign extends and in that case bit 11 indicates sign so you at minimum need a 12 bit register. Now if your processor does not have a 5 bit then whatever the next size up is the minimum (8?). And if your processor does not have a 12 bit register then the next size up is 16.
User contributions licensed under CC BY-SA 3.0