Question

Let a3a2a1a0 and b3b2b1b0 be 4-bit binary number, where a3 and b3 are the most significant...

Let a3a2a1a0 and b3b2b1b0 be 4-bit binary number, where a3 and b3 are the most significant bits and a0 and b0 are the least significant bits. Write a boolean formula that evaluates to true if a3a2a1a0 > b3b2b1b0, and false otherwise. Python. Submit a formula. You must use variables a3, a3, a2, a1, b3, b2, b1, b0 in the formula

0 0
Add a comment Improve this question Transcribed image text
Answer #1
a3 = 0;# MSB of A
a2 = 1;
a1 = 1;
a0 = 1;# LSB of A

b3 = 1;# MSB of B
b2 = 1;
b1 = 1;
b0 = 1;# LSB of B

#Using 4-bit magnitude comparator's logic expression to find if A > B
f = (a3 and not b3) or (not(a3 ^ b3) and (a2 and not b2)) or (not(a3 ^ b3) and not(a2 ^ b2) and (a1 and not b1)) or (not(a3 ^ b3) and not(a2 ^ b2) and not(a1 ^ b1) and (a0 and not b0))

print(f)

OUTPUT:
False

NOTE:- Symbol ^ used in the formula is the bitwise XOR operator.

Add a comment
Know the answer?
Add Answer to:
Let a3a2a1a0 and b3b2b1b0 be 4-bit binary number, where a3 and b3 are the most significant...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT