3,616 questions
-4
votes
2
answers
89
views
Is there a name for the high and low bits of a hex string?
In the hex byte A1 B2 C3 D4, ABCD would be the most significant bits of each pair, and 1234 would be the least significant. I find that these groups of bits are often operated on together in hardware-...
0
votes
1
answer
68
views
DB2 LUW What's up with BINARY vs. CHAR FOR BIT DATA column data types?
We have DB2 LUW v11.5 and it supports both BINARY and CHAR FOR BIT DATA column data types. I've read the documentation, and I've Googled it, but I don't really see an effective difference between ...
0
votes
0
answers
76
views
Which of these two bitwise expressions is faster, and is there an optimized alternative?
I have two bitwise expressions and need to figure out which one is faster. Also, if there are other ways to implement the same, but in a faster way than the given expression. I am using these ...
-3
votes
1
answer
69
views
I can't find the error in this code. It is x86 assembly
Input: unsigned char vet[] = { 0xBC,0xFF,0x01 };unsigned short int len = 18;
Output: short int minLung;short int maxLung;
Given a sequence of bits, determine the minimum and maximum length of ...
0
votes
0
answers
48
views
bit manipulation for big data processing with complex boolean logic
Looking into solving a very large data set problem by using bit manipulation to reduce compute
Imagine billions of records that look like this(but more than 20k in length):
Questions : A,B,C,D
...
1
vote
1
answer
77
views
Grouping bits based on binary mask [duplicate]
I am looking for an algorithm to group bits from byte A based on mask (or tap) from B, on byte C, starting from least-significant. By way of example, the mask/tap (B) has bits 1,3,4 set to 1, which ...
1
vote
3
answers
127
views
Powershell converting bit values to Boolean in result set
I have an issue whereby a query called via Invoke-SQLCmd returns a certain set of results. For some columns the value is a 0 or 1 of BIT data type. The results instead come back as False or True in ...
0
votes
1
answer
98
views
How much data uses an especific function [closed]
How can I determine the exact amount of memory in megabytes that a "char" data type uses, beyond just knowing its size in bytes, nibbles, kilobytes, and bits?
I’ve tried using sizeof and ...
1
vote
0
answers
67
views
question at / pivot and >> 2 in C++ Solution for Next Higher Number
I came across the following C++ solution for finding the smallest number greater than n that has the same number of 1's in its binary representation
int solution(int n) {
int pivot = n & -n;
...
-2
votes
1
answer
196
views
typescript number type with bit operations [duplicate]
in typescript, as the number type can be int or float, so what if I use number type with bit operations
I have see some library use this
const a = 1.23
const b = a | 0
Sorry for the inaccurate ...
0
votes
0
answers
31
views
Graphical output EDSAC
I have some homework for Computer Architecture to output our initials in the bits of EDSAC Simulator. I've read a couple of manuals on this but it only tells us of how to output text but not graphical ...
0
votes
0
answers
93
views
Parsing Multiline Azure AKS logs to Elastic with Fluent Bit
I’m currently using Fluent Bit version 3.1.8-amd64 for log forwarding from Azure Kubernetes Service (AKS) to Elasticsearch. I’m encountering issues with properly configuring Fluent Bit’s multiline ...
0
votes
1
answer
74
views
How does bitshifting 0xFF to the end of an Uint32 form a complete hexadecimal code?
I've been following along to Cave of Programming's C++ for Complete Beginners on Udemy, and in lesson 67 he goes over bitshifting to output certain colour pixels in an SDL window. There's a certain ...
0
votes
1
answer
138
views
A single byte that is from 0 to 255 to be rescaled from 0 to 7
A single 1 byte could be from 0 to 255. I intend to rescale it to be from 0 to 7. I have done this:
bit8 := uint8(136)
// To re-scale 1 byte from 0 to 2^3-1 i.e. 0 to 7
bit3 := bit8 / 0xff * 0b0111
...
-1
votes
1
answer
119
views
Do Left Shift and Right Shift have better performance compared to multiply and divide operations?
If I want to do the fastest way to calculate x * 2, which one should I use?
x << 1
or
x * 2
With the same logical thinking, if I want to do the fastest way to calculate x / 2, which one should ...