Questions tagged [number-systems]

Anything related to number systems, i.e. the way of representing numbers (the abstract mathematical entities) as finite sequences of symbols. Usually this tag is relevant on questions involving conversion from the representation in a number system to another (e.g. from decimal to binary).

106 questions
0
votes
1 answer

Decimal to BASE-26 representation

I wrote code to convert a decimal number to a corresponding alphabetical representation. Examples: 1: A 2: B . . . 26: Z 27: AA . . . 703: AAA Here is my approach: void print(int n) { if( n > 0 ) { n--; print( n / 26 ); …
Green goblin
  • 9,898
  • 13
  • 71
  • 100
-1
votes
1 answer

How to calculate range for 16-bit floating-point with 7-bit exponent and 9-bit mantissa?

Compare the range of representable numbers for 16-bit floating-point word with 7-bit exponent and 9-bit mantissa as (i) fraction and (ii) integer. I know how to find range for a 16 bit integer but not sure how to find same for floating point and…
Sumit Rao
  • 1
  • 1
-1
votes
3 answers

Find all possible calculations to get a required number

Is there any function that can take input(arrays of numbers) and find all possible calculations on them that would result in the desired result(number). For example if input is 2, 1, 4, 6, 7 and the desired result is 3. It would return something…
-1
votes
2 answers

how to check Binary point number validation in java?

Examples:- Valid Binary number = 1010111 // true Valid Binary point number = 101011.11 // true Invalid Binary number = 152.35 // false How to check?
Meet Bhavsar
  • 442
  • 6
  • 12
-1
votes
1 answer

C program to display negative numbers through decimal, octal and hexa-decimal values

**Allocation and Storage part of C programming ** I have come with some doubt while trying to print negative numbers through different number system. while printing negative numbers, I am getting different output values.But I am not…
MK Tharma
  • 31
  • 6
-1
votes
1 answer

Hi everyone. I am struggling with converting binary to decimal as an 8 bits number

I have a question. How do I convert 100000000(as a 8 bit number) to decimal . Thanks for helping
-1
votes
2 answers

How to calculate all possible combinations of two alphanumeric characters?

Having an alphabet of letters A-Z and numbers 0-9, how to get all 1296 possible combinations like: ['AA', 'AB', ..., 'AZ', 'A0', 'A1', ..., 'Z9', '0A', '0B', ..., '98', '99'] As a side question, what is this type of number system called?
-1
votes
1 answer

Writing to bl and bh

I am trying to understand the following behavior: mov bl, 51 ; now print $ebx in gdb returns 51 mov bh, 52 ; now it is 13363 but I thought it would be 5251 Why? I use Linux nasm on Intel x86
danielleontiev
  • 869
  • 6
  • 26
-1
votes
4 answers

Add two octal numbers directly without converting to decimal

I'm trying to add two octal numbers by adding the corresponding digits but, I'm stuck when the case is that the sum of digits is greater than 7. I'll have to take a carry and add it to the next addition cycle. I'm unable to find the right expression…
Abhilash Kishore
  • 2,063
  • 2
  • 15
  • 31
-2
votes
2 answers

How to make a hex to octal converter in C

I'm looking to make a hex to octal convert in C, and right now I'm able to convert a string from hex to binary. Now I'm looking to convert it from binary to octal. I believe that this was the simplest way. This is what I have for now. It's a…
-2
votes
1 answer

How many different states can be represented by a three digit binary number? (Give your answer as a decimal number)

I'm studying Network and Operating Systems at the moment and my instructor gave us a quiz. This had me a bit baffled. Any help will be much appreciated. Another one of the questions is this: "How many different states can be represented by a four…
110100100
  • 11
  • 4
-3
votes
1 answer

Convert from hexadecimal integer to decimal java

There are pre-translated numbers from hexadecimal to decimal. For example, 0x01, 0x10 and so on. I need to extract from it everything that is after x, so that I get a number that could fit as an index to the array. The difficulty lies in the fact…
-3
votes
1 answer

parseInt() & radix basics

Can someone please explain what radix is (on the most fundamental level), in reference to parseInt()? I'm also not understanding how the string argument changes with different bases/radix.
-4
votes
1 answer

hexa-decimal to decimal conversion (using implicit type casting)

I think there's some problem in my vs code I am new to this coding stuff even after writing the correct code it gives me wrong results in almost every second code I write i get uncertain results Plz guys help me with this , plz check running this…
-4
votes
2 answers

How to convert a base 10-number to 3-base in net (Special case)

I'm looking for a routine in C# that gives me the following output when putting in numbers: 0 - A 1 - B 2 - C 3 - AA 4 - AB 5 - AC 6 - BA 7 - BB 8 - BC 9 - CA 10 - CB 11 - CC 12 - AAA 13 - etc I'm using letters, so that it's not so confusing with…