The tag has no wiki summary.

learn more… | top users | synonyms

5
votes
1answer
252 views

How does binary addition work?

I find binary confusing. I have watched minecraft redstone videos on binary adders, real binary adders, diagrams, etc and yet I have not learned much at all. How does electrons flowing through wires ...
4
votes
2answers
179 views

Time complexity of base conversion

EDIT As requested, a single question Why can't arbitrary base conversion be done as fast as converting from base $b$ to base $b^k$ ? There is a big time complexity difference, so I am also ...
0
votes
1answer
37 views

Converting from Hex to Signed number

I have the Hexadecimal value 98C2417D. I've converted this into non-signed decimal by multiplying each value with it's corresponding power and added them together. This gave me 2562867581. I'm having ...
0
votes
1answer
48 views

Number of different output labels in Local Binary Pattern

I'm studying about Local Binary Pattern and I'm having trouble understanding the following part about the number of output labels for binary patterns from Computer Vision using Local Binary Patterns, ...
3
votes
1answer
29 views

What circuit depth is required to add?

If we suppose that we are given two numbers $a$ and $b$ to add, what circuit depth do we require to add them? I'm wondering if $a$ and $b$ are $O(n)$, and thus the amount of bits required to store ...
1
vote
1answer
54 views

Subtracting binaries using two's complement

I am trying to subtract these two binary numbers: $ 1110 - 1011$ First I convert 1011 to two's complement by doing 1011 to 0100 and then adding 1 to get 0101. Then I add the first number to the ...
2
votes
1answer
81 views

Known bounds on space complexity of multiplication decision problem

Given three numbers $m$, $n$ and $p$ in interleaved binary encoding1, it's obviously possible to check in $O(1)$ space whether $m+n=p$. It's less obvious2 that it isn't possible to check in $O(1)$ ...
2
votes
1answer
178 views

Can I express 100 as a three-digit 9's complement number?

Reading the Appendix A (Binary numbers) of Structured Computer organization by Tanenbaum I've found this exercise: Signed decimal numbers consisting of $n$ digits can be represented in $n + 1$ ...
6
votes
2answers
77 views

Isn't std::bernoulli_distribution inefficient? Designing a bit-parallel Bernoulli generator

C++11 has a convenient Bernoulli RNG, illustrated at http://en.cppreference.com/w/cpp/numeric/random/bernoulli_distribution . However, distilling an entire random integer into a single random bit ...
4
votes
1answer
71 views

Bitarithmetrics to Base X

I've got the following theoretical problem which puzzles me a bit: I can obtain a string of n bytes (as octets, one byte = one octet = eight bits) of random data. I need to preserve the randomness ...
1
vote
1answer
100 views

Multiplying intervals in Two's complement

I want to perform some interval-operations, and for addition, subtraction, and logic-/shift-operators, that works very well. The only problem I have is the multiplication. An interval $[a, b]$ ...
1
vote
1answer
42 views

Subtracting a two's complement value from another two's complement value

I'm trying to solve the following problem: $$ 6AD3 - AF20 $$ Both of these are hex values in two's complement. I keep getting one answer but it's turning out worng. What I tried to do, was take ...
4
votes
2answers
128 views

Minimizing the full adder - where did this XOR come from?

When minimizing the full adder, I don't understand why $A(\bar{B}\bar{C} + BC)$ reduces to $A\overline{(B\oplus{C})}.$ $(\bar{B}\bar{C} + BC)\to (B\oplus{C})$ is partially decipherable, but why is ...
2
votes
1answer
105 views

Why is binary subtraction referred to as the invert-add-shift-add method?

I'm being asked this question for my computer conceptes class, can't find anything about this in my text book, and have only been able to find half-baked answers googling it. Why is binary ...
1
vote
2answers
257 views

Subtracting an integer from an ASCII number

Theoretically, if I were to subtract the number 10 from the ASCII character 10 (which is really 00110001 00110000), what would I get? Does the computer add both ASCII characters and subtract?
0
votes
2answers
91 views

Which is more computationally efficient: multiplication or 0 padding?

On a PC I am implementing an algorithm in which a number from a look table will be chosen randomly, and will be multiplied by 1000 or 10000. Instead of multiplying by 1000 or 10000 I am thinking of ...
3
votes
1answer
2k views

Normalizing the mantissa in floating point representation

How to represent $0.148 * 2^{14}$ in normalized floating point arithmetic with the format 1 - Sign bit 7 - Exponent in Excess-64 form 8 - Mantissa $(0.148)_{10} ...
8
votes
3answers
342 views

Finding maximum and minimum of consecutive XOR values

Given an integer array (maximum size 50000), I have to find the minimum and maximum $X$ such that $X = a_p \oplus a_{p+1} \oplus \dots \oplus a_q$ for some $p$, $q$ with $p \leq q$. I have tried this ...
0
votes
1answer
140 views

Floating-Point Binary to Decimal

I'm having difficulty with the following question: Given a bit pattern with mantissa $10110000$ and exponent $0111$, what does the bit pattern represent in denary (i.e decimal / base 10)? I ...
12
votes
2answers
150 views

Function that spreads input

I'd like to know if there is a function $f$ from n-bit numbers to n-bit numbers that has the following characteristics: $f$ should be bijective Both $f$ and $f^{-1}$ should be calculable pretty fast ...
3
votes
1answer
92 views

Computing the rank of a multiset after inserting another element

What is the procedure for computing the rank of a multiset after inserting an element? For instance, lets say we have a set $S = (0,1)$ containing $n = 2$ distinct elements. The multiset $M = (1,1)$ ...
3
votes
4answers
378 views

Get specified bit in addition of two large binary numbers

I am performing an addition operation on two large binary numbers that have an equal number of bits. Both numbers are stored in an array of length $N$, which is rather large. At first I tried running ...
5
votes
3answers
436 views

Converting function to bitwise only?

I have a function to count upper bits of a 32 bit value. So if a number is 11100011111..., the result is 3 as there are 3 ones in the most significant place before a 0 is hit. I need to convert the ...
1
vote
1answer
189 views

Double-nested loop with bitwise operation

I have this little exercise: for ( i = 0; i < 2 * n; i += 2 ) for ( j = 1; j <= n; j <<= 1 ) if ( j & i ) foo (); (...