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
0
votes
1 answer

Binary String Combinations

For this question, imagine finite binary strings consisting of $0$ and $1$. For instance, $00111$ is a string. Order does not matter, so the string $1100$ is considered equivalent to $0011$. We will therefore always write $0$s before writing…
6ix9ine
  • 13
0
votes
2 answers

Why is $-13$ represented as $11110011$ in binary?

Why is $-13$ represented as $11110011$ in binary? What's the logic behind this?
Cognoscenti
  • 139
  • 6
0
votes
0 answers

Why does binary subtraction work?

I am unable to figure out why $1010 - 1000 = 0010$ in binary is equivalent to $10-8=2$ in decimal? Why does subtraction work in binary just like in decimals?
Cognoscenti
  • 139
  • 6
0
votes
2 answers

Finding 32 bits value with binary multiplication

I currently am studying 32 bits conversions at shcool. I am a bit at a loss, tho, as to why I should either move a floating point when I am done with converting everything to 32 bits. In: 21.5 * 12.75 The answer, in base ten is: 274.125 The answer…
Erzats
  • 3
  • 1
0
votes
1 answer

Add Two's Complement Binary 1011 1110 1011 0011 + 0110 1000 1110 and convert to base-16

I am getting the wrong answer for this practice exercise in my Computer Architecture course. It says, "perform the following arithmatic operations assuming the values are 16-bit two's complement. Give answers in hexadecimal. $$ 1011\ 1110\ 1011\…
0
votes
1 answer

Converting -9811 to Two's Complement.

I have been trying to convert -9811 to two's complement. I am getting the wrong answer for some reason, and I am not sure why. $$ 9811 \div 2 \to R1 $$ $$ 4905 \div 2 \to R1 $$ $$ 2452 \div 2 \to R0 $$ $$ 1226 \div 2 \to R0 $$ $$ 613 \div 2 \to…
0
votes
1 answer

if I have $n$-bit binary number $x$, if add 1 at its $m$-bit ($m>n$), how would the counterpart base-10 number change?

If $x$ (base-10) is an $n$-bits number in binary, such as $(x)_{10}=\underbrace{11\cdots 1}_{n\text{}}$, if I add $1$ in $m$-bit position, it becomes $(y)_{10}=\underbrace{10\cdots0011\cdots 1}_{m\text{}}$. What is the formula relating $y$ and $x$?
brushmonk
  • 144
0
votes
1 answer

Is this method of converting a integer to Gray code correct?

My method for converting an integer to Gray code (binary) uses successive divisions by powers of $2$ and looks at the parity of the rounded quotient. Example $29/2 = 14.5 \approx 15 \Rightarrow 1$ $29/4 = 7.25 \approx 7 \Rightarrow 1$ $29/8 = 3.625…
0
votes
1 answer

Converting base 2 to Base 10?

How is $0.11 \cdot 2^{1}$ converted to $1.5$ in base 10? I am unable to understand the theory behind this, since I believe $0.11 * 2^{1}$ corresponds to $1.1$ but I dont see the conversion process?
0
votes
3 answers

8 bit binary number $01101110$ is on a computer using two’s complement representation. What should it be in decimal?

8 bit binary number $01101110$ is on a computer using two’s complement representation. What should it be in decimal? My solution is: reverse it to $10010001$ $10010001+1 = 10010010$ $10010010$ to decimal is $146$ answer is $-146$ but this seems…
0
votes
2 answers

Binary multiplication 1111 x 1111?

I am confuse that how carry works while multiplying two binary numbers 1111 x 1111 = 011100001 but how to handle carries in calculation? Can anyone please explain? I know how to handle partial sum method when there are three 1s to be added while…
Ubi.B
  • 340
0
votes
1 answer

3.1 x 10^-9 in 4-bit sign-magnititude representation problem possible?

I'm puzzled with this math question below and would like the help of others, the only answer I can imagine to this question is that the above number will need more than 4 bits to be expressed in binary but I don't know the name for that, also in to…
0
votes
1 answer

Question related to Single-precision floating-point format

What number does the following word stand for? $$\color{red}{1}\;\;\;\;\color{blue}{10000101}\;\;\;\;11110010011110100000000$$ Where the red one is the sign (it's called the sign bit which determines the sign of the number), the blue binary…
user771003
0
votes
0 answers

BINARY MULTIPLICATION ALGORITHM PROOF

So there is a multiplication trick It says 9×13 say Half and double everything 4.5×26 Cancel out the .5 4×26 2×52 1×104 Cancel out the even left hindsight multipliers and add the left right hand numbers So 9×13= 104+13 = 117 I know how this…
Naman
  • 1
0
votes
0 answers

How can I calculate fast how many times a number needs to be divided by 2 to get its binary form?

If I wanted to know how many times the number x needs to be divided by 2 to get its binary form, is there a formula to calculate it? I can't find one.