Questions tagged [nibble]

A unit of information usually corresponding to 4 bits.

In computing, a nibble (occasionally nybble or nyble to match the spelling of ) is a four- aggregation of information.[Wikipedia]

Although less common than the , some computer architectures use the nibble as the primary unit of computation and information storage.

54 questions
0
votes
1 answer

Can C cope with sub-byte instruction addressing?

For example if an architecture supports nibble length instructions but data is byte aligned, will: void *PointerToAnything; work? In other words, can the compiler handle this?
0
votes
0 answers

Properly bit packing for enum and typedef struct

I am trying to do some bit packing to transmit data in the small format possible, but I am unsure how to archive it, I started with a typedef struct where I gave the size to each element, but when I am trying to transmit it using UART, in the other…
Kirito-kun
  • 31
  • 1
  • 5
0
votes
1 answer

Merge 2 integers into 1 byte

I have been working in this since yesterday and I can't seem to fully understand the bit shifting. What I'm trying to accomplish is that, I need to merge 2 numbers into 1 byte. The first number in the 1st four bits, and the second in the last four…
TerribleDog
  • 1,237
  • 1
  • 8
  • 31
0
votes
1 answer

Bytes to Nibbles to Words to Bytes in C#

I have a 3 byte Array which I need to Convert each byte to Nibbles Add Byte_0.Nibble_0 + Byte_0.Nibble_1 + Byte_1.Nibble_2 as WORD Add Byte_1.Nibble_0 + Byte_2.Nibble_1 + Byte_2.Nibble_2 as WORD Convert each WORD to Byte Array Here is what I…
HaBo
  • 13,999
  • 36
  • 114
  • 206
0
votes
0 answers

printing an array with all hex numbers with n nibbles

I'm trying to code a program that does the following: "Receives an input (N) and outputs an array with all hexadecimals with 'N' Nibbles on ascending order." To do this, I created a main function int main () { int n; printf("Insert number of…
0
votes
1 answer

Class not being consistent

I have made a nibble class that appears to work, but when I use it more than once, the result is different. the following code should illustrate the problems. #include #include using namespace std; class nibble{ public: …
Mobius
  • 2,871
  • 1
  • 19
  • 29
0
votes
0 answers

C++ write nibbles in file

Good evening, I'm new to C++ and encountered a problem that I wasn't able to solve despite reading numerous pages here. I've got a file with hexvalues that need to be read and compressed, then written in a new file. An example sequence looks like…
neophoenix
  • 66
  • 6
0
votes
1 answer

Nibble Restriction to 0-9

Hello fellow Programmers, int main() int n; scanf("%d", &n ,); printf("nibble = %d%d%d%d", (n/8)%2, (n/4)%2, (n/2)%2 , n%2 ); return 0;} I´ve build this code so far, the code converts a decimal value into a nibble. It works but i have questions…
Sali
  • 5
  • 1
0
votes
1 answer

Nibble half digit converter

Hello fellow Programmers, I might want to ask you , I`ve got a task from my University to convert a decimal digit (0-9) to a half bit (nibble = 0101 ie.) the restriction is that we cannot use if statements so i tried a little bit and came so…
Sali
  • 5
  • 1
0
votes
1 answer

1 byte that represents different values in java

I have one byte that contains Upper 4 bits are a bitmap for system status like 0x40,0x80 and Lower 4 bits values like 0,1,2,3. I do not know to parse them.Can someone help me.can I have anything like this?how byte will look like???will it be byte…
0
votes
1 answer

The Idea of Mask

I don't understand the idea of mask and why it is useful here?
Reem Aljunaid
  • 109
  • 1
  • 9
0
votes
2 answers

Elegant way to set SFR nibble

I'd like to move a nibble from Accumulator to upper nibble of P1. For now, I set the nibble bit by bit MOV C, ACC.3 MOV P1.7, C MOV C, ACC.2 MOV P1.6, C MOV C, ACC.1 MOV P1.5, C MOV C, ACC.0 MOV P1.4, C which seems like a poor way to me: it costs…
Jan Turoň
  • 31,451
  • 23
  • 125
  • 169
0
votes
1 answer

encoding data in bytes - how to split into nibbles

I have a voltage reading 0-5v and I need a precision of 0.1. Can I encode this in a 1 byte? How would I split the it into nibbles, the first nibble being the volt and the second nibble being the decimal? Would be helpful if somebody could explain…
user4990924
0
votes
0 answers

send representation of byte containing custom high-order nibble and dynamic low nibble

I'm facing the following problem : I need to send a byte to a server. This byte should contain the following : high order nibble with 1011 low order nibble containing a number representation between 1 and 15, so here let's take 2 for the e.g. So…
Christophe Willemsen
  • 19,399
  • 2
  • 29
  • 36
0
votes
1 answer

Hex of most significant nibble

I am having trouble with bitwise manipulation. To do: The hex value of the most significant nibble of x equals y (assume 0 <= y <= 15) Restrictions: may not use equality (==) or inequality (!=) tests, relative comparison operators, division,…
Rbutler93
  • 73
  • 1
  • 11