# How to evaluate Boolean expression and get an answer in bitwise form?

I am trying to evaluate the following expression:

 11000 AND ( 01011 OR 11011 )


I am able to get the answer on paper. The answer is:

 01011 OR
11011 =
11011


Then:

 11000 AND
11011 =
11000


I'm new to Mathematica and unsure on how to evaluate this expression and get the same answer using Mathematica. I tried using BitOr and BitAnd built-in functions but I think I'm not using them the right way

## 2 Answers

BitOr[{0, 1, 0, 1, 1}, {1, 1, 0, 1, 1}]


$\${1, 1, 0, 1, 1}

BitAnd[{1, 1, 0, 0, 0}, {1, 1, 0, 1, 1}]


$\${1, 1, 0, 0, 0}

{1, 1, 0, 0, 0} ~BitAnd~ ({0, 1, 0, 1, 1} ~BitOr~ {1, 1, 0, 1, 1})


$\${1, 1, 0, 0, 0}

Instead of using the list of digits as suggested by Karsten, you could also explicitly use BaseForm or its infix notation base^^digits:

2^^11000 ~ BitAnd ~ (2^^01011 ~ BitOr ~ 2^^11011) ~ BaseForm ~ 2


which returns $11000_2$ as you expected.