Computer system : Clarification needed

  • Context: MHB 
  • Thread starter Thread starter mathmari
  • Start date Start date
  • Tags Tags
    Computer System
Click For Summary

Discussion Overview

The discussion revolves around understanding how different data types are represented in memory, specifically focusing on byte addressing in computer systems. Participants explore various representations including integers, fixed-point numbers, floating-point numbers, and ASCII strings, while considering big-endian and little-endian formats.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • Some participants seek clarification on how to interpret the exercise statement regarding memory addressing by bytes.
  • One participant explains that a 64-bit integer in big-endian format is calculated using the formula $n_0\cdot 256^7 + n_1\cdot 256^6+\ldots+n_7\cdot 256^0$.
  • Another participant questions how to derive the number 256 in the context of 8-bit integers, leading to a discussion about the range of 8-bit numbers.
  • There is a proposal that for two consecutive 32-bit integers in little-endian format, the calculation should be $n_0 \cdot 256^0 + n_1 \cdot 256^1 + n_2 \cdot 256^2 + n_3\cdot 256^3$.
  • Participants discuss the representation of a fixed-point number with 24 integers and 40 fractional digits, questioning how to express it in little-endian format.
  • One participant notes that the IEEE 754 standard for floating-point representation has a specific layout involving a sign bit, exponent, and mantissa.

Areas of Agreement / Disagreement

Participants express uncertainty regarding the calculations for different data types and how to apply the endian formats correctly. There is no clear consensus on some of the mathematical representations, particularly for fixed-point numbers and the IEEE 754 standard.

Contextual Notes

Some participants are unclear about the assumptions underlying the calculations, particularly regarding the significance of byte ordering and the representation of fractional parts in fixed-point numbers. There are also unresolved questions about the specific formats for floating-point numbers according to IEEE 754.

  • #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
7K
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · 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