Skip to main content

Questions tagged [binary]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
970 views

In C++, how is signed integer stored?

I'm aware that there are a few accepted implementations of how signed integers are stored, specifically negative values. There's two's complement, one's complement, and sign/magnitude. For Visual C++, ...
J113's user avatar
  • 33
-1 votes
3 answers
655 views

How do you represent a negative floating point in two's complement?

I was looking into a datasheet of a Real Time Clock (RTC) with a temperature sensor MAX31328. (You can find the datasheet easily). I'd like to convert the raw binary value into decimal format. I have ...
Nuz's user avatar
  • 51
14 votes
3 answers
5k views

What are the complexities of a binary search?

I recently asked a question on CodeReview SE where using a binary search was recommended, and the author of the answer proved that it was faster than my implementation. During my research on the topic,...
Hazel へいぜる's user avatar
0 votes
3 answers
447 views

What is this numeral system notation?

I used Google search to convert numbers from one numeral system to another. 10 to binary is 0b1010; 10 to hexadecimal is 0xA. What's the meaning of 'b' and 'x', accordingly? I think these are ...
floreapaun's user avatar
-2 votes
1 answer
93 views

Choosing a MagicNumber or Signature for a Binary File Format

I'm defining some binary formats to encode some information and dump it to a file. I want to place a MagicNumber/Signature at the beginning of files encoded in my format to be able to tell them apart ...
Blue Nebula's user avatar
1 vote
3 answers
2k views

How do binary numbers interact with the CPU and cause some action to take place? [duplicate]

EDIT: Perhaps what I am misunderstanding is that when it is said that the code we type gets turned into machine code of 0s and 1s. If these 0s and 1s are the abstracted representation of their ...
steez's user avatar
  • 31
5 votes
2 answers
1k views

How to prove that given binary files are compiled from provided source code?

Let's assume I want to use an open-source software, the developer says that the software is open-source and provides the source code. Now my question is, how can I be 100% sure that the given binary ...
Harun's user avatar
  • 61
1 vote
2 answers
308 views

(Algorithm) Maximum Binary String After Making Changes

I am given a binary string binary consisting of only 0's or 1's. There are two allowed operations (can be re-used any number of times): Operation 1: If the number contains the substring "00",...
Arunima's user avatar
  • 37
3 votes
5 answers
3k views

Why is the bitwise AND of 1 and any even number equal to 0?

I’m curious as to why the bitwise AND of any even number with 1 is equal to 0? I’ve looked at the binary representations of an odd number and 1, and have found that the following is always true for ...
p32094's user avatar
  • 187
-6 votes
3 answers
300 views

How compiled code works?

I'm just curious, I'd like to understand how compiled code works from the moment I run an executable file. Some time ago I had found a very well written article which helped, using a hex editor, to ...
Daniele's user avatar
  • 89
-1 votes
1 answer
82 views

Modify a binary and account for relative jumps

Most binaries have jump and control flow instructions that are relative to other locations in the binary. For example: if I modify an instruction around 0x12341232, and there is an instruction ...
Solidak's user avatar
  • 157
-5 votes
5 answers
268 views

Do decimal equivalents to binary number values hold significance in software programming?

It seems as though in software engineering, we care more about these "on and off switch" usages of binary numbers more than the actual values of them numbers... For example, say I have the number: ...
the_endian's user avatar
  • 1,152
-2 votes
3 answers
762 views

How are floating point representations (say single precision for instance) able to represent more numbers than what a 32 bit memory allows?

I am trying to understand the floating point system. Can the floating-point system represent all the real numbers within the range of (10^38) accurately? If so, then how is it possible? Because ...
Viper's user avatar
  • 29
11 votes
5 answers
10k views

How do you debug a binary format?

I would like to be able to debug building a binary builder. Right now I am basically printing out the input data to the binary parser, and then going deep into the code and printing out the mapping of ...
Lance's user avatar
  • 2,605
4 votes
4 answers
3k views

Binary data formats, how to make ensure you can read different format versions?

On our project we have this data format that we use to process and record data on. As of late our application changed so that many of the data formats parameters have become obsolete. Currently we ...
Krupip's user avatar
  • 1,300
3 votes
1 answer
457 views

What's the best approach for using Git for a project containing a largish binary database (4 GB, 4000 files)?

The codebase consists of 190 Fortran 95+ source files, and directory of binary coefficient files required for the use of the code. The binary directory contains about 4000 files, some of which are ...
Ben's user avatar
  • 159
3 votes
1 answer
5k views

Best method for Pattern Matching on Binary String?

