Question about representation of numbers in different bases

In summary, the conversation discussed expanding the numerical value of a real number in different bases and how to evaluate the binary expansion of negative numbers. It also touched on the concept of addition in a given representation and the use of 2's complement for representing negative numbers in computers.
  • #1
Arian.D
101
0
I'm thinking of expanding the numerical value of a real number in different bases. I want you guys to ensure some things for me so I know I'm not wrong.

If X is the representation of a in the base B and Y is the representation of b in the same base(radix), can we say that X+Y = a+b?

In particular I wonder if I can evalute the binary expansion of -4.125 in the following way:
First I write -4.125 = -5 + 0.875, then I find the binary expansion of -5, to do that first I see that 5 = (101)2 and then I add the minus sign to it. Right?
Now I find the binary expansion of 0.875, which is easy because I have an algorithm that gives me the binary expansion of any positive real number less than one.

All I have said is easily generalized to other bases. But the question is, how should I expand negative numbers in a bases? How do I expand -4.625 in base-10 for example?
I'm confused.
 
Mathematics news on Phys.org
  • #2
I'm not sure why you would think you'd need to "expand" -4.625 in base 10. It's...already written in base 10. -4 - 6/10 - 2/100 - 5/1000. That's what decimals mean.

Similarly, you could take -4.125 and just recursively divide it by 2, keeping track of how many times you've done so, until you get a number smaller in magnitude than 1. Take that result, shunt it into your algorithm that finds the binary expansion of any number less than 1, tack on the minus sign if needed and a 0 on the end for each time you had to divide by 2. This repeated dividing by 2 just moved the "decimal point" (but remember, it's still binary) of the number until you got something smaller than 1.
 
  • #3
Arian.D said:
If X is the representation of a in the base B and Y is the representation of b in the same base(radix), can we say that X+Y = a+b?
Addition of numbers in a given representation is defined to be the mechanical procedure that gives the right result, so by definition, yes.
But the question is, how should I expand negative numbers in a bases? How do I expand -4.625 in base-10 for example?
Representation of negative numbers can be done with a minus sign in any base.
There are other possible representations. Computers mostly use "2's complement". If you wanted to get really confused you could adopt this in written form e.g. by defining that the leading digit is negative, the rest positive. -4.625 would be written 5.375 (-5 + 0.375). All positive numbers would be written with a leading zero (as in "2's complement"). Addition would proceed thus: 5.375 + 0.813 = 4.188.
 

1. How does the base of a number affect its representation?

The base of a number determines the number of digits used to represent it. For example, a base 10 number will use 10 digits (0-9) while a base 2 number will only use 2 digits (0 and 1).

2. What is the significance of the position of digits in a number with different bases?

In a number with a base greater than 10, the position of each digit represents a different power of the base. For example, in base 2, the first digit represents the ones place, the second digit represents the twos place, the third digit represents the fours place, and so on. This allows for larger numbers to be represented with fewer digits.

3. Can any number be represented in different bases?

Yes, any number can be represented in different bases. However, the number may have a different value depending on the base used to represent it. For example, the number 10 in base 10 is equal to the number 2 in base 2.

4. How can converting numbers to different bases be useful?

Converting numbers to different bases can be useful in computer programming and data storage. For example, binary (base 2) is commonly used in computers to represent data, while hexadecimal (base 16) is often used to represent colors. It can also be useful in understanding number systems and mathematical concepts.

5. Are there any other number systems besides decimal and binary?

Yes, there are many other number systems, including octal (base 8), hexadecimal (base 16), and even more complex systems like base 60 (used in time measurement) and base 12 (used in measuring units). There is no limit to the possible number systems that can be created.

Similar threads

Replies
1
Views
1K
  • Computing and Technology
Replies
4
Views
741
Replies
13
Views
1K
  • Programming and Computer Science
Replies
17
Views
1K
Replies
4
Views
904
  • General Math
Replies
7
Views
1K
Replies
27
Views
895
  • Linear and Abstract Algebra
Replies
9
Views
539
Replies
1
Views
1K
Replies
2
Views
2K
Back
Top