In: Computer Science
Prime number indicator: In this activity, you will design a circuit that indicates whether a number between 0 through 15 is a prime number or not. A prime number is defined as a number that can be divided only by itself and 1. By definition, the numbers 0 and 1 are not prime.
The circuit must have four binary inputs A, B, C, D, and one output, G. The output signal G is true (G = 1) if the input represents a prime number and is false (G = 0) otherwise.
a) Construct a truth table to represent this problem
b) Derive the Boolean equation for F from the truth table
c) Derive a simplified expression for F
d) Draw a logic circuit to implement your solution using AND, OR and NOT gates
e) Draw a logic circuit to implement your solution using NOR gates only
Before moving to the actual solution you need to know that Prime Numbers are those numbers which have only 2 factores i.e 1 and the number itself.
Note: 0 and 1 are not prime.
Numbers | I/P(A,B,C,D) | O/P(G) |
---|---|---|
0 | 0 0 0 0 | 0 |
1 | 0 0 0 1 | 0 |
2 | 0 0 1 0 | 1 |
3 | 0 0 1 1 | 1 |
4 | 0 1 0 0 | 0 |
5 | 0 1 0 1 | 1 |
6 | 0 1 1 0 | 0 |
7 | 0 1 1 1 | 1 |
8 | 1 0 0 0 | 0 |
9 | 1 0 0 1 | 0 |
10 | 1 0 1 0 | 0 |
11 | 1 0 1 1 | 1 |
12 | 1 1 0 0 | 0 |
13 | 1 1 0 1 | 1 |
14 | 1 1 1 0 | 0 |
15 | 1 1 1 1 | 0 |
b} So, lets talk about the Boolean expression of the function F from the truth table:
F(A,B,C,D) = A’B’CD’ + A’B’CD + A’BC’D + A’BCD + AB’CD + ABC'D
c) Now it is the time to simplified the boolean expression which we got in the step 2 i.e : .
F(A,B,C,D) = A’B’CD’ + A’B’CD + A’BC’D + A’BCD + AB’CD + ABC'D
We are going to take Karnough Map for this:
Here we have 4 pairs so we are taking all the pairs and we will get the expression:
F(A,B,C,D) = BC'D + A'BD + A'B'C + B'CD , after simplifying the expression.
d) Now, lets draw the logic circuit using AND,OR and NOT gates
So, here is the circuit for the expression we evaluated.
e) Now, the task is to draw the logic circuit for the same expression but with only NOR gates.
Here in this circuit we only used NOR gate, we used mostly De-Morgan's Law which states that:
(A.B)' = A' + B' and
(A + B)' = A'.B'
we used the same property every where, where we need to do and operations we did nor operation using De-Morgan's Law it direcly converts into and operation
And by the use of double negation we are balancing all the things.
Here we are using one law i.e Idempotent law which states that : A + A = A
hence we are passing same input into the nor gate to get A' as (A + A)' = A'.
I hope I am able to solve your problem, if yes then do give it a thumbs up because it takes effort :)