I am looking for a function $f:\{0,1\}^d \to \{0,1\}^{d'}$, where $d'<5d$, such that whenever $x,y,z$ are three distinct $d$-dimensional binary vectors, and for all $i\in\{1,\dots, d\}$ it holds that $x[i]\in\{y[i],z[i]\}$ then there exists $j\in \{1,\dots, d'\}$, such that $f(x)[j]\not\in\{f(y)[j],f(z)[j]\}$.
For example, if $x = 10010101$, $y = 10100101$, $z = 00010000$, then I would like to have something like $f(x) = 1{\color{red}1}00001111$, $f(y) = 1{\color{red}0}11111111$, $f(z) = 1{\color{red}0}00000000$.
Is it possible to construct such a function? I tried playing with XOR (aka bitwise addition modulo 2) in different settings (for example XORing the consecutive dimensions, or some permutations of digits, etc.), but this approach seems to be completely wrong.
Any hint, or other kind of help will be extremely useful.