# Questions tagged [base-conversion]

The tag has no usage guidance.

24 questions
Filter by
Sorted by
Tagged with
51 views

### Converting from m base to n base without arithmetic operations (Where m<n )

I have been working the last 8 years in try to convert from base n to base m without artihmetical operations. My hypothesis is that by the same way that is possible convert bases without division (...
29 views

### Conversion from octal numerical system to binary numerical system

I know that in order to convert a numeral in base-8 to a numeral in base-2 I can write each octal digit as a binary word of 3 bits. I know that 2^3 = 8 that is exactly the dimension of the base of ...
45 views

### An interesting compression algorithm idea

I stumbled on this paper about compressing images using a kind of odd, but interesting idea. It seems pretty easy to implement and I was wondering if there is something wrong with it that I haven't ...
1k views

### Algorithm to convert a fixed-length string to the smallest possible collision-free representation?

I have a US-based telephone number (in the format 000-000-0000) and need to convert it to a "shorter" representation. Using base32/64 produces too long of a string. I've discovered CRC-16, which ...
275 views

### Find n-th number in a number system with only 3 and 4

Given a number system with only 3 and 4. Find the nth number in the number system. There is a solution given here but its very vague without explaining the mathematics/ concept behind it. Can someone ...
92 views

### Time complexity of expanding decimal to new base

There is already a post on this topic on stackoverflow. Nevertheless, I am asking the question here again, primarily because I do not understand the answer given there, and also because I have some ...
75 views

### How to convert between bases partially?

I have some large number $n$ in base $b_1$ and I want to convert it to base $b_2$. $n$ is about a million decimal digits long, therefore it's impractical to convert it as a whole. However I don't need ...
148 views

### Is there an online algorithm for radix conversion?

Suppose I have $P$, which is the base-$p$ representation of an integer $n$ and I want to calculate it base-$q$ representation $Q$. The obvious algorithm is: interpret $P$ to obtain $n$, then ...
56 views

### Shortest decimal expansion within binary interval

Consider an interval $[x-2^n,x+2^n]$ defined by a binary float $x$ and a power of two $2^n$ typically much smaller than $x$. I would like to know whether an efficient algorithm exists to determine the ...
550 views

### Convert a decimal floating-point number into a binary floating-point number

Let's say I have a decimal floating-point number, i.e. a mantissa and precision (negative exponent), both represented as integers. How do I convert this into a binary floating point number (of the ...
122 views

### As a number (base 10) approaches infinity, what would be longer? Represented in BCD or Base-2?

My professor asked this question in his lecture class and I can't figure out the answer. My guess is BCD because you can't use up all the numbers (10 to 15), so you eat up space?
199 views

### How can I convert a binary number to a base-4 number with a Turing Machine?

I'm looking for some guidance to get me going. I assume (and please correct me if I'm wrong) that it'll need 2 tapes and by reading various resources, I found that it might be easier with the binary ...
2k views

### Writing a Turing Machine that convers a number from binary to decimal

I'm trying to write a Turing machine that can convert a number in binary representation to a number in decimal representation. For example if the input on the tape is 1101 the output should be be 13. ...
62 views

### Optimal way for the remainder [closed]

I want to know if for any base the most significant digit is 1 or not. Here is the code: ...
259 views

### Newbie: hexadecimal editors to make sense of binary files [closed]

As a disclaimer, I am a geophysicist, not a computer scientist. I have a binary file with a whole bunch of data in it (it is a large file; 221 MB). I am trying to convert this to something usable but ...
103 views

### Convert non-integer decimal to octal

I follow a course in Computer Architecture and I'm making exercises on number conversions. Now one of the questions asks me to convert 251.5625 to octal and hexdecimal base. No further info is given. ...
13k views

### Algorithm to convert decimal number to binary

I am reading this material to understand the basics of number system. I am stuck at a point in that material where it writes the algorithm to convert a decimal number to binary number. The heading of ...
91 views

### Hex to decimal conversion [closed]

I'm converting hex ( in positional fractions) to decimal question : 0x3c.e8 my attempt: $3*16^1 + 12*16^0$ yields $60$ $3c$ = $60$ in decimal so i know its 60. then $.e8 *10$ (since I want ...
658 views

### Efficient algorithm for conversion of hexadecimal fraction to decimal fraction

Let's say I have some very long hex fraction like this: 0.3F30A21306AEFCBADE3230A593EFAEB395A39E What are some algorithms with an acceptable complexity to ...
294 views

### How to find a basis which is guaranteed to need 9 or less characters to represent a 12 digits number?

I'm trying to map a 12 digit number into a fixed width file. For a number of reasons, it must be compressed in such a way that it is guaranteed to be less than or equal to 9 characters (alpha numeric ...
170 views

### $25_r = 23_{10}$ solve for the base r

first of all this is a homework question and I don't want the solution. I just want a reference to how to solve similar questions like this. I believe it's explained my course textbook, "Computer ...
376 views

### conversion to base-R numbers

I am reading Algorithms 4th edition by Robert Sedgewick and am stumped at a particular problem. On page 460 of the book the author is describing a technique to hash strings and use prime numbers for ...
Here's an old puzzle: Let $s$ be a string of decimal digits ($s[i] \in \{0,\dotsc, 9\}$). Define a function $f(s)$ as follows: Interpret $s$ as a decimal number, $n_{10}$, and convert $n$ to its ...