Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
4 votes
1 answer
281 views

The follow derives from the devkitpro 3ds filter audio example though it's not relevant to know exactly how the example works. In short, consider this code: size_t data_size = ...; uint32_t data* = (...
1 vote
1 answer
63 views

TL;DR: In Emacs Lisp, is the sign of a fixnum part of its binary representation or stored in some metadata? What's the distinction between positive and negative fixnums? Can the sign be switched in ...
1 vote
0 answers
125 views

I've been learning arm64 on a computer with a Mac M3 chip. The assembler (as) is not recognizing the lsls instruction which should be a logical shift left which sets the flags. (Also not lsrs.) I am ...
3 votes
2 answers
194 views

I am trying solve the problem posed in this question that asks << 1 operation be performed on a 64 bit number using NAND operation only and without using any arithmetic operation. My attempted ...
0 votes
0 answers
85 views

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 ...
5 votes
2 answers
219 views

I'm writing a C program and need to create a bitwise mask that could potentially fill a computer word (64 or 32 bits) with all 1s. I found a bug in my code but I can't make sense of it because when I ...
2 votes
1 answer
257 views

As part of a test I was given, I am required to code the instructions below: A function F(x) is defined over integers x >= 0 as: F(x) = ∑ [(x | i) - (x & i)] (summation ∑ is over i), with i ...
4 votes
2 answers
279 views

This code doesn't compile. It seems like the compiler (VS) is interpreting the expression as: (std::cout << ul1) & (ul2 << std::endl) #include <iostream> int main() { ...
3 votes
1 answer
105 views

In CUDA I regularly exploit the fact that the hardware does not limit the width of shifts. This is unlike x86, where only the lower bits of the shift amount are taken into account. Unfortunately I ...
0 votes
2 answers
248 views

I have a value in a 16-bit register (say, HL). How do I rotate it left one or more times?
user avatar
2 votes
1 answer
174 views

I'm currently studying encryption and I was coming up with ways of reversing the nibbles of a byte (ex. 0xF5 => 0x5F). I came up with this solution: byte >> 4 | (byte & 0x0F) << 4 ...
1 vote
1 answer
123 views

when shifting bytes, there are some scenarios that do not seem to make sense, for example printf("shifted bytes %llx\n",(((long long)1 << 63 ))>>1); outputs c000000000000000, ...
3 votes
5 answers
160 views

I am working on a project where I have to rotate bits in 16-bit unsigned integer using MSP430FR5739. For example: 0111 0000 1101 1101 must become 1011 1000 0110 1110 after one shift to right. I read ...
-1 votes
2 answers
146 views

I was trying to solve the exercise that says Exercise 2-7. Write the function rightrot(b, n) which rotates the integer b to the right by n bit positions. and i did code it, here is the code #include ...
4 votes
1 answer
134 views

I am looking for an efficient algorithm that computes arithmetic shift-right of integers that rounds to nearest integer with halfway rounding toward zero behavior. An answer can be a proper ...

15 30 50 per page
1
2 3 4 5
...
141

AltStyle によって変換されたページ (->オリジナル) /