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

2's complement representations of decimal and hexadecimal values

Given the following signed integer values, write their corresponding 16-bit 2's complement representations and decimal/hexadecimal values. So I'm given the hexadecimal number E0B7, converting that to binary gives me 1110 0000 1011 0111. Not sure if…
0
votes
1 answer

Faster significant prefix comparison in binary representation

An "integer prefix" here is the first non-zero digits of a representation... Suppose first two digits: Same decimal prefix 45: $(4512)_{10}$ and $(0045)_{10}$ Same binary prefix 101: $(000101)_{2}$ and $(010101)_{2}$ So, for the second example,…
Peter Krauss
  • 163
  • 8
0
votes
0 answers

hex to decimal conversion error/ missing step?

I'm trying to convert hex 8B to decimal. Though I keep getting wrong decimal? I used this https://www.youtube.com/watch?v=t_kA5KQxByc as a guide. I see that the soln is 139. 8B 8421 | 8421 1000 | 1011 128 64 32 16 8 4 2 1 1 0 0 0 1 0 1 1 Adding, I…
0
votes
2 answers

Shopkeeper sells half of his chocolates to each customer, giving him extra half if the number is odd

A shopkeeper has a carton of chocolates with him initially (the number of chocolates is not known to him). Each of the chocolate was priced at 18 rupees . If the shopkeeper has even number of chocolates he sells exactly half of the chocolates he has…
acigard
  • 13
0
votes
2 answers

How is this binary subtraction done?

How is the binary subtraction done in the photo attached? I know there are several ways to compute it, but I'm specifically asking for the way my professor did it in that photo.
kanayt
  • 103
0
votes
1 answer

Find two binary numbers with a multiplication of a specific form

Not sure if this is the best place to ask this question but I tried to search online, wasn't able to find anything useful. Consider binary numbers of the form $$x=0|y|0|y$$ where $a|b$ means concatenate the bits of $a$ with the bits of $b$, $y$ is…
0
votes
1 answer

Binary system $2^n$ gives 1 less available digit than expected

I was reading the Wikipedia page on counting in binary and came across this statement that I don't quite understand: In the binary system, each digit represents an increasing power of 2, with the rightmost digit representing 2$^0$, the next…
Attila
  • 123
0
votes
1 answer

Given a 8-bit processor, calculate 70 - 30 in binary and indicate if there is carry-out and overflow

I did the following exercise but even though I've revised my calculations several times, I don't seem to come up with the right answer: Given a 8-bit processor and the variables $a=30$ and $b=70$, calculate $b-a$ in 2's complement. Indicate if…
Arnau
  • 341
0
votes
0 answers

Equivalence between binary and decimal precisions

We have binary number with fixed precision(e.g. after comma 7 binary digits). How to find the minimum number of decimal significant digits after period sufficient for obtaining equivalent precision? e.g. 11.1001001; equivalent decimal precision ?…
0
votes
1 answer

Is this an overflow?

Perform the indicated operation of the numbers, which are in two's-complement representation. Check your results by converting all numbers to decimal. Indicate overflow and carryout. (a) 10010111-00111100 1001 0111 (151) - 0011 1100 (60) ---->+…
0
votes
1 answer

How does a two's complement number overflow?

The problem is to convert $32$ to $6$-bit two's complement or note that the range would overflow. For $32$, I have: $100000$. How does this overflow? Is it because the 1 means negative, so it would be $0100000$ but the space cannot accommodate…
0
votes
3 answers

Converting numbers to different bases

I am converting numbers between different bases without issues, but I'm struggling to understand the why the method I'm using works. If I convert $A5$ (base 16) to base 8, I would do the following: Turn $A5$ into binary (4 bits) $A = 1010$ $5 =…
Shannon
  • 111
0
votes
1 answer

negative binary subtraction using 2's complement (and 5 bit representation)

I'm wanting to carry out the calculation of 8 - 11 (assuming that 5 bits represents a number and also using 2s complement representation), however, I can't seem to get the correct answer. This is what I have so far; 8 in binary is 01000. 11 in…
0
votes
1 answer

Converting Decimal to Other Bases Reverse Remainder Collection

The question is why is it that when we convert base 10 to other bases -- base 2, in particular -- we repeatedly divide the number by the new base while keeping track of the remainders and then collect the remainders in the REVERSE order. It appears…
0
votes
2 answers

Number of distinct numbers that can be obtained

I am looking for the number of distinct numbers that can be obtained by OR operation on any subset of $\{L, L+1, L+2,...,R\}$. Note that we OR operation on a subset of size $1$ is the element itself.
maverick
  • 1,319