Design a 4-bit AND/OR unit that accepts two 4-bits numbers, A and B, and either AND them or OR them depending on a control signal A/O (when the control signal is 0 perform AND,otherwise if the signal is 1 then perform OR–bitwiselogicaloperation). The result will be stored in C.
Let’s first talk about a 1 bit circuit:
We will first prepare the truth table for the given scenario. When C is 0, we will perform AND operation between A and B, when C is 1, we will perform OR operation on A and B.
A |
B |
C |
Output |
0 |
0 |
0 |
A*B = 0 |
0 |
0 |
1 |
A+B = 0 |
0 |
1 |
0 |
A*B = 0 |
0 |
1 |
1 |
A+B = 1 |
1 |
0 |
0 |
A*B = 0 |
1 |
0 |
1 |
A+B = 1 |
1 |
1 |
0 |
A*B = 1 |
1 |
1 |
1 |
A+B = 1 |
Now to prepare the circuit on basis of this, we will follow a
simple method for designing circuit, which is called the
Sum-Of-Products, or SOP, form. So, a Sum-Of-Products Boolean
expression is basically a set of Boolean terms added together, each
term being a product of Boolean variables. An example would be: ABC
+ BCD + DEF, the sum of products “ABC,” “BCD,” and “DEF.”
Now for above truth table, how to create the SOP expression
For the above truth table, for each row, if output is 0, we ignore the row. As this will not play any role in the output. For the rows, which outputs a 1, we will try to negate the individual bits(if required) to prepare a product term of A, B, C which results 1 for that particular row.
A |
B |
C |
SOP Expression |
0 |
0 |
0 |
N/A |
0 |
0 |
1 |
N/A |
0 |
1 |
0 |
N/A |
0 |
1 |
1 |
|
1 |
0 |
0 |
N/A |
1 |
0 |
1 |
|
1 |
1 |
0 |
|
1 |
1 |
1 |
So overall SOP Expression would be sum of individual SOP expressions, where applicable.
Overall SOP expression = + + +
Now to simplify above Expression, so that we can design the circuit:
SOP expression = + + +
=
=
=
Using principle and
= =
=
Using principle
= =
=
Using principle
=
=
Now this looks simplified:
For 1 bit, result will be
Now the circuit can be designed as(For 1 bit):
Similarly, In case you want it for 4bits of input A and B with 1 bit for control bit C, Circuit can be designed in following way:
Do let me know, in case something is not clear.
Get Answers For Free
Most questions answered within 1 hours.