I need to search a long string of binary string data (couple of megabytes worth of binary digits) for patterns of binary digits. There are about 100 000 different patterns to search for. Each is a ...
user289944's user avatar
-2 votes
2 answers
997 views

Can I distribute binaries of my GPLv3 software? [closed]

I have licensed my software under GPLv3 and made it available on Github as an open source repository. Am I allowed(under GPLv3) to distribute binary releases of the application so it is easier to use ...
Vivek Joshy's user avatar
1 vote
1 answer
246 views

binary search vs search with data samples

As long as I remember at least in older versions of Cassandra database, search was implemented in following way - During startup several samples are collected from sorted table and when data is ...
Nick's user avatar
  • 295
36 votes
5 answers
23k views

Does storing plain text data take up less space than storing the equivalent message in binary?

As a web developer I have very little understanding of binary data. If I take the sentence "Hello world.", convert it to binary, and store it as binary in an SQL database, it seems like the 1s and ...
john doe's user avatar
  • 1,007
3 votes
2 answers
376 views

Preferred way to put drawings into Git repo

In order to visualize some concepts in a Git repo for other developers, I want to put there some vector drawings. Of course they should not be binary. If minor changes occur, the file change should be ...
mcocdawc's user avatar
  • 139
6 votes
0 answers
156 views

Rounding floats after modf()

I am trying to make an effective modf() function that uses floats instead of doubles. An embedded application I am working on only supports the float type. My modf() function works as expected with ...
user264480's user avatar
2 votes
5 answers
464 views

Shortening a boolean AND with third operand

