Questions tagged [binary]

Questions related with (base 2) representation of numbers and their unique properties arising out of number representation.

Binary (base $2$) represents numbers using only the digits $0$ and $1$.

We write:

$$n=\sum\limits_{k=n}^0 a_k2^k$$

to represent a nonnegative integer, so for example $27_{10}=16+8+2+1=11011_2$

To represent nonnegative real numbers, we use:

$$n=\sum\limits_{k=n}^{-m} a_k2^k$$

where $m$ can be $\infty$. So, for example $11.001_2=3.125_{10}$.

1703 questions
3
votes
2 answers

Longest sequence of 1s in binary representation of a number & Average Sequence length for number with N digits

I originally posted this to rec.puzzles in October 1992. I subsequently solved the problem (at least I think I did...) and published an article about it in early 1993. The article is nowhere to be found and my brain has aged significantly, so if any…
3
votes
1 answer

Is a given integer's binary representation ever shorter than its decimal?

In particular, once you get into large numbers, does any given number's binary representation ever become a shorter string of digits than the decimal representation of the same number?
3
votes
4 answers

Simple binary subtraction

$$101110 - 110111$$ Did the 2's complment and cannot get to the answer. The answer is apparently $$-1001$$ I did 2's complment on the $$110111$$ and performed addition but did not get to the answer. But I heard that I have to "zero-fill" before i…
Aaron
  • 551
3
votes
2 answers

Twos complement notation question?

I have a quick question how do you do the two complement system, For example say I have in two complement a $6$ which is $0110$ and $3$ which is $0011$ and I want to add $6+(-3)$ I know what five is in binary but how do I find $-3$ is so that I can…
Fernando Martinez
  • 6,698
  • 19
  • 74
  • 108
3
votes
2 answers

Representation of powers of three in binary.

Do powers of $3$ have a simple representation in binary ? I fail to spot an obvious pattern or anything else. The only thing I can think of is using the binomial theorem $$3^n = (1+2)^n = \sum_{k=0}^n {{n}\choose{k}}2^k 1^{n-k} = \sum_{k=0}^n…
Digitalis
  • 797
3
votes
4 answers

Why the remainders of the division of a number by 2 results in the number in binary?

For example 14, if you divide be 2 it equals 7 and the remainder = 0, then 7/2 = 3 with r = 1 then 3/2 = 1 and r = 1 then 1/2 = 0 with r = 1. If we take the r's and put them togheter 1110 is 14 in binary. I don't understand the intuition behind…
Alexandra
  • 319
  • 1
  • 8
3
votes
1 answer

10 bit 2's complement of positive numbers

When doing this for a negative number, like -213 for example, I successfully found the answer by doing $(2^9 + -327)$ => $(2^9 - 213)$ taking the result of that, and using the division by 2 method, adding on leading zeros to make it ten bits, the…
windy401
  • 1,211
3
votes
2 answers

How to subtract BCD numbers?

For example: $1001 0011 - 0101 0110$ I am unsure what to do. Is there some correction factor just like with BCD addition?
m34diz
  • 83
3
votes
5 answers

Finding the least exponent in writing a power of 2015 in binary

Written in binary, 2015 looks like $11111011111_2$ Find the smallest exponent $n > 0$ (if it exists) such that $2015^n$ ends in . . . $1111111111_2$ (ten ones) when written in binary.
Randin
  • 802
3
votes
3 answers

Odd and even numbers in binary system

Actually here is a basic question, but i have a little problem about it. In binary system, for any number such as 1011001, can we say directly "it is end with 1, so it is an odd number"?, or firstly should we convert it to decimal form, then look…
fillhora
  • 119
3
votes
1 answer

What are the three different ways negative numbers can be represented in Binary?

I am new to Binary and we are learning it for my computer hardware class. Since I am just learning, I am not very sure how to represent negative numbers in binary. I believe they are Signed magnitude, ones complement, and two's complement, but I…
3
votes
4 answers

How would I convert a long decimal to binary without using a calculator?

I am aware that you can keep dividing a decimal number by two, finding the remainders in the process, in order to convert the number to binary. However, when I am working with a long decimal number such as 2147483647, is there any easier way of…
x3nr0s
  • 145
2
votes
3 answers

Representing a binary number

Suppose you wanted to write the number 100000. If you type it in ASCII, this would take 6 characters (which is 6 bytes). However, if you represent it as unsigned binary, you can write it out using 4 bytes. (from…
James
  • 23
2
votes
1 answer

Convert from two's complement into unsigned number

There is an 8-bit numerical value, where a negative number is represented in two’s complement. When this value is represented in decimal, it becomes -100. When this value is regarded as an unsigned number, which of the following is the…
f855a864
  • 301
2
votes
1 answer

Computing $ 001001_2 - 110101_2$ (base $2$), and representing the result in signed magnitude format

I've been asked (for homework) to do $ 001001_2 - 110101_2$ (base 2) and to represent the answer in a signed magnitude format. EDIT: I'm specifically asked: Perform subtraction on the given unsigned binary numbers using the 2’s complement of the…
1
2
3
16 17