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.

assining value to register

Status
Not open for further replies.

rockgird

Junior Member level 3
Joined
Apr 28, 2006
Messages
30
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,543
hii ,
m faicin a prob, while assing value to "reg" - port.

actually this is part of my code

module fulladd1(s, co, a, b, ci);
output co, s;
wire co, s;
input a, b, ci;
wire a, b, ci;
wire a_b_o,b_ci_o,a_ci_o;
xor a_b_xor( a_b_o, a, b);
xor s_c_xor( s, a_b_o, ci);
and a_and_ci( a_ci_o, a, b );
and b_and_ci( b_ci_o, a_b_o, ci );
or co_or( co, a_ci_o, b_ci_o );
endmodule

this works

but when i use this

module fulladd1(s, co, a, b, ci);
output co, s;
reg co, s;
input a, b, ci;
wire a, b, ci;
wire a_b_o,b_ci_o,a_ci_o;
xor a_b_xor( a_b_o, a, b);
xor s_c_xor( s, a_b_o, ci);
and a_and_ci( a_ci_o, a, b );
and b_and_ci( b_ci_o, a_b_o, ci );
or co_or( co, a_ci_o, b_ci_o );
endmodule

it dosen't work !!

plz help me out.

PS:- m usin Active HDL 6.3 for writin verilog prog.

thanx in anticipation
 

u must assign a value to register by an clock.
 

u use the intantiated primitive modules to assign the output, but actually it just equals to have continuous assignment in this progress, also it have to be the wire type, if you want to have reg type, u have to have a process, just always block, you can resort something else about this topic to verilog tutorial
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top