I'm trying to calculate the sum of 2 bits using basic binary arithmetic and currently, I'm doing this: function Add(bool a, bool b, bool carry) { return { Result: a ^ b ^ carry, ...
DumbButterly's user avatar
1 vote
1 answer
163 views

How would a computer represent a negative base ten number in bits?

How would a computer represent -6886707 using 24 bits? I need someway to verify this: 100101101110101011001101. First I converted 6886707 to binary, which is 11010010001010100110011. Then I put one ...
lmc's user avatar
  • 143
-7 votes
1 answer
115 views

In internal computer memory Char value ,string and integer how they differentiate time of storing and retrieving

In internal computer memory Char value ,string and integer how they differentiate time of storing and retrieving . Char A =ASCI value 127 Int value 127 Binary is same then how computer ...
user3550931's user avatar
0 votes
1 answer
862 views

How to run 2-layer perceptron to solve XOR

XOR is not solvable by using a single perceptron with standard scalar product and unit step function. This article suggests using 3 perceptron to make a network: http://toritris.weebly.com/perceptron-...
Dan D.'s user avatar
  • 103
1 vote
3 answers
414 views

Can you name this square root algorithm on an unsigned integer through the manipulation of the binary number?

Apparently this algorithm is well known. The algorithm will build the square root answer bit by bit starting from the left-most bit to the last. Let's say we will support squaring up to a 8 bit ...
chickenninja565's user avatar
4 votes
2 answers
1k views

Understanding physical address

I'm reading this article, Low Level Programming of the Raspberry Pi in C, which explains how to access the raspberry pi on a low level. It states that the virtual gpio address is 0x7E200000. ...
xhallix's user avatar
  • 151
1 vote
0 answers
540 views

How are HTML files with binary headers interpreted? [closed]

I recently got an inexpensive phone with minimal browser support i.e. no javascript and on a small screen. Wanting to make the most of my device, I decided I would load some ebooks onto my device ...
NeRoboto's user avatar
  • 127
1 vote
2 answers
973 views

Different Number Base Systems

I am doing a summer assignment for AP Computer Science. For this I am learning about different number base systems and how to convert them. These topics led to me wondering about why programmers use ...
Rishi Kavikondala's user avatar
8 votes
4 answers
3k views

What separates text files from binary files, considering they are stored in binary?

There are text files and there are image, video, and music files. Why are image, video, and music files considered binary files, and why are text files not?
Luis Javier's user avatar
2 votes
2 answers
1k views

Why directly edit binary files?

This may be a naive question, but I wonder when and why (non-research) developers would directly edit a binary file. It seems like the only good reason to use one is to create a kludge when you need ...
William's user avatar
  • 213
2 votes
2 answers
5k views

What is a Relocatable Binary?

What is a Relocatable Binary? I tried doing some search on Google, but I am still confused. Also: what is the difference between an Executable and a Relocatable Binary?
Hemang Bhogayata's user avatar
23 votes
3 answers
2k views

Optimize a git repo, containing large binary files

Our project is about 11GB, 10 of which are binary data (.png images). Consequently, a git diff or git status operations take up more than a minute. Fortunately all data files are separated into a ...
Vorac's user avatar
  • 7,129
4 votes
3 answers
170 views

Restricted randomization of a binary vector

Suppose I have a binary vector of sample size N with each of the two possible values (e.g., 0 and 1 occurring equally often). For example, if N=10, the binary vector is: 0 0 0 0 0 1 1 1 1 1 Suppose ...
Bart's user avatar
  • 51
5 votes
1 answer
17k views

Representing a number in 12 Bit 2's Complement Fixed Point

The original question is as follows: Consider a 12-bit two's complement fixed point representation, with 8 bits for the integer part and 4 bits for the fraction. What is the binary encoding of ...
dirk1212's user avatar
0 votes
0 answers
375 views

Persisting and manipulating JS ArrayBuffer data on the server

My node.js app has to deal with (sometimes large; a few MB) tables of numerical data. I'm about to use JavaScript's native binary objects for this purpose (i.e. ArrayBuffer and friends), because they'...
sk29910's user avatar
  • 133
1 vote
1 answer
98 views

Benefits of this data format

I'm integrating with a bluetooth blood pressure monitor, and I've come across one of the most bizarre data formats I've ever seen. The systolic, diastolic and pulse rate (all ints, should all be ...
Ian Newson's user avatar
2 votes
2 answers
7k views

audio file processing in C++

I thought of the following project that I want to pursue: I want to create a C++ program, that can play audiofiles and visualize the amplitudes of individual frequency bands in real time (e.g. with ...
Pascal Engeler's user avatar
0 votes
1 answer
40 views

Generating New Media Content From Binary Patterns

At the most basic level, a digital media file (document, song, video, etc) is just a rather large pattern of 1's and 0's. We can say that for any given piece of digital media, there corresponds a ...
SnakeDoc's user avatar
  • 361
0 votes
3 answers
520 views

Are hex dump and binary-to-text encoding related or different things?

Binary-to-text encoding is to represent binary data as characters. Hex dump of binary files seem also do the same for reading binary files. Are they related or different things?
Tim's user avatar
  • 5,475
4 votes
3 answers
4k views

Data format for binary data transfer

I have to make an oscilloscope. Ideally, the oscilloscope connects to a probe. This probe should be another program, and could get the data locally or from a network. This data are numbers, floats and/...
cauchi's user avatar
  • 1,212
0 votes
3 answers
440 views

Does it really need to convert decimal,string, etc to binary?

I'm very new to programming. Just read some articles about algorithm for converting a decimal or string to binary. But,according to what I know, computers hold these data in binary form. So why don't ...
anhvh's user avatar
  • 1
0 votes
1 answer
4k views

How to determine whether two trees (not necessarily binary) are isomorphic

Two ordered trees T' and T'' are said to be isomorphic if one of the following holds: ◦ both T' and T'' consist of a single node ◦ both T' and T'' have the same number k of subtrees, and the ith ...
user11892's user avatar
  • 101
31 votes
3 answers
5k views

Why aren't "fat binaries" more widely used for cross-platform applications?

As far as I know, so-called "fat binaries"--executable files that contain machine code for multiple systems--are only really used on Apple PCs, and even there it seems like they only used them because ...
Ixrec's user avatar
  • 27.6k
3 votes
0 answers
598 views

Optimal data structure for binary data/Java

I have several input formats mostly restricted to geotiff and some proprietary binary formats. I import them into my program and then need to export them into various other data formats (also binary) ...
user avatar
0 votes
2 answers
702 views

How were assemblers created straight from binary? [duplicate]

How did these earlier programmers know what combinations of binary produced certain results? Is there a way I can create an assembler from binary today?
Nanotwerp's user avatar
2 votes
1 answer
8k views

Bitwise operation on uppercase ASCII character turns to lowercase. Why?

I came across this in the http_parser library of node.js implementation. When I bitwise-OR an ASCII capitalized character code, it converts into its lowercase version. The lowercase version remains as ...
Showkat Ali's user avatar
1 vote
2 answers
4k views

When trying to find out if a number is even or odd: AND 1 or OR 0

I recently learned of the trick for finding out if a binary number is odd or even. If the last bit in the number is 0, then the number is even. If it ends in a 1, then the number is odd. In the ...
SirPython's user avatar
  • 139
8 votes
4 answers
1k views

Is it allowed to embed an LGPL command-line tool?

I want to sell a closed-application that depends upon a certain command line tool. Am I allowed to distribute my software including this command line tool? For example, as a separate binary ...
Nick Russler's user avatar