Questions tagged as 'bitwise'

4
answers

What is the practical use of bitwise operators in PHP?

The bitwise bit operators used to manipulate specific bits are somewhat unusual (not to say rare) use in a PHP application. If we talk about escovação de bits in compiled languages, such as C/C++ , it is easier to understand...
asked by 01.03.2016 / 21:56
1
answer

Why is there no "logical XOR" in C ++?

I was thinking and this question came to me: "Logical XOR" ! For example: true false = true true true = false false true = true false false = false     
asked by 10.08.2018 / 03:40
1
answer

Is it worth using binary operators to gain performance?

I have the following situations: if (1 & 1){} and if (1 == 1){} According to what I've learned, working with bitwise operators causes a much better performance in the program, so I've had some doubts: Is performance in the f...
asked by 03.01.2018 / 22:04
2
answers

Combining column value with MySQL

I'm working on a report in MySQL where I need to show a percentage of various events that occurred with a group of entities. The structure of my table is as follows: | id | eventoA | eventoB | eventoC | eventoD | |----|---------|---------|-...
asked by 06.08.2015 / 18:51
1
answer

How to display correct name in a bitwise enum?

I have the following enum marked as [Flag] , that is, they are values in bit [Flags] public enum Position { None, Left, Right, Both=3 } Sete for Both (both) position in 3 because if it is Left and...
asked by 13.04.2014 / 21:12
3
answers

Convert "unsigned int" into "unsigned char" vector?

I need to convert a unsigned int to a unsigned char vector to later translate those addresses into binary, for a job that needs to simulate a virtual memory. Can someone explain me how to do this?     
asked by 24.06.2015 / 19:25
2
answers

Is it possible to multiply only with the &, |, + and - operators?

I have to create a program with assembly language K & S Model 2 that multiplies a number by another, the problem is that this language does not provide a multiplication operation. I thought of doing multiplications with additions, for exam...
asked by 21.09.2014 / 19:07
1
answer

Logic of these operations bit by bit

I've already had a good time getting started in the emulator world, I decided to stop trying to make an emulator of a complex system and start with a very basic, emulator of CHIP-8, which is what many indicate in forums of emulation. Well let's...
asked by 18.06.2018 / 14:16
1
answer

Help with understanding cellular automaton code

I would like you to help me understand a code for calculating and presenting cellular automata that I found on the internet. The code in question is as follows: #include <stdio.h> #include <stdlib.h> void PrintfVetor(char vetor[],...
asked by 19.07.2018 / 07:06
2
answers

How do bit operators work?

I have the following code: volatile long Hex_To_int(long Hex , char bits) { long Hex_2_int; char byte; Hex_2_int = 0 ; for(byte = 0 ; byte < bits ; byte++) { if(Hex& (0x0001 << byte)) Hex_2_int += 1*(pow(2,byt...
asked by 07.10.2015 / 00:49