Definition asZ (x : bool) : Z := if x then 1 else 0.

Lemma asZF: asZ false = 0. reflexivity. Qed.
Definition convertByteBits bits (b : byte) : Prop :=
exists (b0 b1 b2 b3 b4 b5 b6 b7 : bool),
bits = [b0; b1; b2; b3; b4; b5; b6; b7] /\
Byte.unsigned b =  (1 * (asZ b0) + 2 * (asZ b1) + 4 * (asZ b2) + 8 * (asZ b3)
+ 16 * (asZ b4) + 32 * (asZ b5) + 64 * (asZ b6) + 128 * (asZ b7)).