Detector of even numbers in logic circuit

Click For Summary

Discussion Overview

The discussion revolves around designing a logic circuit that detects even numbers based on binary representations of signed integers. Participants explore the characteristics of binary numbers that indicate evenness, specifically focusing on the least significant bit of the inputs.

Discussion Character

  • Homework-related
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks guidance on deriving the equation for detecting even numbers from two binary inputs, A and B.
  • Several participants note that the least significant bit of a binary number determines its parity, with 0 indicating even and 1 indicating odd.
  • There is a suggestion to use Karnaugh maps for simplifying the logic equations for inputs A and B.
  • Participants discuss how to combine conditions for both inputs A and B to determine the output F.
  • One participant proposes the equation F = /B0 * /A0, indicating that both least significant bits must be 0 for F to be 1.
  • Another participant questions the validity of the proposed equation when both inputs are odd.
  • There is a discussion about propagation delays in the circuit components and how to calculate the maximum period required for the output to stabilize.

Areas of Agreement / Disagreement

Participants generally agree on the role of the least significant bit in determining evenness, but there is some confusion regarding the combination of conditions and the correctness of the proposed logic equation. The discussion about propagation delays also shows varying perspectives on how to approach the calculation.

Contextual Notes

Some participants express uncertainty about how to represent multi-bit binary numbers in the circuit design, and there are unresolved questions about combining conditions into a single logical statement.

Who May Find This Useful

This discussion may be useful for students and practitioners in electrical engineering or computer science, particularly those interested in digital logic design and circuit analysis.

Max0007
Messages
66
Reaction score
1

Homework Statement


I need to make a circuit that detects even numbers.
Need to find the equation for F when input A and B are both even.

Input A: Word of 5 -bit signed representation in complement 2.
Input B: Word of 3 -bit signed representation in complement 2.

Homework Equations


for B:
000 = 0 (even)
001 = 1
010 = 2 (even)
011 = 3
100 = -4 (even)
101 = -3
110 = -2 (even)
111 = -1

For A:
same as B but with 5 bits.

00000 = 0 (even)
00001 = 1
00010 = 2 (even)
00011 = 3
00100 = 4 (even)
00101 = 5
00110 = 6 (even)
00111 = 7
...
...
11111 = -1

The Attempt at a Solution



I am just wanting to know the steps on how I start this.

Do I do Karnaugh for both inputs then join both equation together?
 
