Doing binary arithmetic in Windows Calculator and

In summary, two individuals were discussing their observations while converting binary numbers to decimal using a Windows Calculator. They noticed that when multiplying B11111111 and B11111111, the result was B1111111000000001 instead of the expected B1111111111111111. This was explained by the fact that B11111111 is equal to 28-1, and when multiplied by itself, the resulting binary number has 7 leading 1s and 9 trailing 0s. One person also shared a pattern they discovered where integers made up of n digits of 9s have binary representations with exactly n digits of trailing 1s.
  • #1
bitrex
193
0
I was doing some conversions from binary to decimal and vice versa today using Windows Calculator and I noticed the following, if I multiply B11111111 and B11111111 I get the following: B1111111000000001. Uhhh...great! What's going on here? It looks like it's rolling over the 8 LSB when it shouldn't, or something...:confused:
 
Mathematics news on Phys.org
  • #2
No, it's just giving you the right answer, as remarkable as that might seem!

B11111111 is just 28-1= 255. B11111111 times B11111111 is the same as 255(255)= 62025 which, in binary, is B1111111000000001.

In more detail: B11111111 is, as I said, 28-1. B11111111 times B11111111 is (28- 1)(28- 1)= (28)2- 2(28)+ 1= 216- 29+ 1. 216- 29= 29(216- 9-1)= 29(27-1). That "27-1" is the reason for the 7 "1"s leading the number. That 29 is the reason it is followed by 9 "0"s- or would be if it were not for that final "+ 1".
 
  • #3
HallsofIvy said:
In more detail: B11111111 is, as I said, 28-1. B11111111 times B11111111 is (28- 1)(28- 1)= (28)2- 2(28)+ 1= 216- 29+ 1. 216- 29= 29(216- 9-1)= 29(27-1). That "27-1" is the reason for the 7 "1"s leading the number. That 29 is the reason it is followed by 9 "0"s- or would be if it were not for that final "+ 1".

Nice explanation, HallsofIvy. You may be interested in another binary pattern I discovered recently: integers made up of n digits of 9s have binary representations that have exactly n digits of trailing 1s (e.g., 9,999,999 is 100110001001011001111111 in binary). I proved it here: http://www.exploringbinary.com/nines-in-binary/ .
 
  • #4
Thanks for the explanation! After thinking about it, I see the flaw in my reasoning. I was expecting B11111111 * B11111111 to become B1111111111111111, remembering that when doing it out longhand the partial product of the multiplicand is always 1 if it and the multiplier are 1. Since there are no zeros in either of them, I expected the result to have no zeros also. However, I was forgetting about the "placeholder" zeros that accumulate as the partial products are shifted left.
 

Related to Doing binary arithmetic in Windows Calculator and

1. How do I switch the Windows Calculator to binary mode?

To switch to binary mode, click on the "View" menu and then select "Programmer". This will change the calculator to programmer mode, which includes binary functions.

2. Can I perform calculations with both binary and decimal numbers in Windows Calculator?

Yes, you can perform calculations with both binary and decimal numbers in Windows Calculator. However, you will need to switch between the different modes in order to enter and manipulate the numbers accordingly.

3. How do I enter binary numbers in Windows Calculator?

To enter binary numbers, you will need to switch to programmer mode as mentioned in the first question. Then, you can either type in the binary number directly or use the binary buttons (0 and 1) on the calculator's interface to input the number.

4. What operations can I perform on binary numbers in Windows Calculator?

Windows Calculator allows you to perform basic arithmetic operations (addition, subtraction, multiplication, and division) on binary numbers. You can also perform logical operations such as AND, OR, and XOR.

5. Can I convert decimal numbers to binary in Windows Calculator?

Yes, you can convert decimal numbers to binary in Windows Calculator. Simply enter the decimal number in the calculator and then switch to binary mode. The binary equivalent of the decimal number will be displayed. You can also use the "Dec" and "Bin" buttons to convert back and forth between decimal and binary numbers.

Similar threads

Replies
10
Views
3K
Replies
24
Views
2K
  • Computing and Technology
Replies
18
Views
2K
  • Computing and Technology
Replies
12
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
13
Views
3K
  • Sci-Fi Writing and World Building
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Replies
1
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
11
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
Back
Top