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.

help me to write code for following circuit

Status
Not open for further replies.

harinisas

Newbie level 6
Joined
Feb 28, 2012
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,372
73_1333540745.jpg


in this circuit the adder is a carry look ahead adder
 

E.g.:
Code:
if reset = '1' then
  Si <= (others => '0');
elsif rising_edge(clk) then
  Si <= Si + Xi;
end if;
 

if u r writing in verilog then

CODE:
always @ (posedge clk or posedge reset)
if (reset==1)
si=xi;
else
si=si+xi;
 

if u r writing in verilog then

CODE:
always @ (posedge clk or posedge reset)
if (reset==1)
si=xi;
else
si=si+xi;



here i am not using normal addition the addition module is carry look ahead adder
 

Better know what a carry look ahead do. it calculates carry in advance. U have shown only the sum in the module.
u chech again ur question
 

here i am not using normal addition the addition module is carry look ahead adder
Any reason to assume, that the synthesis tool is not inferring a carry-look ahead adder?
 

if want to make sure thats carry lookahead adder, may consider to design the carrylookahead adder in a new module with FULL STRUCTURAL (design using AND,OR,XOR gates).

typically need to use some generate i to Si_Size code to generate your Full Adder and connect the worst case propagation delay path to some AND gate or OR gate to ur SUM and CARRY.

Carrylookahead model can easily find in google as well.
 
  • Like
Reactions: FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
if want to make sure thats carry lookahead adder, may consider to design the carrylookahead adder in a new module with FULL STRUCTURAL (design using AND,OR,XOR gates).

typically need to use some generate i to Si_Size code to generate your Full Adder and connect the worst case propagation delay path to some AND gate or OR gate to ur SUM and CARRY.

Carrylookahead model can easily find in google as well.

i have already implemented carry look ahead adder in structural model but when i am giving a feed back loop with register its not taking the previous value
 

you want it to take the previous value, make sure u done correct in the clock timing description..

such as:

Code:
process(clk)
begin
 if (clk'event and clk = '1') then
    C <= A + Register;
    Register <= C;
 end if;
end process

Then you will have feedback effect. :)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top