SOLUTION: Find the result of each operation assume A = 11110001 and B = 10101010 a. A AND B b. A NAND B This is my last question for the day! Can you explain me the steps of this

Algebra ->  Exponential-and-logarithmic-functions -> SOLUTION: Find the result of each operation assume A = 11110001 and B = 10101010 a. A AND B b. A NAND B This is my last question for the day! Can you explain me the steps of this       Log On


   



Question 1191545: Find the result of each operation assume A = 11110001 and B = 10101010
a. A AND B
b. A NAND B

This is my last question for the day! Can you explain me the steps of this question and after, I'll do others by myself? Thanks again!

Answer by math_tutor2020(3835) About Me  (Show Source):
You can put this solution on YOUR website!

Part (a)

We'll be doing a bitwise "AND" operation here.
If the inputs are both 1, then the output is 1. Otherwise the result is 0.

It helps to set up a table or grid like this to line up the digits.
A11110001
B10101010
A AND B (bitwise)10100000


Answer: 10100000

============================================================================
Part (b)

The "NAND" operator means "NOT AND".
What we do is first use the "AND" like normal, but then negate the result.
Here's a reference table
ABA AND BA NAND B
0001
0101
1001
1110

The last two columns are complements of one another (aka opposites)
Note the first two columns represent the sequence 00, 01, 10, 11 which is counting from 0 base 10 to 3 base 10 in binary.

Therefore we can form this bitwise NAND table for the given inputs
A11110001
B10101010
A NAND B (bitwise)01011111

As you can see, the bottom row for NAND is the flipped version of the result of part (a) earlier.

Answer: 01011111
I'm keeping the leading zero because it helps retain the same string length as all the other binary numbers (and it helps show the connection to part a better).
Though of course you could easily remove that first 0.