MHB Solving 0x10 + 0xfe: What's the Answer?

  • Thread starter Thread starter Amathproblem22
  • Start date Start date
AI Thread Summary
In this discussion, the focus is on performing arithmetic with 8-bit unsigned values in hexadecimal format. The initial question involves calculating the sum of 0x10 and 0xFE. The correct answer is identified as 0x0E, which equals decimal 14. The conversation clarifies that hexadecimal numbers use the prefix 0x and operate in base 16, where values range from 0 to 255 for 8-bit unsigned integers. The concept of overflow is emphasized, explaining that when the sum exceeds the maximum value of 255, it wraps around rather than resetting to zero. Examples are provided to illustrate how calculations differ between 8-bit and 16-bit systems, highlighting the importance of understanding overflow in hexadecimal arithmetic.
Amathproblem22
Messages
12
Reaction score
0
Question: With 8-bit unsigned values, 0x10 + 0xfe =
Answer: 0x0e, which is decimal 14.What I know;
The prefix 0x is used in code to indicate that the number is being written in hex. Base 16.
I also am aware that with 8-bit unsigned values it goes from a range of 0 to 255.

Need help with:
Is this working? 10+f = (10+15, the base system is 16 so this is bigger so resets?) 0?
0+e(14)=14, meaning 0x0e I have probably done the working wrong so that's why I need help. Thanks.
 
Technology news on Phys.org
Hint: if you use 16bit -
1) 0x10 + 0xfe = 0x10e
2) 0x20 + 0xfe = 0x11e
And in 8 bit:
1) 0x10 + 0xfe = 0x0e
2) 0x20 + 0xfe = 0x1e
So it is more about overflow than reset.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top