Byte Bashing

Is there a way to combine 2 bytes into a single byte?
Example:

0000 0100 = 4
&
0000 0011 = 3

=
0100 0011

I'm trying to display the number 43 to 2 BCD to decimal decoder's using only 1 595 shift register.

Tinkering with the nixie 74141 display driver.

Use the left shift operator.

a = 0b00000100;
b = 0b00000011;
c = b << 4 | a;

Thanks wvmale I also found this nibble thread. Seems to me, years ago, 4 bits was considered a (word) come to find out it's called a (nibble) :slight_smile:

https://forum.arduino.cc/index.php?topic=207782.0

Bit, nibble, byte for 1, 4, 8 bits. Nibble is not used much.

The size of a word is based on how many bits the processor handles in one operation - it's 8 bits on an AVR based Arduino; 32 bits on an ESP8266.