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 division and remainder

Q=A/B , Q is a real number expressed as a pair of 8 bits: most significant 8 bits for the integer part least significant 8 bits for the fractional part the number is unsigned for example: 0 0 1 0 1 1 0 1 . 0 1 0 1 0 0 0 0 Can you find the…
Cristi
  • 271
0
votes
1 answer

Add Hexadecimal that is in 2's complement.

Perform the following additions. The corresponding 16-bit binary numbers are in 2's complement notation. Provide your answers in hexadecimal. I'm not sure about this one, am I doing the 2's complement conversion correctly? x7D96 + x7412 0111 1011…
KKendall
  • 869
0
votes
1 answer

What is the significance of the last two digits of a 2's complement number being 00?

What is the significance of the last two digits of a 2's complement number being 00? The first part of this question is what is the significance of the last digit being 0? I said that the digit will be an even number. I don't know what the…
KKendall
  • 869
0
votes
1 answer

Write the 6-bit 2's complement representation of -32.

Write the 6-bit 2's complement representation of -32. I think the answer is supposed to be something like "overflow" or some error. Because 32 in binary would be 10 0000, right? And $-32$ would be 110 0000 with 7 bits. How can I show this…
KKendall
  • 869
0
votes
0 answers

How one can calculate $s_2(p)$

Let us define the integer $p$ as follow: $$p= \sum_{i=1}^{m}(2^{k+2})^{i}-r2^{k+2}-2w+1+3a$$ How one can calculate $s_2(p)$ the sum of binary digits of $p$. Here all the arguments are integers.
Safwane
  • 3,840
0
votes
2 answers

Number of ones to the left of every zero in binary representation

I am seeking the computationally fastest way to determine the total number of ones to the left of every zero in the binary representation of a number. That is: for every zero, count the number of ones that are to the left of it, and then total the…
Mr.Wizard
  • 802
0
votes
2 answers

Proof of (B != C) => (A XOR B) != (A XOR C)

I have a conjecture: If $B \neq C$, then $$ A\ \text{XOR}\ B \neq A\ \text{XOR}\ C $$ Is it true? If so, how to prove it? What I tried: I think I have proven the contrapositive qualitatively by writing a binary representation of $A$. Let $a_i, b_i,…
ynn
  • 314
0
votes
1 answer

Proving result about 2's complement numbers.

In a book I am reading about computer science I have this result about two complements numbers: Assume that $a$ and $b$ are two N-bit 2's complement numbers. Then $a
user394334
  • 1,230
0
votes
2 answers

Converting binary to hexadecimal and octal

I’ve noticed a grouping method when converting from binary to hexadecimal and binary to octal. When converting from binary to octal, my math book says to group the binary numbers into groups of three, starting from the right. Also, it says to pad…
0
votes
1 answer

Simplifying the Boolean binary equation

A'B + A'B'C + ABC'C' + AB' + AB'C' I need to simplify this boolean equation in simplest form but im not sure of my answer.
David
  • 1
0
votes
3 answers

Powers of 3 in binary - how can you prove this evidency?

Prove that the number of 1s in the powers of 3 binary representation is (on the whole) increasing. $3^0=1_2$ (number of 1s=1), $3^1=11_2$ (number of 1s=2), $3^2=1001_2$ (number of 1s=2), $3^3=11011_2$ (number of…
0
votes
0 answers

Mathematically calculate Bit Rotation

I am trying to calculate a cyclic bit rotation mathematically, but I am trying to avoid the use of mod operators, is there a way to do this, This is what I have written so far maxbits = 8 shift = lambda integer, s : int((integer / (2**s)) -…
0
votes
1 answer

How to simplify this expression with XOR in it?

I need to find the answer of this kind of expression $a_1 + a_2 + a_3 + (a_1\oplus a_2) + (a_2\oplus a_3) + (a_1\oplus a_3) + (a_1\oplus a_2\oplus a_3) $. After observing I found this pattern in above expression $ X + (X \oplus Y)$. But I don't know…
0
votes
1 answer

Smallest number that can be stored in a 32 bit fixed point system assuming the radix point is in the middle?

What is the smallest number that can be stored in a 32 bit fixed point system of representation if the radix point is assumed to be in the middle? My guess would be that 0000000000000000.0000000000000001$_2$ is the smallest number that could be…
0
votes
0 answers

Manipulating binary strings

Let's say you have a binary string made up of $0$ and $1$ (e.g. $0011111$). Order does not matter so we can always put $0$s before $1$s. For ease of notation, we will write $0^n$ when we mean exaclty $n$ zeros. For example, $0^41^ 2 = 000011$. Rule…
6ix9ine
  • 13