Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

if statement using digital hardware

Status
Not open for further replies.

EMmME

Newbie level 3
Joined
Feb 7, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Sudan
Activity points
1,304
Hello,
I know its a kind of a stupid question. But how can i construct an if statement with digital blocks such as ANDs, flip flop....etc. I would be thankful if a layout is included
 

An if/else structure can be realized using a mux.
 

and the question is now how it is "synthesized"

If addwithcarry=1
then s=a+b+1
else s=a+b
end

So is the carry input "cin" into a single adder set to cin=addwithcarry or is the addwithcarry variable used to select the MUX of two parallel adders. One with carry and one without.

s1=a+b;
s2=a+b+1;

s=mux(s1,s2,addwithcarry)

I am not an expert in digital synthesis but I have seen digital designers making schematics on paper to code in a proper way for an optimum area and speed.
 

in this case I would think:

s=a+b+addwithcarry

You do not need any more logic...
 

Here is an **broken link removed**. You not only see how to build it, you can play with it. Plus the accompanying article explains how to use it.

Good luck.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top