Probably simple decimal/binary conversion

  • Thread starter Thread starter mikeg542
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around converting an 8-digit student number into a 24-bit binary equivalent. Participants explore methods for achieving this conversion and address the challenges encountered in fitting the number within the specified bit limit.

Discussion Character

  • Homework-related
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant describes their attempt to convert the student number directly to binary, resulting in a binary string that exceeds 24 bits.
  • Another participant questions the method used for conversion, noting that the binary representation of the student number should fit in 25 bits, suggesting a need for clarification on how to compress it into 24 bits.
  • A third participant points out that the maximum value for an unsigned 24-bit binary integer is 16777215, which is less than the student number, indicating that it cannot be represented in 24 bits.
  • A later reply corrects the binary representation provided earlier, revealing a different binary string but still expresses uncertainty about how to convert the number to fit within the 24-bit constraint.

Areas of Agreement / Disagreement

Participants express disagreement regarding the correct method for converting the number to 24 bits, with no consensus on a solution or approach to resolve the issue.

Contextual Notes

Participants mention various methods for conversion, including direct binary conversion, hex treatment, and scientific notation, but none provide a definitive solution. There is also a lack of course material addressing the specific conversion to 24 bits.

mikeg542
Messages
2
Reaction score
0

Homework Statement


This is a question on a homework assignment, and of course I'm not expecting a direct answer but just a way to figure out how to get what I need to know.

The question is: Take you 8-digit student number (20248462 in this example) and convert this to a 24 bit equivalent binary number string. Make the proper adjustments to make your results 24 bit.

Homework Equations


The Attempt at a Solution


First I just tried a direct changing of the student number to binary and got 111101110010110001110111101110010110001110, which is quite a bit larger than 24 bits. Then I tried treating each number as a hex value, but obviously 8*4 = 32bits. I then thought to do it as scientific notation like a floating point value, but again, we only can do that as 32 bits.

So how do I go about doing this? I'm sure it's something easy and I'm just being stupid.
 
Last edited:
Physics news on Phys.org
mikeg542 said:

Homework Statement


This is a question on a homework assignment, and of course I'm not expecting a direct answer but just a way to figure out how to get what I need to know.

The question is: Take you 8-digit student number (20248462 in this example) and convert this number to a 24 bit equivalent binary number string. Make the proper adjustments to make your results 24 bit.


Homework Equations





The Attempt at a Solution


First I just tried a direct changing of the student number to binary and got 111101110010110001110111101110010110001110
How did you get this number? It's way larger than it should be.The binary representation of 20248462 will fit in 25 bits. I don't know what trick you need to use to squeeze it into 24 bits.
mikeg542 said:
, which is quite a bit larger than 24 bits. Then I tried treating each number as a hex value, but obviously 8*4 = 32bits. I then thought to do it as scientific notation like a floating point value, but again, we only can do that as 32 bits.

So how do I go about doing this? I'm sure it's something easy and I'm just being stupid.
 
The largest number that may be represented with an (unsigned) 24 bit binary integer is 2^24 - 1 = 16777215

20248462 > 16777215

But you didn't do the conversion right anyway.
 
Yeah, I figured that out (having got it as 25 bits earlier). I copied the wrong number from the work I've been doing. It's actually 1001101001111011110001110, but yeah, I looked through all the course material and there is nothing on turning 20248462 into a 24bit binary number.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
Replies
9
Views
2K
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K