AnandTech Forums Basic circuit theory
 Register FAQ Calendar Mark Forums Read

Forums
 · Hardware and Technology · CPUs and Overclocking · Motherboards · Video Cards and Graphics · Memory and Storage · Power Supplies · Cases & Cooling · SFF, Notebooks, Pre-Built/Barebones PCs · Networking · Peripherals · General Hardware · Highly Technical · Computer Help · Home Theater PCs · Consumer Electronics · Digital and Video Cameras · Mobile Devices & Gadgets · Audio/Video & Home Theater · Software · Software for Windows · All Things Apple · *nix Software · Operating Systems · Programming · PC Gaming · Console Gaming · Distributed Computing · Security · Social · Off Topic · Politics and News · Discussion Club · Love and Relationships · The Garage · Health and Fitness · Merchandise and Shopping · For Sale/Trade · Hot Deals · Free Stuff · Contests and Sweepstakes · Black Friday 2012 · Forum Issues · Technical Forum Issues · Personal Forum Issues · Suggestion Box · Moderator Resources · Moderator Discussions
 11-28-2012, 10:21 PM #1 atomheart Member     Join Date: Sep 2012 Location: Florida, United States Posts: 32 Basic circuit theory I was given an equation to draw a circuit "X Y Z (X + Y + Z) + ~X ~Y ~Z (X + Y + Z) + (~X + ~Y + ~Z) ~Z + X Z (Y + ~Z)=F" My initial design used 22 gates but I was told you could get creative and reduce the amount of gates. After enough tinkering I got it down to 2 NAND gates. The resulting equation from the 2 gate design is "~(Z ~(X Y))=F" The output from each circuit (results in truth table) is the same for both designs even though the equation and amount of gates is different. My question is, will both these designs essentially function the same? Or did I reduce it too much and change the core of its function?
 11-28-2012, 10:54 PM #2 TuxDave Lifer     Join Date: Oct 2002 Posts: 10,050 I assume your logic conversion is right. So in steady state, meaning after the output has finally propagated through all the logic, you will be identical. What you get in the physical domain is a better transient response (your output will settle to the right output faster) and smaller area/power in circuits. "Functionality" always refers to logical behavior so you are functionally the same. However you will have a different timing behavior which could be good (max path) or bad (min path) __________________ post count = post count + 0.999..... (\__/) (='.'=)This is Bunny. Copy and paste bunny into your (")_(")signature to help him gain world domination.
11-28-2012, 11:03 PM   #3
atomheart
Member

Join Date: Sep 2012
Location: Florida, United States
Posts: 32

Quote:
 Originally Posted by TuxDave I assume your logic conversion is right. So in steady state, meaning after the output has finally propagated through all the logic, you will be identical. What you get in the physical domain is a better transient response (your output will settle to the right output faster) and smaller area/power in circuits. "Functionality" always refers to logical behavior so you are functionally the same. However you will have a different timing behavior which could be good (max path) or bad (min path)
That helps, thanks. Would you say all that matters is input and output? When talking in terms of the circuit's function. I was told having more gates introduced more latency, what would be a negative to having a lower timing?

 11-29-2012, 02:47 AM #4 lakedude Golden Member   Join Date: Mar 2009 Posts: 1,026 Oooh can I play? I get z'+xy but it has been a while, could have made a mistake. Here is how I does it: The first term xyz(x+y+z) simplifies to xyz, already got all 3 inputs from the "and" part so the "or" part is not needed. The second term x'y'z'(x+y+z) is zero, can't have an input and the opposite at the same time. Skipping the third term, the last term xz(y+z') becomes xyz + xzz'. xyz is redundant with the first term so we can toss it and xzz' is zero cause you can't have both z and z' at the same time so the entire last term can be tossed out. I only got the third term from z'(x'+y'+z') to x'z' +y'z'+z' for a final equation using Boolean algebra of: xyz+x'z'+y'z'+z' But wait that was not my final answer! I makes a truth table 10101011 and plugs that into a Karnaugh Map which gives 1s @ all 4 corners plus a stray 1 @ xyz The 4 corners make for z' and I combined the xyz entry with xyz' to yield xy. Final answer z'+xy! Is that right? Last edited by lakedude; 11-29-2012 at 02:51 AM.
 11-29-2012, 03:04 AM #5 lakedude Golden Member   Join Date: Mar 2009 Posts: 1,026 Oops now I see how I could have used absorption to make the 3rd term just z'... Then I would have had xyz+z' before using the K-map.
11-29-2012, 12:15 PM   #6
TuxDave
Lifer

Join Date: Oct 2002
Posts: 10,050

Quote:
 Originally Posted by atomheart That helps, thanks. Would you say all that matters is input and output? When talking in terms of the circuit's function. I was told having more gates introduced more latency, what would be a negative to having a lower timing?
Yeah, most of the time all that matters is input and output logic. Once you get into implementation, the more gates you use, the longer it may take for the correct value to appear at the output. 99% of the time faster is always better. However there is a concept of "min paths" which relates to how data travels between two sequential/timing elements.

The classic example is the washer-dryer example. Ideally when both open, dry clothes go out, wet clothes from the washer go to the dryer, dirty clothes go into the washer. And then they both close and do their business. A min path would be if the dirty clothes basically go so fast that it passes through the washer and directly to the dryer. But this is usually solvable by slowing it down but the best way to slow it down is NOT to use a large # of gates, but to use the minimum number of gates and just add small devices at the end to buffer it along.
__________________
post count = post count + 0.999.....
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.

 11-29-2012, 12:40 PM #7 PandaBear Golden Member   Join Date: Aug 2000 Location: Sunnyvale, CA Posts: 1,360 In steady state they would be identical and encouraged. In analog / RF types of application the transient behavior could be different and you will likely have different possible path before reaching steady. It is not just going from point A to point B on a K map, but in a circuit with a lot of gates you may see going back and forth between different points before reaching steady. The fewer gates you have, the less bouncing around you will see. __________________ (\__/) (='.'=) (")_(") Happy with M since 2001 My Heat
 01-10-2013, 02:53 PM #8 Ichinisan Lifer     Join Date: Oct 2002 Location: Newnan, GA USA Posts: 11,817 Is it possible to learn this kind of stuff on my own? ...or is formal training pretty-much required? __________________ this is my signature.
