MHB Computer system : Clarification needed

  • Thread starter Thread starter mathmari
  • Start date Start date
  • Tags Tags
    Computer System
Click For Summary
SUMMARY

The discussion centers on understanding how data is stored in computer memory using different endian formats. Specifically, it explains big-endian and little-endian storage methods, with examples involving 64-bit integers, 32-bit integers, fixed-point numbers, and floating-point numbers according to the IEEE 754 standard. Key calculations are provided to illustrate how to interpret byte sequences in both formats, emphasizing the significance of byte order in data representation.

PREREQUISITES
  • Understanding of big-endian and little-endian data storage
  • Familiarity with hexadecimal and binary number systems
  • Knowledge of IEEE 754 floating-point representation
  • Basic arithmetic operations involving powers of 2 and 256
NEXT STEPS
  • Study the differences between big-endian and little-endian formats in detail
  • Learn how to convert hexadecimal numbers to binary and decimal
  • Explore the IEEE 754 standard for floating-point arithmetic
  • Practice calculating integer values from byte sequences in both endian formats
USEFUL FOR

Computer science students, software developers, and systems programmers who need to understand data representation and memory management in computer systems.

  • #31
Klaas van Aarsen said:
We found the exponent 100111001101111, which is a 2's complement number.
Since the first bit is 1, it is negative.
We take the complement and add 1 to make it positive.
That is 011000110010000+1=011000110010001.
Now we can find the number as usual, after which we need to put a $-$ sign in front of it. 🤔

So do we have the following ? First we write all digits again next to each other :

01001110 01101111 01101001 01110100 01000001 01100011 01100001 01010110

The first digit is the sign, so 0.

The following 15 digits represent the exponent, 100111001101111, which is a 2's complement number.

Since the first bit is 1, it is negative.

We take the complement and add 1 to make it positive.

That is 011000110010000+1=011000110010001, which corresponds to $12689$, so the exponent is $-12689$, right?

So is the actual exponent is $20079-(-12689)=32768$.

Then we get the fraction, which starts with 0110.

So the fraction is $0\cdot 2^{-1} + 1\cdot 2^{-2} + 1\cdot 2^{-3} + 0\cdot 2^{-4} +\ldots \approx 0.375$

So the number is approximately $+1.375\cdot 2^{32768}$. :unsure:
 
Technology news on Phys.org
  • #32
mathmari said:
We take the complement and add 1 to make it positive.

That is 011000110010000+1=011000110010001, which corresponds to $12689$, so the exponent is $-12689$, right?
So is the actual exponent is $20079-(-12689)=32768$.

So the number is approximately $+1.375\cdot 2^{32768}$.
The exponent is $-12689$ instead.
We could also have calculated it by subtracting $32768$ from the $20079$ you found.
Note that $32768$ is $1000000000000000$ in binary, which is 16 bits. 🤔

So the number is approximately $+1.375\cdot 2^{-12689}$. 🤔
 
  • #33
Klaas van Aarsen said:
The exponent is $-12689$ instead.
We could also have calculated it by subtracting $32768$ from the $20079$ you found.
Note that $32768$ is $1000000000000000$ in binary, which is 16 bits. 🤔

So the number is approximately $+1.375\cdot 2^{-12689}$. 🤔

Ahh ok! I think I understood that now! Thank you very much! (Sun)
 

Similar threads

  • · Replies 30 ·
2
Replies
30
Views
6K
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 3 ·
Replies
3
Views
8K
  • · Replies 23 ·
Replies
23
Views
5K
  • · Replies 7 ·
Replies
7
Views
4K
Replies
10
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K