# Questions tagged [binary]

For questions about representing numbers in base 2 or performing arithmetic on them.

164 questions
Filter by
Sorted by
Tagged with
31 views

### Confusion on 1 bit precession

We know binary representation of $\frac{1}{3}=0.010101..$. What will its 1 bits precession $0.0$ or 0.1? Note that $0.1=\frac{1}{2}$ is closer to $\frac{1}{3}$ than $0.0=0$.
• 49
73 views

### Conditional Maximization of a Binary Matrix

Given an $L \times N$ matrix $A$ with only binary values, $A_{ij} \in \{0, 1\}$, and a vector $b$ with $b_j = 2^{j-1}$, I want to find a matrix $\tilde{A}$ that maximizes $\tilde{c}=\tilde{A}b$, ...
• 61
34 views

### Binary subtraction using two's compliment

(22)10 - (65)10= (?)2 Perform this operation using 2's compliment method.Use 8bit representation of numbers
50 views

### A good way to hash two numbers with known properties together

I have two 64-bit numbers a and b which have a few properties: only 49 out of the 64 bits are used (15 bits are always 0), and ...
37 views

### What is the value range for absolute value formulation of binary variable

According to this link binary variables - absolute values the formula of some binary variables like absolute value is : y = | x1 - x2| for two variables x1, x2 with 0 ≤ xi ≤ U Introduce binary ...
• 101
63 views

### why didn't ASCII/utf-8 used 00000000 to represent char 0 or rather any other character

I mean why value of 0 value in binary is not used by ascii encoding , it would have been used to represent char 0 or anything else why they used it to represent NULL
60 views

### Is there an algorithm to implement N-input-gates using smaller gates?

To borrow part of a description from a similar but distinct question: there exist 2^(2^N) different functions which accept N binary inputs and return a 1 bit output. For the purposes of my question I ...
1 vote
101 views

### Splitting a Larger Unsigned Integer into Summable Parts

I have a very strange (arbitrary) problem that I have been trying to wrap my head around, but have been struggling to figure out how to accomplish this. I'll use Rust but in a pseudo-code fashion, ...
• 379
1 vote
121 views

### Check if n-bit number is divisible by 7

Show how to check if n-bit number is divisible by 7 in logarithmic circuit depth. How can I construct the circuit to be able to check the divisibility?
• 183
55 views

### Binary range identification in terms of subset

Given a range of "K" bit numbers, we want to identify the whole range by using a subset within that range, with the following criteria - If there are > "n" consecutive 0s, it ...
• 25
45 views

### Absolute difference between largest IEEE754 number and its predecesor

In simple precision format, the largest possible positive number is $A = 0 ~~~ 11111110 ~~~ 111\ldots 111$ Its predecessor is $B = 0 ~~~ 11111110 ~~~ 111 \ldots 110$ But what is the absolute ...
• 195
25 views

### Binary Comparison Between Two Integers

Say I have two integers,i and j, which for the sake of example will be 2 and 5, represented by $010_2$ and $101_2$ respectively. I have a third bit set to 0. If $j \geq i$, then this bit should change ...
29 views

### Classifying vectors that only contains 1001110101 numbers - Is Support Vector Machine the solution?

Assume that you are given a vector 0b1101001001011001 etc. And you are going to classify it. One can use Support Vector Machine, but is that method good for ...
• 97
207 views

### How do I multiply 2 signed 4 bit numbers in a logic circuit?

I've been experimenting with making a binary calculator lately, and I've got the addition and subtraction working. I now want to start making a multiplier, but I have no idea where to even start. I ...
• 103
196 views

### Why is 2's complement used for representing negative numbers?

So I was reading the use complement operation in the digital logic and found, it is used to give additive inverse of the number and subtracting a number (like we do) is difficult for computer. So it ...
• 208
82 views

### 1's and 2's complement of 0

In the Morris Mano's book on Digital Circuits Edition 3, it is defined that r's complement for N=0 is 0 and r-1 complement is not even defined. But lets say r = base = 2 Then 2'd complement of 0, ...
• 208
49 views

### Binary combinatorics with rank

I am looking at finding acceptable binary values with maximum 2 consecutive 1s and 0s, from a range of maximum 6 bits (2^6 values). Also, I want to rank and unrank these subset of values (in ...
• 25
47 views

### DFA for "K" bit value with max "n" consecutive "0"s and "1"s

I had posted earlier a question regarding ranking max "n" consecutive "0"s and "1"s in a "K"-bit string - Order in a subset I got clarification regarding how ...
• 25
660 views

### How do you convert this x86 assembly program to binary

I'm trying to convert a x86 assembly language program to binary. I have read a 1979 Intel 8086 manual and so understand the basic architecture, however I am still unsure as to how to convert this. ...
1 vote
85 views

### Order in a subset

Lets consider a range of "K" binary digit numbers. In that range, we want to take a subset of those values which have (<="n" consecutive 0s) AND (<="n" consecutive ...
• 25
40 views

### Exact Definition of simple bit pattern?

I didn't find an exact description for this, but I know that any integer type is a simple bit pattern, it seems to me that the simple bit pattern should have a more exact description as I understand ...
1 vote
188 views

### How does Decimal to Binary conversion algorithm work?

I'm reading a book which says that to transform a number from decimal representation to binary representation you have to follow these steps: Take the integer part (the one before the point) of the ...
• 315
79 views

### ASCII invariant string for base64 Encoding

I know the basics about base64 encoding, but thinking about it abstractly I have a theoretical question. If we consider base64 a mathematical function(in our case computable), Does there exists an ...
65 views

### How a computer works?

I know that a computer can be mechanical, screws/nuts or even water/pipes. Of course, it would be slow and big, but it doesn't have to be electric, transistors, etc. How can a machine like this do all ...
1 vote
148 views

### Difficulty Understanding a Quick Method for Finding the Two's Complement of a Binary Number

This is more for my curiosity than anything else as I understand how to find the two's complement of a binary number via the standard approach which is to convert all 0s to 1s and 1s to 0s and then ...
69 views

### How executable binary can be signed?

Some devices (for example Android devices) are "locked", the bootloader checks following bootloader/software sign, right? Chain of trust. Signing technically means that the file must be ...
71 views

• 233
1 vote
121 views

### How is Gene sequence files i.e FASTA files so compressible?

Why are Gene squencing file i.e FASTA files so compressible. It was stated on a site that few compression algorithms are capable of compressing these files to Gigabytes (from Terabytes). And is it ...
• 35