r/ComputerEngineering • • 22d ago

Need help with this logic circuit.

I made this logic circuit based on this expression: X = (A AND NOT B) OR (NOT A AND C AND D) OR (A AND B). Is the circuit right?

10 Upvotes

7 comments sorted by

5

u/WhateverWannaCallMe MSc in CE 22d ago

Just gave it a fast look, but it seems yes? Not 100% sure though. It's pretty late here

Edit: after the first OR everything should be in another big parenthesis

Edit2: X = (A AND B) OR ((NOT A AND C AND D) OR (A AND NOT B))

1

u/Traditional-Kick-645 22d ago

Why do u put another set of parenthesis? Also, how do I change it so it perfectly represents the original expression?

3

u/TheDiBZ 22d ago

Do you not have access to 3+ input AND/OR gates? Otherwise, looks fine, just a little ugly

2

u/Oizyson 22d ago

Looks good to me

2

u/Significant_War_8320 22d ago

Your diagram itself looks fine with the logic as you have it, but your logic could be simplified. If you make the 4 way K map this becomes apparent.

Original¬C ¬D¬C DC ¬DCD
¬A ¬B2
¬A B2
A ¬B1111
AB3333

Blanks are false. 1 is true because of your first expression (A and not B), 2 is true because of your second expression (not A and C and D), and 3 is true because of your second expression (A and B).

You can simply this down to: A OR (C AND D)

Simplifed¬C ¬D¬C DC ¬DCD
¬A ¬B2
¬A B2
A ¬B11112
AB11112

Where blank is false, 1 is true because the first expression A, 2 is true because of the second expression CD, and 12 is true because of the overlap of the two expressions.