Physics news on Phys.org
What feature of a number represented in binary (either unsigned or 2's complement) allows you to tell that it is odd or even? Don't need to convert it to decimal... There is something all even binary numbers have in common that allows you identify them as even.
 
lewando said:
What feature of a number represented in binary (either unsigned or 2's complement) allows you to tell that it is odd or even? Don't need to convert it to decimal... There is something all even binary numbers have in common that allows you identify them as even.
I realized that binary ending with a 0 = even and binary ending with 1 = odd.

So basically its F = /A/B ??
 
You are not interested in all of the binary digits of A or B. Just the least significant binary digit.
 
  • Like
Likes   Reactions: Max0007
lewando said:
You are not interested in all of the binary digits of A or B. Just the least significant binary digit.
How do I make my logic circuit to check only the least significant binary digit?
 
Max0007 said:
How do I make my logic circuit to check only the least significant binary digit?
if input B least significant bit = 0 then its an even number.
if input A least significant bit = 0 then its an even number.

If A and B = 0 then its an even number and F = 1

but how do I actually write this in an equation with gates?
 
Max0007 said:
if input B least significant bit = 0 then its an even number.
if input A least significant bit = 0 then its an even number.

If A and B = 0 then its an even number and F = 1

but how do I actually write this in an equation with gates?
Why do you have "If A and B = 0 then its an even number and F = 1" as a separate condition?

Why do you have the first two statements as independent statements? They are NOT true taken as stand-alone statements.

How do you combine all 3 statements into one statement?
 
  • Like
Likes   Reactions: Max0007
phinds said:
Why do you have "If A and B = 0 then its an even number and F = 1" as a separate condition?

Why do you have the first two statements as independent statements? They are NOT true taken as stand-alone statements.

How do you combine all 3 statements into one statement?
Sorry my english is not my primary language I did not meant to split it up in 2 condition, just that when A and B = 0 then the output is 1.
 
phinds said:
Why do you have "If A and B = 0 then its an even number and F = 1" as a separate condition?

Why do you have the first two statements as independent statements? They are NOT true taken as stand-alone statements.

How do you combine all 3 statements into one statement?
Here are my Kmap for input A and B.
 

Attachments

  • kmap1.jpg
    kmap1.jpg
    37.3 KB · Views: 867
  • kmap2.jpg
    kmap2.jpg
    33.6 KB · Views: 848
  • #10
You had it right in your statements and now you are complicating it. Why?
 
  • #11
Max0007 said:
How do I make my logic circuit to check only the least significant binary digit?

Maybe this is the root of the problem. When you have to draw an actual circuit, how will you represent a 5-bit binary number? A 3-bit binary number? What will you draw?
 
  • #12
phinds said:
You had it right in your statements and now you are complicating it. Why?
I don't know, but here the final equation:

F = /B0 * /A0
 
  • #13
That looks right.
 
  • #14
lewando said:
That looks right.
Really? How about when both numbers are odd?
 
  • #15
phinds said:
Really? How about when both numbers are odd?
if both numbers are odd it would output 0 since I am only checking the least significant bit. and the least significant bit in odd numbers will be 1. and 1 * 1 would output 0 since there are NOT gates in both inputs or am I wrong ?
 
  • #16
Max0007 said:
if both numbers are odd it would output 0 since I am only checking the least significant bit. and the least significant bit in odd numbers will be 1. and 1 * 1 would output 0 since there are NOT gates in both inputs or am I wrong ?
Sorry, I got to thinking we were doing an adder output. You and lewando are both right and I'm wrong. Now *I* was over thinking it :smile:
 
  • #17
phinds said:
Sorry, I got to thinking we were doing an adder output. You and lewando are both right and I'm wrong. Now *I* was over thinking it :smile:
No worries man, you helped me a lot today and these past days, I really appreciate it man. I just wish my teachers were a little bit better :(
 
  • #18
phinds said:
Sorry, I got to thinking we were doing an adder output. You and lewando are both right and I'm wrong. Now *I* was over thinking it :smile:
one last thing :)
If an inverter has a 2 ns propagation delay , an AND logic gate has a 5 ns propagation delay and an OR gate has a 4ns delay , what is the maximum period required by the circuit in order to update the output F ?

would I just do 2ns x 2 sicne I have 2 inverter and 5ns x1 since I only have one then add up everything ? = 4+5=9ns ?
 
  • #19
From a time-flow perspective, the inverters are operating in parallel of each other and the AND gate is in series with the inverters. You are correct to not consider a nonexistant OR gate. 9 ns would be incorrect. Rethink.
 
  • #20
lewando said:
From a time-flow perspective, the inverters are operating in parallel of each other and the AND gate is in series with the inverters. You are correct to not consider a nonexistant OR gate. 9 ns would be incorrect. Rethink.
2+5= 7 then

I
 
  • #21
Looks right!
 
  • Like
Likes   Reactions: Max0007
  • #22
lewando said:
Looks right!
how would I calculate it if I had 3 different gates in parallels?
 
  • #23
The worst-case delay (longest) is dominant.
 
  • Like
Likes   Reactions: Max0007
  • #24
lewando said:
The worst-case delay (longest) is dominant.
Nice awesome thanks.

I really learn a lot more here than in Class at the University so far.
:)
 
  • #25
University for undergrad is often overly-difficult by design. You are wise to seek additional resources to complete your understanding. Keep up the good work!
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 12 ·
Replies
12
Views
10K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 26 ·
Replies
26
Views
5K
  • · Replies 26 ·
Replies
26
Views
3K