Don't care inputs

pilko

Senior Member
Hi, Everyone,

I'm looking for a more elegant way of dealing with
the following "don't care inputs"

1 0 0 X 0 ---- Do task A

X 1 0 X 0 ---- Do task B

0 X X 1 1 ---- Do task C

My current unelegant way is as follows:-

%10000 ---- Do task A
%10010 ---- Do task A

%01000 ---- Do task B
%01010 ---- Do task B
%11000 ---- Do task B
%11010 ---- Do task B

%00011 ---- Do task C
%00111 ---- Do task C
%01011 ---- Do task C
%01111 ---- Do task C

Thanks

pilko
 

Technical

Technical Support
Staff member
Assuming the value is in b0,

if bit4=1 and bit3=0 and bit2=0 and bit0 = 0 then taskA
if bit3=1 and bit2=0 and bit0 = 0 then taskB
if bit4=0 and bit1=1 and bit0 = 1 then taskC
 
Top