01-10-2013, 03:21 PM   #9
TuxDave
Lifer

Join Date: Oct 2002
Posts: 10,050

Quote:
 Originally Posted by Ichinisan Is it possible to learn this kind of stuff on my own? ...or is formal training pretty-much required?
Getting the basics of "what does AND mean, what does OR mean, what does NOT mean" is the first step. Then you start learning how to analyze complex statements, then you learn how to simplify and optimize. This is all still purely logic without any notion of implementation or application. Up to this point, it's very doable.

Application is sort of like learning how to program. You can learn about binary math and various logic structures. I find this step also pretty easy. Once you understand how binary math works, you can apply the logic equations and everything you learned in step 1.

Implementation, beyond the "an AND gate is some magic black box" requires some amount of formal training if you really want to understand good and bad implementations. This one is probably a bigger hurdle for most.
__________________
post count = post count + 0.999.....
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.

 01-15-2013, 10:23 AM #10 harrkev Senior Member   Join Date: May 2004 Posts: 658 The BEST way to learn is to help design a multi-million gate ASIC. :-) Back when I used to do FPGA work for a living I understood setup paths very well, but FPGAs never have hold problems. Now I do ASIC work (both front end and back end), and I have found that hold problems are often harder to understand and fix than setup problems. The tools are supposed to fix timing problems by themselves, and hold problems SHOULD be easy to fix (just add delay cells). When you still have hold issues, you have to figure out why the stupid tool war not able to fix it. Very frustrating for tool that cost more to license than my first house cost to buy. __________________ My wife's business: Enhancing married romance. May be very slightly NSFW.
01-15-2013, 11:16 AM   #11
TuxDave
Lifer

Join Date: Oct 2002
Posts: 10,050

Quote:
 Originally Posted by harrkev The BEST way to learn is to help design a multi-million gate ASIC. :-) Back when I used to do FPGA work for a living I understood setup paths very well, but FPGAs never have hold problems. Now I do ASIC work (both front end and back end), and I have found that hold problems are often harder to understand and fix than setup problems. The tools are supposed to fix timing problems by themselves, and hold problems SHOULD be easy to fix (just add delay cells). When you still have hold issues, you have to figure out why the stupid tool war not able to fix it. Very frustrating for tool that cost more to license than my first house cost to buy.
Wait until you get hold and setup violations on the same start and end point while going through the same gates too. That's actually one of my interview questions. Haha. (and it's not a theoretical textbook case too. I happened to design such a mess and found it interesting when I saw it)
__________________
post count = post count + 0.999.....
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.

Last edited by TuxDave; 01-15-2013 at 11:30 AM.

01-16-2013, 12:32 PM   #12
harrkev
Senior Member

Join Date: May 2004
Posts: 658

Quote:
 Originally Posted by TuxDave Wait until you get hold and setup violations on the same start and end point while going through the same gates too. That's actually one of my interview questions. Haha. (and it's not a theoretical textbook case too. I happened to design such a mess and found it interesting when I saw it)
I know. I have seen that too - a few times. Very frustrating... Trying to figure out what is going on is quite frustrating.

What is worse is finding hold violations, and there is NO REASON for it. All paths to a regsiter have plenty of setup slack, but there are hold problems. Then, you add several delays by hand (pain in the rear), and everything passes. Why couln't Encounter do that???

**EDIT**
Ok. I just re-read your post. The same path was causing a setup and hold violation at the same time? How does that happen? I have seen register inputs with setup and hold violations, but the paths were different.

BTW: Where do you work?
__________________
My wife's business: Enhancing married romance.
May be very slightly NSFW.

Last edited by harrkev; 01-16-2013 at 12:34 PM.

01-16-2013, 04:08 PM   #13
TuxDave
Lifer

Join Date: Oct 2002
Posts: 10,050

Quote:
 Originally Posted by harrkev I know. I have seen that too - a few times. Very frustrating... Trying to figure out what is going on is quite frustrating. What is worse is finding hold violations, and there is NO REASON for it. All paths to a regsiter have plenty of setup slack, but there are hold problems. Then, you add several delays by hand (pain in the rear), and everything passes. Why couln't Encounter do that??? **EDIT** Ok. I just re-read your post. The same path was causing a setup and hold violation at the same time? How does that happen? I have seen register inputs with setup and hold violations, but the paths were different. BTW: Where do you work?
Intel.

This was on a phase path between a phase 2 latch and a phase 1 clock enable. Min is falling edge of clock on latch to falling edge of clock on clock cell. Max is falling edge of clock on latch to rising edge of clock on clock cell. The timing window is really small and it was made impossible by a very long unshielded RC segment (causing the wire delay to dominate the path and be SUPER slow on max and SUPER fast on min).
__________________
post count = post count + 0.999.....
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.

 01-16-2013, 04:23 PM #14 harrkev Senior Member   Join Date: May 2004 Posts: 658 I try to avoid latches whenever possible. On my current project, we have a rule: the clock scheme must fit on one letter-size paper drawn with a dull crayon. I work at Agilent. __________________ My wife's business: Enhancing married romance. May be very slightly NSFW.