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
1
vote
0 answers

Is there a way to get the $n$-th of bits of $2^k$

I have a large number $N=O(2^k)$. For simplicity, let's say that $N=n^k$. However, I only need the $n$-th bits of $N$, say for example the 10-th to 16-th bit of N... without calculating the full expansion... Is there a simple way to get these? A…
user13675
  • 197
1
vote
1 answer

Binary variable syntax?

Is there a more compact styntax to represent binary variables, such as: $3a+2b+c=5$ where $a,b,c$ are either "0" or "1" ? I've tried setting domains, ($a\le1$ and $a\ge 0$, etc) but that only works for a couple variables then it doesn't seem to pick…
C05
  • 11
1
vote
1 answer

Decimal to Binary

I am struggling to understand Decimal to Binary using the following method, given on the second last page of http://www.ling.ohio-state.edu/~scott/teaching/2008/spring/384/handouts/decimal-binary.pdf. Could someone give some maths behind this. I…
dgamma3
1
vote
2 answers

Binary Numbers system for Programming

So, the maximum number 1 byte (8 bits) can have is 255, so does that mean 255 combinations of 0 & 1 in the 8 places?
1
vote
1 answer

Range two's complement

The most used formula's to calculate the range of numbers in a two's complement system are + $2^{n-1}-1$ for the highest number and $-2^{n-1}$ for the lowest number. The problem is that this only works in a binary system. Does the following formula…
user94342
1
vote
0 answers

Finding two' s complement of a fractional binary number

I want to find out 2's complement of binary number (00101101.1100) To find the 2's complement of a binary number, invert all bits (change 0s to 1s and 1s to 0s) and then add 1 to the result. For the given binary number (00101101.1100) Invert all…
Dinesh Katoch
  • 221
  • 1
  • 8
1
vote
1 answer

Binary expansions of $\frac{1}{2}$

I was reading Elements of Set Theory by Herbert B. Enderton, and I saw there is written: $$0.1000...=0.0111...=\frac{1}{2}$$ I don't understand how $0.0111...$ is a binary expansion of $\frac{1}{2}$. I'm giving you the text of the book to see if I'm…
user1126760
1
vote
1 answer

How to prove that binary representation of number always has more digits than base 10 representation?

I understand the idea intuitively that because the number of options for each digit is more "granular" for base $2$, we need more digits to represent the same number as opposed to base $10$. How can I express this idea (or another proof) in…
Neel Sandell
  • 306
  • 1
  • 10
1
vote
1 answer

Finding the minimum index of the digit which is not 0 in positional representation

Assume we have a number $ x $ in the following representation: $$ x=\left(x_{n-1},...,x_{0}\right)=\sum_{i=0}^{n-1}x_{i}2^{i} $$ Each $x_i $ can be either $0 $ or $ 1 $. (Familier to the binary represantaion, but with finite constant number of…
FreeZe
  • 3,735
1
vote
2 answers

determining the number of bits required to represent a number in binary

In the example in the following slide, we follow the highlighted formula. With regard to the highlight, I'm confused why the number is greater or equal to $2^{n-1}$, while only need to be less than $2^n$ (not less than or equal to $2^n$)?
Claire
  • 431
1
vote
1 answer

Is there a rule or equation to convert decimal to binary without recursion

Every solution I’ve seen is always some method you have to repeat or iterate. But is there some equation I could just plug any number into and get the binary value. For context, I’m trying to do this using the material nodes system in the blender 3D…
1
vote
1 answer

Defining $y^2$ in sums of $2^x$

Is there an expression which defines $y^2$ with $y \in \mathbb{N}$ into as little as possible sums of $2^x$ where $x \in \mathbb{N}_0$? i.e. $1^2 = 2^0$ $2^2 = 4 = 2^2$ $3^2 = 9 = 2^3 + 2^0$ $4^2 = 16 = 2^4$ $5^2 = 25 = 2^4 + 2^3 + 2^0$ $6^2 = 36 =…
1
vote
1 answer

Is there a formula for finding binary numbers in a binary string?

One bit Let's suppose that I have a short binary string: 01. This string contains the binary digits 0 and 1 representing the numbers from zero to one. So, a string 2 digits long is required to represent 2 values (1 bit). Two bits That wasn't very…
1
vote
1 answer

Binary translation zero issue

i'm a student and for this semester i have to deal with binary translation. I use multiple online tools for such conversion. My question is, The binary to text conversion for "A" is: 01000001 but as per the book "1000001" is correct answer for…
1
vote
0 answers

Binary division non restoring method

I have no idea how this works, at -7 it is shifted to get -14 then the 1 is brought down to give -13 Why exactrly do you keep adding the divisor? Source: https://userpages.umbc.edu/~squire/cs411_l10.html